Compare commits
3 commits
8527b2411e
...
056fa3de68
Author | SHA1 | Date | |
---|---|---|---|
056fa3de68 | |||
|
919b8c203c | ||
|
724839cf19 |
6 changed files with 198 additions and 184 deletions
|
@ -1,6 +1,7 @@
|
||||||
|
moveit_controller_manager: moveit_simple_controller_manager/MoveItSimpleControllerManager
|
||||||
|
moveit_simple_controller_manager:
|
||||||
controller_names:
|
controller_names:
|
||||||
- joint_trajectory_controller
|
- joint_trajectory_controller
|
||||||
|
|
||||||
joint_trajectory_controller:
|
joint_trajectory_controller:
|
||||||
action_ns: follow_joint_trajectory
|
action_ns: follow_joint_trajectory
|
||||||
type: FollowJointTrajectory
|
type: FollowJointTrajectory
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
move_group:
|
||||||
|
planning_plugin: ompl_interface/OMPLPlanner
|
||||||
|
request_adapters:
|
||||||
|
default_planner_request_adapters/AddTimeOptimalParameterization default_planner_request_adapters/FixWorkspaceBounds default_planner_request_adapters/FixStartStateBounds default_planner_request_adapters/FixStartStateCollision default_planner_request_adapters/FixStartStatePathConstraints
|
||||||
|
start_state_max_bounds_error: 0.1
|
||||||
|
|
||||||
planner_configs:
|
planner_configs:
|
||||||
SBLkConfigDefault:
|
SBLkConfigDefault:
|
||||||
type: geometric::SBL
|
type: geometric::SBL
|
||||||
|
@ -147,3 +153,4 @@ ar3_arm:
|
||||||
- LazyPRMstarkConfigDefault
|
- LazyPRMstarkConfigDefault
|
||||||
- SPARSkConfigDefault
|
- SPARSkConfigDefault
|
||||||
- SPARStwokConfigDefault
|
- SPARStwokConfigDefault
|
||||||
|
|
||||||
|
|
4
src/ar3_config/config/planning_scene.yaml
Normal file
4
src/ar3_config/config/planning_scene.yaml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
publish_planning_scene: true
|
||||||
|
publish_geometry_updates: true
|
||||||
|
publish_state_updates: true
|
||||||
|
publish_transforms_updates: true
|
4
src/ar3_config/config/trajectory.yaml
Normal file
4
src/ar3_config/config/trajectory.yaml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
moveit_manage_controllers: true
|
||||||
|
trajectory_execution.allowed_execution_duration_scaling: 1.2
|
||||||
|
trajectory_execution.allowed_goal_duration_margin: 0.5
|
||||||
|
trajectory_execution.allowed_start_tolerance: 0.1
|
|
@ -1,8 +1,7 @@
|
||||||
from os.path import join
|
from os.path import join
|
||||||
from ament_index_python.packages import get_package_share_directory
|
from ament_index_python.packages import get_package_share_directory
|
||||||
from launch import LaunchDescription
|
from launch import LaunchDescription
|
||||||
from launch_ros.actions import Node, ComposableNodeContainer
|
from launch_ros.actions import Node
|
||||||
from launch_ros.descriptions import ComposableNode
|
|
||||||
from launch.actions import ExecuteProcess
|
from launch.actions import ExecuteProcess
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
@ -31,7 +30,7 @@ def generate_launch_description():
|
||||||
executable='rviz2',
|
executable='rviz2',
|
||||||
output='log',
|
output='log',
|
||||||
arguments=['-d', join(launch_root, 'rviz', 'ar3.rviz')],
|
arguments=['-d', join(launch_root, 'rviz', 'ar3.rviz')],
|
||||||
parameters=[robot_description, robot_description_semantic, robot_description_kinematics],
|
parameters=[robot_description, robot_description_semantic, robot_description_kinematics]
|
||||||
),
|
),
|
||||||
|
|
||||||
# Attatch robot to map
|
# Attatch robot to map
|
||||||
|
@ -39,7 +38,7 @@ def generate_launch_description():
|
||||||
package='tf2_ros',
|
package='tf2_ros',
|
||||||
executable='static_transform_publisher',
|
executable='static_transform_publisher',
|
||||||
output='screen',
|
output='screen',
|
||||||
arguments=['0', '0', '0', '0', '0', '0', 'world', 'base_link'],
|
arguments=['0', '0', '0', '0', '0', '0', 'world', 'base_link']
|
||||||
),
|
),
|
||||||
|
|
||||||
Node(
|
Node(
|
||||||
|
@ -74,25 +73,30 @@ def generate_launch_description():
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
output="screen",
|
output="screen",
|
||||||
),
|
)
|
||||||
|
|
||||||
# Controller
|
# Controller
|
||||||
Node(
|
Node(
|
||||||
package='controller_manager',
|
package='controller_manager',
|
||||||
executable='ros2_control_node',
|
executable='ros2_control_node',
|
||||||
output='screen',
|
output='screen',
|
||||||
parameters=[robot_description, join(config_root, 'controller_manager.yaml')],
|
parameters=[robot_description, join(config_root, 'controller_manager.yaml')]
|
||||||
),
|
),
|
||||||
|
|
||||||
# Start controllers
|
# Start controllers
|
||||||
ExecuteProcess(
|
ExecuteProcess(
|
||||||
cmd=['ros2 run controller_manager spawner.py joint_trajectory_controller'],
|
cmd=['ros2 run controller_manager spawner.py joint_trajectory_controller'],
|
||||||
shell=True,
|
shell=True,
|
||||||
output='screen',
|
output='screen'),
|
||||||
),
|
|
||||||
ExecuteProcess(
|
ExecuteProcess(
|
||||||
cmd=['ros2 run controller_manager spawner.py joint_state_controller'],
|
cmd=['ros2 run controller_manager spawner.py joint_state_controller'],
|
||||||
shell=True,
|
shell=True,
|
||||||
|
output='screen'),
|
||||||
|
|
||||||
|
# Run platform
|
||||||
|
Node(
|
||||||
|
package='cobot_platform',
|
||||||
|
executable='move',
|
||||||
output='screen',
|
output='screen',
|
||||||
),
|
),
|
||||||
|
|
||||||
|
@ -105,9 +109,11 @@ def generate_launch_description():
|
||||||
robot_description,
|
robot_description,
|
||||||
robot_description_semantic,
|
robot_description_semantic,
|
||||||
robot_description_kinematics,
|
robot_description_kinematics,
|
||||||
{'move_group': join(config_root, 'ompl_planning.yaml')},
|
get_yaml(join(config_root, 'ompl_planning.yaml')),
|
||||||
{'moveit_simple_controller_manager': join(config_root, "ar3_controllers.yaml")},
|
get_yaml(join(config_root, 'trajectory.yaml')),
|
||||||
]
|
get_yaml(join(config_root, 'planning_scene.yaml')),
|
||||||
|
get_yaml(join(config_root, "ar3_controllers.yaml")),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
|
|
||||||
# Robot state publisher
|
# Robot state publisher
|
||||||
|
@ -115,14 +121,5 @@ def generate_launch_description():
|
||||||
package='robot_state_publisher',
|
package='robot_state_publisher',
|
||||||
executable='robot_state_publisher',
|
executable='robot_state_publisher',
|
||||||
output='screen',
|
output='screen',
|
||||||
parameters=[robot_description],
|
parameters=[robot_description]),
|
||||||
),
|
|
||||||
|
|
||||||
# Interface with arduino
|
|
||||||
Node(
|
|
||||||
package='cobot_platform',
|
|
||||||
executable='move',
|
|
||||||
output='screen',
|
|
||||||
),
|
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
|
@ -46,11 +46,11 @@ class CobotMove(Node):
|
||||||
print(self._serial.readline())
|
print(self._serial.readline())
|
||||||
|
|
||||||
def _move_j1_cb(self, msg):
|
def _move_j1_cb(self, msg):
|
||||||
self._cur[0] = int(msg.data / pi / 2. * 2000)
|
self._cur[0] = int(msg.data / pi / 2. * 8000)
|
||||||
self._move_servo()
|
self._move_servo()
|
||||||
|
|
||||||
def _move_j2_cb(self, msg):
|
def _move_j2_cb(self, msg):
|
||||||
self._cur[1] = int(msg.data / pi / 2. * 3840.64)
|
self._cur[1] = int(msg.data / pi / 2. * 10000)
|
||||||
self._move_servo()
|
self._move_servo()
|
||||||
|
|
||||||
def _move_j3_cb(self, msg):
|
def _move_j3_cb(self, msg):
|
||||||
|
@ -105,3 +105,4 @@ def main(args=None):
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue