-
Notifications
You must be signed in to change notification settings - Fork 526
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
[moveit_py] add getMotionPlanRequest in planning_component #2463
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Dongya Jiang <jiangdongya@xiaoyubot.com>
Hi @patrickKXMD, Thanks for this contribution. Do you have an example for how you wish to specify motion sequence requests from With the above being said you should be able to plan motions with PILZ using |
Hi @peterdavidfagan, thanks for the comment. Adding one So, maybe some nice classes in |
Ok thanks for the further details, I'll look to test your changes sometime this week for fetching this message type. It would be nice to also expose similar functionality directly with
Would it be possible to link your code it may be relevant for the aforementioned issue. |
@peterdavidfagan My project is not open-sourced yet, but here is a sample:
from moveit_msgs.action import MoveGroupSequence
from rclpy.action import ActionClient
self.__sequence_action = ActionClient(
node,
MoveGroupSequence,
"/sequence_move_group",
)
def __create_sequence_item(
self,
index: int,
...... # your args
) -> MotionSequenceItem:
# configure your planning_component
......
# get the MotionPlanRequest message.
req = planning_component.get_motion_plan_request(
plan_request_parameters=...
)
# only first item have start_state
if index != 0:
req.start_state = RobotState(is_diff=True)
return MotionSequenceItem(
req=req,
blend_radius=...,
)
goal = MoveGroupSequence.Goal(
request=MotionSequenceRequest(items=requests),
planning_options=PlanningOptions(
planning_scene_diff=PlanningScene(is_diff=True), plan_only=True
),
)
result = self.__sequence_action.send_goal(goal).result
success = result.response.error_code.val == 1
if success:
# moveit.msgs.RobotTrajectory
plan = result.response.planned_trajectories[0]
# different from moveit.msgs.RobotTrajectory
from moveit.core.robot_trajectory import RobotTrajectory as RobotTrajectoryPy
def execute(self, plan, robot_model, planning_group):
robot_trajectory = RobotTrajectoryPy(robot_model)
robot_trajectory.joint_model_group_name = planning_group
# fill trajectory message
with self.scene_monitor.read_only() as scene:
robot_trajectory.set_robot_trajectory_msg(scene.current_state, plan)
self.moveit_py.execute(robot_trajectory=robot_trajectory, controllers=[]) |
This PR is stale because it has been open for 45 days with no activity. Please tag a maintainer for help on completing this PR, or close it if you think it has become obsolete. |
@peterdavidfagan hi, what do you suggest on this pr? |
Hi @patrickKXMD, once I clear my task list for the week I will take a look at this, apologies for the delay. |
This PR is stale because it has been open for 45 days with no activity. Please tag a maintainer for help on completing this PR, or close it if you think it has become obsolete. |
Description
A MotionPlanRequest message is required to construct a
MoveGroupSequence
action, which is needed when using pilz planner.Add
get_motion_plan_request
so we can use pilz planner in moveit_py.Checklist