robotStateToRobotStateMsg
Hello!
I keep getting the error:
‘robotStateToRobotStateMsg’ is not a member of ‘moveit::core’
In the CMakeList I have moveitcore, moveitrosplanning, moveitrosplanninginterface, roscpp, rospy and stdmsgs as dependencies. Is there something else I need to add here? And I'm confused that moveit::planninginterface::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 moveitmsgs::RobotState or a robotstate::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!
Asked by mitch1993 on 2016-08-02 05:41:44 UTC
Answers
An update as of Melodic. The include for moveit::core::robotStateToRobotStateMsg
is #include <moveit/robot_state/conversions.h>
Asked by AndyZe on 2021-06-27 17:01:43 UTC
Comments
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.
Asked by dornhege on 2016-08-02 06:14:32 UTC
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.
Asked by mitch1993 on 2016-08-02 07:12:07 UTC
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.
Asked by dornhege on 2016-08-03 08:30:03 UTC
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?
Asked by mitch1993 on 2016-08-03 09:05:24 UTC
If you set a pose target, but get values for a joint value target, I'm not sure that these will be filled.
Asked by dornhege on 2016-08-08 06:15:34 UTC
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?
Asked by mitch1993 on 2016-08-08 08:03:46 UTC
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.
Asked by dornhege on 2016-08-10 06:57:17 UTC