robotStateToRobotStateMsg

asked 2016-08-02 05:41:44 -0500

mitch1993 gravatar image

updated 2016-08-02 07:44:33 -0500

Hello!

I keep getting the error:

‘robotStateToRobotStateMsg’ is not a member of ‘moveit::core’

In the CMakeList I have moveit_core, moveit_ros_planning, moveit_ros_planning_interface, roscpp, rospy and std_msgs as dependencies. Is there something else I need to add here? And I'm confused that moveit::planning_interface::MoveGroup::getJointValueTarget gives me a moveit::core::RobotState instead of a robot_state::RobotState like the documentation says.

edit: I want to plan a path with multiple waypoints without executing the individual paths. For that I want to ste the starting state to the target of the previous waypoint. I tried that with

   moveit::planning_interface::MoveGroup group("arm");

    ...
    ...
    <setting up target pose and planning path to first target> 
    ...

    moveit_msgs::RobotState start_state;
    start_state = group.getJointValueTarget()
    group.setStartState(start_state);

but getJointValueTarget() gives me a moveit::core::RobotState and setStartState() wants a moveit_msgs::RobotState or a robot_state::RobotState, that's why i tried robotStateToRobotStateMsg.

moveit::core::robotStateToRobotStateMsg(group.getJointValueTarget(), start_state);

which gave me the mentioned error.

I'd also appreciate new/better approaches for my intention.

Thank you in advance!

edit retag flag offensive close merge delete

Comments

1

What version of ROS and MoveIt are you using and what is the code that gives the errors? robot_model/robot_model.h defines these namespaces.

dornhege gravatar image dornhege  ( 2016-08-02 06:14:32 -0500 )edit

I'm using ros indigo. Where can i get information about the Moveit version? Copying Code is hard because I'm working on pretty large project. I edit my original post with more information of what i want to do and a code sample.

mitch1993 gravatar image mitch1993  ( 2016-08-02 07:12:07 -0500 )edit

The simplest for the correct namespace would be to check the actual header, that should be in moveit/robot_state/conversions + include that obviously. The alternative is to simply try robot_state instead.

dornhege gravatar image dornhege  ( 2016-08-03 08:30:03 -0500 )edit

Okay. Updating Moveit fixed the error. But the positions in joint_state of start_state are all 0... shouldn't it have the values of the pose set in group.setPoseTarget or do i understand the getJointValueTarget function wrong?

mitch1993 gravatar image mitch1993  ( 2016-08-03 09:05:24 -0500 )edit

If you set a pose target, but get values for a joint value target, I'm not sure that these will be filled.

dornhege gravatar image dornhege  ( 2016-08-08 06:15:34 -0500 )edit

hmm well it looks like they don't get filled... Is there a way to get the joint values of a set (or planned) pose target?

mitch1993 gravatar image mitch1993  ( 2016-08-08 08:03:46 -0500 )edit

There is not direct correspondence. You have to compute IK. There are functions for setting a joint value target from a pose that do this.

dornhege gravatar image dornhege  ( 2016-08-10 06:57:17 -0500 )edit