How to set a specific start state of the robot in a task #685
|
I want to implement an offline planning task, so I cannot use CurrentState stage for fetching the robot state and have to manually set the start state of the robot. How can this be implemented in Python/Python bindings? The idea was to use a FixedState stage and modify the PlanningScene in it (set current robot state) - is that easily possible? |
Replies: 2 comments 5 replies
|
Yes, that's exactly the purpose of moveit_task_constructor/demo/scripts/fixed_state.py Lines 18 to 24 in 0cc3987 As this is identical to your code, what are the issue(s) in your case? To set the PlanningScene's current state, two methods are wrapped: .def("setCurrentState", py::overload_cast<const moveit_msgs::RobotState&>(&PlanningScene::setCurrentState))
.def("setCurrentState", py::overload_cast<const robot_state::RobotState&>(&PlanningScene::setCurrentState))The dictionary approach you tried, is not available. |
|
Indeed, MoveIt2's python wrapper of PlanningScene doesn't yet implement |



Indeed, MoveIt2's python wrapper of PlanningScene doesn't yet implement
setCurrentState()(my code sample was for ROS1).However, you can easily add that function in the wrapper here. Please file a PR.