-
Notifications
You must be signed in to change notification settings - Fork 40
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
Fixed the wrong type for time parameterization in ompl #55
Merged
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
2e23a07
Fixed the wrong type for time parameterization in ompl
jodle001 66196fa
Updated to use the MoveItConfigsBuilder
jodle001 014959d
Optimized the imports.
jodle001 e5fe1b2
Update abb_bringup/launch/abb_moveit.launch.py
jodle001 396f044
Update abb_bringup/launch/abb_moveit.launch.py
jodle001 7eb9379
Update package.xml
jodle001 eadbc1d
Formatting adn also publishing robot_description and semantic
jodle001 e447429
Fixed formatting to pass format test per requeset by Yadunund.
jodle001 6f303b5
Used pre-commit to fix formatting locally.
jodle001 cee3f4a
Removed planning pipeline limits to ompl planner, also added pilz_car…
jodle001 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 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,17 +1,15 @@ | ||
import os | ||
|
||
import yaml | ||
from ament_index_python.packages import get_package_share_directory | ||
from launch import LaunchDescription | ||
from launch.actions import DeclareLaunchArgument | ||
from launch.actions import OpaqueFunction | ||
from launch.substitutions import ( | ||
Command, | ||
FindExecutable, | ||
LaunchConfiguration, | ||
PathJoinSubstitution, | ||
) | ||
from launch_ros.actions import Node | ||
from launch_ros.substitutions import FindPackageShare | ||
import os | ||
import yaml | ||
from moveit_configs_utils import MoveItConfigsBuilder | ||
|
||
|
||
def load_yaml(package_name, file_path): | ||
|
@@ -32,94 +30,87 @@ def launch_setup(context, *args, **kwargs): | |
moveit_config_package = LaunchConfiguration("moveit_config_package") | ||
moveit_config_file = LaunchConfiguration("moveit_config_file") | ||
|
||
# Planning context | ||
robot_description_content = Command( | ||
[ | ||
PathJoinSubstitution([FindExecutable(name="xacro")]), | ||
" ", | ||
PathJoinSubstitution( | ||
[FindPackageShare(support_package), "urdf", robot_xacro_file] | ||
), | ||
] | ||
) | ||
robot_description = {"robot_description": robot_description_content} | ||
|
||
robot_description_semantic_content = Command( | ||
[ | ||
PathJoinSubstitution([FindExecutable(name="xacro")]), | ||
" ", | ||
PathJoinSubstitution( | ||
[FindPackageShare(moveit_config_package), "config", moveit_config_file] | ||
), | ||
] | ||
) | ||
robot_description_semantic = { | ||
"robot_description_semantic": robot_description_semantic_content.perform( | ||
context | ||
# MoveIt configuration | ||
moveit_config = ( | ||
MoveItConfigsBuilder( | ||
"abb_bringup", package_name=f"{moveit_config_package.perform(context)}" | ||
) | ||
} | ||
|
||
kinematics_yaml = load_yaml( | ||
"abb_irb1200_5_90_moveit_config", "config/kinematics.yaml" | ||
) | ||
|
||
joint_limits_yaml = { | ||
"robot_description_planning": load_yaml( | ||
moveit_config_package.perform(context), "config/joint_limits.yaml" | ||
.robot_description( | ||
file_path=os.path.join( | ||
get_package_share_directory(f"{support_package.perform(context)}"), | ||
"urdf", | ||
f"{robot_xacro_file.perform(context)}", | ||
) | ||
) | ||
} | ||
|
||
# Planning Functionality | ||
ompl_planning_pipeline_config = { | ||
"move_group": { | ||
"planning_plugin": "ompl_interface/OMPLPlanner", | ||
"request_adapters": """default_planner_request_adapters/AddTimeOptimalParameterization default_planner_request_adapters/ResolveConstraintFrames 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( | ||
"abb_irb1200_5_90_moveit_config", "config/ompl_planning.yaml" | ||
.robot_description_semantic( | ||
file_path=os.path.join( | ||
get_package_share_directory( | ||
f"{moveit_config_package.perform(context)}" | ||
), | ||
"config", | ||
f"{moveit_config_file.perform(context)}", | ||
) | ||
) | ||
.planning_pipelines( | ||
pipelines=["ompl"], | ||
default_planning_pipeline="ompl", | ||
) | ||
.robot_description_kinematics( | ||
file_path=os.path.join( | ||
get_package_share_directory( | ||
f"{moveit_config_package.perform(context)}" | ||
), | ||
"config", | ||
"kinematics.yaml", | ||
) | ||
) | ||
.trajectory_execution( | ||
file_path=os.path.join( | ||
get_package_share_directory( | ||
f"{moveit_config_package.perform(context)}" | ||
), | ||
"config", | ||
"moveit_controllers.yaml", | ||
) | ||
) | ||
.planning_scene_monitor( | ||
publish_planning_scene=True, | ||
publish_geometry_updates=True, | ||
publish_state_updates=True, | ||
publish_transforms_updates=True, | ||
publish_robot_description=True, | ||
publish_robot_description_semantic=True, | ||
) | ||
.joint_limits( | ||
file_path=os.path.join( | ||
get_package_share_directory( | ||
f"{moveit_config_package.perform(context)}" | ||
), | ||
"config", | ||
"joint_limits.yaml", | ||
) | ||
) | ||
.to_moveit_configs() | ||
) | ||
ompl_planning_pipeline_config["move_group"].update(ompl_planning_yaml) | ||
|
||
# Trajectory Execution Functionality | ||
moveit_simple_controllers_yaml = load_yaml( | ||
"abb_irb1200_5_90_moveit_config", "config/moveit_controllers.yaml" | ||
) | ||
# MoveIt controllers | ||
moveit_controllers = { | ||
"moveit_simple_controller_manager": moveit_simple_controllers_yaml, | ||
"moveit_simple_controller_manager": load_yaml( | ||
f"{moveit_config_package.perform(context)}", | ||
"config/moveit_controllers.yaml", | ||
), | ||
"moveit_controller_manager": "moveit_simple_controller_manager/MoveItSimpleControllerManager", | ||
} | ||
|
||
trajectory_execution = { | ||
# MoveIt does not handle controller switching automatically | ||
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. This behavior was lost in the changes as by default, |
||
"moveit_manage_controllers": False, | ||
"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_config.trajectory_execution, | ||
moveit_controllers, | ||
planning_scene_monitor_parameters, | ||
joint_limits_yaml, | ||
moveit_config.to_dict(), | ||
], | ||
) | ||
|
||
|
@@ -135,11 +126,7 @@ def launch_setup(context, *args, **kwargs): | |
output="log", | ||
arguments=["-d", rviz_config], | ||
parameters=[ | ||
robot_description, | ||
robot_description_semantic, | ||
ompl_planning_pipeline_config, | ||
kinematics_yaml, | ||
joint_limits_yaml, | ||
moveit_config.to_dict(), | ||
], | ||
) | ||
|
||
|
@@ -158,15 +145,14 @@ def launch_setup(context, *args, **kwargs): | |
executable="robot_state_publisher", | ||
name="robot_state_publisher", | ||
output="both", | ||
parameters=[robot_description], | ||
parameters=[moveit_config.robot_description], | ||
) | ||
|
||
nodes_to_start = [move_group_node, rviz_node, static_tf_node, robot_state_pub_node] | ||
return nodes_to_start | ||
|
||
|
||
def generate_launch_description(): | ||
|
||
declared_arguments = [] | ||
|
||
# TODO(andyz): add other options | ||
|
This file contains 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
2 changes: 1 addition & 1 deletion
2
robot_specific_config/abb_irb1200_5_90_moveit_config/config/ompl_planning.yaml
This file contains 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
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.
Sorry one last thing came to mind. I don't think we should restrict the
planning_pipelines
to justompl
. If we remove this entry, the builder will load default configs forompl
,stomp
,chomp
andpilz
which would be nicer for users to play around with in the rviz palnning panel.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.
Just a quick question, I removed the lines here:
But I was getting this error without adding a pilz_cartesian_limits.yaml file to the moveit_config package:
[ERROR] [launch]: Caught exception in launch (see debug for traceback): "File /opt/robotic_platform/install/abb_irb1200_5_90_moveit_config/share/abb_irb1200_5_90_moveit_config/config/pilz_cartesian_limits.yaml doesn't exist"
So I added this to the abb_irb1200_5_90_moveit_config package in the config directory:
But even with this, If you select the pilz planner it doesn't seem to successfully plan a path. The other planners I see available are ompl, and CHOMP and they can both successfully plan a path.
Not sure how you would like me to proceed.
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.
I think the problem is because the
pilz_indsutrial_motion_planner
is loaded based on the deafult config file in moveit_config_utils but there isn't a defaultpilz_cartesian_limits.yaml
file. Hence you had to manually include on in the config folder here. I think if you usemoveit_setup_assistant
, it does generate this file in the local config.Perhaps you can open an issue ticket in upstream moveit to include a default
pilz_cartesian_limits.yaml
file inmoveit_config_utils
?I think this is because we have not set any acceleration limits in the
joint_limits.yaml
file which are needed by the planner. You should be seeing a message printout indicating thisIf you edit the
joint_limits.yaml
file by settinghas_acceleration_limts: true
for each joint a specify somemax_acceleration
like5.0
, you should be apply to plan PTP motions withpilz_industrial_motion_planner
.I think it's best to leave the acceleration limits as
false
for now until someone can share accurate values for this specific robot.