Ask Your Question
1

Setting MoveIt Goal State in RViz

asked 2013-10-04 14:24:09 -0500

Peaches491 gravatar image

updated 2014-01-28 17:18:08 -0500

ngrennan gravatar image

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!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-10-04 21:34:16 -0500

isucan gravatar image

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

edit flag offensive delete link more

Comments

Is there any such API for Python?

Peaches491 gravatar image Peaches491  ( 2013-10-05 11:38:37 -0500 )edit

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.

isucan gravatar image isucan  ( 2013-10-05 21:46:12 -0500 )edit

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

Peaches491 gravatar image Peaches491  ( 2013-10-06 04:35:28 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2013-10-04 14:24:09 -0500

Seen: 1,713 times

Last updated: Oct 04 '13