-
Notifications
You must be signed in to change notification settings - Fork 259
Move Group C++ Interface #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1e57499
initial port to ros2
MarqRazz 3ec9dc8
fixed code comments to work with html generator
MarqRazz ca30f26
Merge branch 'main' of https://github.com/ros-planning/moveit2_tutori…
MarqRazz 5787cb5
merged with main and clang formatted
MarqRazz 2678740
enabled rviz_visual_tools
MarqRazz 7169adb
updated rviz config to include tutorial marker topic
MarqRazz a3eec38
updated webpage
MarqRazz db06f2d
fixed demo errors
MarqRazz 5d916f8
applied clang format
MarqRazz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,16 @@ | ||
| add_executable(move_group_interface_tutorial | ||
| src/move_group_interface_tutorial.cpp) | ||
| target_link_libraries(move_group_interface_tutorial | ||
| ${catkin_LIBRARIES} ${Boost_LIBRARIES}) | ||
| install(TARGETS move_group_interface_tutorial DESTINATION | ||
| ${CATKIN_PACKAGE_BIN_DESTINATION}) | ||
| target_include_directories(move_group_interface_tutorial | ||
| PUBLIC include) | ||
| ament_target_dependencies(move_group_interface_tutorial | ||
| ${THIS_PACKAGE_INCLUDE_DEPENDS} Boost) | ||
|
|
||
| install(DIRECTORY launch DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) | ||
| install(TARGETS move_group_interface_tutorial | ||
| DESTINATION lib/${PROJECT_NAME} | ||
| ) | ||
| install(DIRECTORY launch | ||
| DESTINATION share/${PROJECT_NAME} | ||
| ) | ||
| install(DIRECTORY config | ||
| DESTINATION share/${PROJECT_NAME} | ||
| ) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| controller_names: | ||
| - panda_arm_controller | ||
|
|
||
| panda_arm_controller: | ||
| action_ns: follow_joint_trajectory | ||
| type: FollowJointTrajectory | ||
| default: true | ||
| joints: | ||
| - panda_joint1 | ||
| - panda_joint2 | ||
| - panda_joint3 | ||
| - panda_joint4 | ||
| - panda_joint5 | ||
| - panda_joint6 | ||
| - panda_joint7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| panda_arm_controller: | ||
| ros__parameters: | ||
| joints: | ||
| - panda_joint1 | ||
| - panda_joint2 | ||
| - panda_joint3 | ||
| - panda_joint4 | ||
| - panda_joint5 | ||
| - panda_joint6 | ||
| - panda_joint7 | ||
| write_op_modes: | ||
| - panda_joint1 | ||
| - panda_joint2 | ||
| - panda_joint3 | ||
| - panda_joint4 | ||
| - panda_joint5 | ||
| - panda_joint6 | ||
| - panda_joint7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| fake_joint_driver_node: | ||
| ros__parameters: | ||
| start_position: | ||
| joints: | ||
| - panda_joint1 | ||
| - panda_joint2 | ||
| - panda_joint3 | ||
| - panda_joint4 | ||
| - panda_joint5 | ||
| - panda_joint6 | ||
| - panda_joint7 | ||
| values: | ||
| - 0.0 | ||
| - -0.785 | ||
| - 0.0 | ||
| - -2.356 | ||
| - 0.0 | ||
| - 1.571 | ||
| - 0.785 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,118 @@ | ||
| import os | ||
| import yaml | ||
| from launch import LaunchDescription | ||
| from launch_ros.actions import Node | ||
| from ament_index_python.packages import get_package_share_directory | ||
|
|
||
| def load_file(package_name, file_path): | ||
| package_path = get_package_share_directory(package_name) | ||
| absolute_file_path = os.path.join(package_path, file_path) | ||
|
|
||
| try: | ||
| with open(absolute_file_path, 'r') as file: | ||
| return file.read() | ||
| except EnvironmentError: # parent of IOError, OSError *and* WindowsError where available | ||
| return None | ||
|
|
||
| def load_yaml(package_name, file_path): | ||
| package_path = get_package_share_directory(package_name) | ||
| absolute_file_path = os.path.join(package_path, file_path) | ||
|
|
||
| try: | ||
| with open(absolute_file_path, 'r') as file: | ||
| return yaml.safe_load(file) | ||
| except EnvironmentError: # parent of IOError, OSError *and* WindowsError where available | ||
| return None | ||
|
|
||
|
|
||
| def generate_launch_description(): | ||
|
|
||
| # planning_context | ||
| robot_description_config = load_file('moveit_resources_panda_description', 'urdf/panda.urdf') | ||
| robot_description = {'robot_description' : robot_description_config} | ||
|
|
||
| robot_description_semantic_config = load_file('moveit_resources_panda_moveit_config', 'config/panda.srdf') | ||
| robot_description_semantic = {'robot_description_semantic' : robot_description_semantic_config} | ||
|
|
||
| kinematics_yaml = load_yaml('moveit_resources_panda_moveit_config', 'config/kinematics.yaml') | ||
| robot_description_kinematics = { 'robot_description_kinematics' : kinematics_yaml } | ||
|
|
||
| # Planning Functionality | ||
| ompl_planning_pipeline_config = { '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 } } | ||
| ompl_planning_yaml = load_yaml('moveit_resources_panda_moveit_config', 'config/ompl_planning.yaml') | ||
| ompl_planning_pipeline_config['move_group'].update(ompl_planning_yaml) | ||
|
|
||
| # Trajectory Execution Functionality | ||
| controllers_yaml = load_yaml('moveit2_tutorials', 'config/controllers.yaml') | ||
| moveit_controllers = { 'moveit_simple_controller_manager' : controllers_yaml, | ||
| 'moveit_controller_manager': 'moveit_simple_controller_manager/MoveItSimpleControllerManager'} | ||
|
|
||
| trajectory_execution = {'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.01} | ||
|
|
||
| planning_scene_monitor_parameters = {"publish_planning_scene": True, | ||
| "publish_geometry_updates": True, | ||
| "publish_state_updates": True, | ||
| "publish_transforms_updates": True} | ||
|
|
||
| # Start the actual move_group node/action server | ||
| move_group_node = Node(package='moveit_ros_move_group', | ||
| executable='move_group', | ||
| output='screen', | ||
| parameters=[robot_description, | ||
| robot_description_semantic, | ||
| kinematics_yaml, | ||
| ompl_planning_pipeline_config, | ||
| trajectory_execution, | ||
| moveit_controllers, | ||
| planning_scene_monitor_parameters]) | ||
|
|
||
| # RViz | ||
| rviz_config_file = get_package_share_directory('moveit2_tutorials') + "/launch/move_group.rviz" | ||
| rviz_node = Node(package='rviz2', | ||
| executable='rviz2', | ||
| name='rviz2', | ||
| output='log', | ||
| arguments=['-d', rviz_config_file], | ||
| parameters=[robot_description, | ||
| robot_description_semantic, | ||
| ompl_planning_pipeline_config, | ||
| kinematics_yaml]) | ||
|
|
||
| # Static TF | ||
| static_tf = Node(package='tf2_ros', | ||
| executable='static_transform_publisher', | ||
| name='static_transform_publisher', | ||
| output='log', | ||
| arguments=['0.0', '0.0', '0.0', '0.0', '0.0', '0.0', 'world', 'panda_link0']) | ||
|
|
||
| # Publish TF | ||
| robot_state_publisher = Node(package='robot_state_publisher', | ||
| executable='robot_state_publisher', | ||
| name='robot_state_publisher', | ||
| output='both', | ||
| parameters=[robot_description]) | ||
|
|
||
| # Fake joint driver | ||
| fake_joint_driver_node = Node(package='fake_joint_driver', | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We replaced this node with the one from ros2_control see |
||
| executable='fake_joint_driver_node', | ||
| parameters=[{'controller_name': 'panda_arm_controller'}, | ||
| os.path.join(get_package_share_directory("moveit2_tutorials"), "config", "panda_controllers.yaml"), | ||
| os.path.join(get_package_share_directory("moveit2_tutorials"), "config", "start_positions.yaml"), | ||
| robot_description] | ||
| ) | ||
|
|
||
| # Warehouse mongodb server | ||
| mongodb_server_node = Node(package='warehouse_ros_mongo', | ||
| executable='mongo_wrapper_ros.py', | ||
| parameters=[{'warehouse_port': 33829}, | ||
| {'warehouse_host': 'localhost'}, | ||
| {'warehouse_plugin': 'warehouse_ros_mongo::MongoDatabaseConnection'}], | ||
| output='screen') | ||
|
|
||
| return LaunchDescription([ rviz_node, static_tf, robot_state_publisher, move_group_node, fake_joint_driver_node, mongodb_server_node ]) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use the YAML files from moveit_resources