Robotics StackExchange | Archived questions

Setting MoveIt Goal State in RViz

I am looking to programatically move the orange goal state in MoveIt, but I cannot update the displayed goal state.

I can, however, create a goal state, and plan a path to it. The goal pose in the rviz window will never change. My current code is as follows:

global group group = MoveGroupCommander("left_arm")

global end_effector_link
end_effector_link = group.get_end_effector_link()

new_pose = group.get_current_pose().pose

print(new_pose)

new_pose.position.x = new_pose.position.x + 0.1
new_pose.position.y = new_pose.position.y - 0.1
new_pose.position.z = new_pose.position.z - 0.1

print('Setting Pose Target')
group.set_pose_target(new_pose, end_effector_link)

print('Planning position Target')
group.plan()

Is it possible to achieve my desired output with Python? Or would I have better luck using C++?

Thank you!

Asked by Peaches491 on 2013-10-04 14:24:09 UTC

Comments

Answers

You can use the RobotState plugin to display any of your own robot states: http://moveit.ros.org/wiki/RobotStateDisplay/C%2B%2B_API

Asked by isucan on 2013-10-04 21:34:16 UTC

Comments

Is there any such API for Python?

Asked by Peaches491 on 2013-10-05 11:38:37 UTC

Yes. The C++ API is just an example. You can write equivalent code in Python to publish RobotState messages and the robot would move as well. The RobotState class does not yet have Python bindings, but that is coming in the near future.

Asked by isucan on 2013-10-05 21:46:12 UTC

And what topic would I publish this robot state to? And how would I make MoveIt display that as my goal state?

Asked by Peaches491 on 2013-10-06 04:35:28 UTC