Re: Programatically move a group to a group_state?

422 views
Skip to first unread message

Tobias Fromm

unread,
Dec 17, 2013, 8:44:37 AM12/17/13
to moveit...@googlegroups.com
Hi Ioan et al.,

since robot_state::JointStateGroup seems to have been removed from MoveIt! Hydro, do you know of an alternative in the
C++ API to quickly move to a named state (defined in the URDF)? I saw RobotState::setToDefaultValues(), but couldn't
figure out how to use it and whether that's the right method at all.

Thanks,
Tobi

> On Sun, May 26, 2013 at 10:45 PM, Ioan Sucan <isu...@willowgarage.com> wrote:
> The RobotModel class parses that data too.
> The easiest thing to do is call setToDefaultState() in a JointStateGroup:
> https://github.com/ros-planning/moveit_core/blob/groovy-devel/robot_state/include/moveit/robot_state/joint_state_group.h
> In Python, you can call set_named_target() and pass the name of the state from the SRDF.
>
> Ioan

> On Sun, May 26, 2013 at 10:37 PM, Michael Ferguson <mfe...@gmail.com> wrote:
> > With the MoveIt RVIZ plugin, I can select my named group_state poses, such
> > as "tucked_arm", and quickly plan to them. Is there some utility within
> > moveit that is parsing the SRDF to read this -- or is the plugin just
> > reading it?
> >
> > Thanks,
> > -Fergs
> >

--
Tobias Fromm
Robotics Group
Jacobs University

Research I, Room 38 +49-421-200-3106
Campus Ring 1 t.f...@jacobs-university.de
28759 Bremen, Germany http://robotics.jacobs-university.de

Ioan Sucan

unread,
Dec 17, 2013, 12:44:32 PM12/17/13
to Tobias Fromm, moveit-users
Hello Tobias,

The function you found is the correct one.
If you have state s and want to set it at some state "foo" for group "bar", you can do:
s.setToDefaultValues(s.getJointModelGroup("bar"), "foo");

Usually you probably already have an instance of const JointModelGroup*, so you would pass that in directly.

Ioan

Tobias Fromm

unread,
Dec 18, 2013, 9:26:38 AM12/18/13
to Ioan Sucan, moveit-users
Ioan,

thanks for the pointer, that did the trick for me. I somehow got confused between JointStateGroup and JointModelGroup.
Happy Holidays!

Cheers,
Tobi
Reply all
Reply to author
Forward
0 new messages