geometry_msgs/PoseStamped message to sensor_msgs/JointState transformation
Hi everyone, so I've been trying to transform a PoseStamped message to JointState, and I was wondering If anyone has any ideas, about the best way to do that.
I'm working on a 7 DoF robot, but I want a solution that doesn't require the real robot. As an input I get a message with the pose of robot, and I want to transform it to joint state message. I'm using melodic version of ROS1.
I would like to remind you that a PoseStamped message has a structure of:
Header header Pose pose
and a JointState message has a structure of:
Header header string[] name float64[] position float64[] velocity float64[] effort
I'm only interested in the position attribute, to perform 'Inverse Kinematics'. I've thought of using gazebo, but I would prefer something more direct, a more mathematical solution. Can anyone help me?
Quick edit: This technique is also known as 'Inverse Kinematics', and I only care for 1 solution, even if it is not unique.
Quick comment: the general technique for this is called "Inverse Kinematics". MoveIt can do this for you, even without "a real robot" (but there are many more libraries and packages).
Please be aware: for a 6 dof robot, there are typically 8 solutions for the Pose->JointState conversion.
For a 7 dof robot, there are essentially an unlimited number of solutions going from Pose->JointState.
So without more input (to prune possible solutions), there is no unique solution.
Thank you so much for the quick reply! Do you have any suggestions for the libraries you mention? Yes I understand about the infinite solutions, so far I only need one solution, even if it is not unique. I'm a newbie in MoveIt, but I will search it. Thank you again.
you do understand that it's very much possible you'll get a different solution each time you ask a solver for a 7dof robot for a solution?
There are ways to minimise this "risk", but it would depend on the solver and how it's configured.
you could perhaps take a look at kdl_parser, and KDL in general. This wouldn't require MoveIt, just a URDF of your robot.
yes, you're right, I'll have to think about it. Thank you for the suggestion!
hi @gvdhoorn
I am using ros2 Foxy and web-client to publish PoseStamped over ros2-web-bridge to a URDF that has the JointStates plug-in.
PoseStamped is echoed correctly, but robot in Gazebo does not react.
is the frame_id correct?
@rotaryopt: how is this related to the question posed by @nz?
@gvdhoorn I am trying to move the Robot in Gazebo with the PoseStamped message on the /move_base_simple topic - which does not work as of yet, perhaps due to a missing interface (ie KDL_parser, ie moveit?).
This is what I am trying to determine - what are the minimum necessary interfaces for the Gazebo robot to move according to the PoseStamped message?
My robot SDF file contains the
libgazebo_ros_joint_pose_trajectory.so
plug in, and responds to the JointStates, but it does not respond to PoseStamped. I am in the dark here, appreciate your help!So again: how does this relate to the question of @nz?
The question we're discussing here is ROS 1, Melodic, and is about FK/IK.
You're question-in-a-comment (which is bad practice) does not seem related.
You also seem to have posted the same/similar questions in #q376908 and #q376913.
Let's not hijack @nz's post here and avoid posting off-topic questions in comments.