How can I orient the end-effector (z-axis) to known point (wrt. base_link) with Moveit2
Hi @mmelihtoslak ,
Welcome to this Community!
This is quite simple, use the setPoseTarget
function to set the desired position of the end-effector (of course, this is with respect to base_link
). You need to declare a Pose
variable to hold the x, y, z
positions and x, y, z, w
quaternions for the desired location and pass it to the setPoseTarget
function.
I strongly suggest that you take the ROS2 Manipulation course to get to know this in detail!
Regards,
Girish
Thank you for your quick response.
Sorry for not clearly define my problem, I can pass the setPoseTarget it is okay, what I want to do:
I have object_point wrt. base link and I have desired end effector point wrt. base_link which is ee_desired. I want to move my end effector to given position and orient Z-axis of the end effector to object_point.
Hi @mmelihtoslak ,
Thanks for clarifying your problem.
There are two ways by which you can do this in simulation:
- Get the object position with respect to
base_link
usingtf2_echo
method or usingTF Listener
. Then move the end effector to a certain height above the object position to performapproach
and grasp it. - Use perception to detect the object and go to the grasp location based on the result you get from the object detection program.
If you are looking for a solution in real time robot, then the first option above may or may not be viable. If the object you are willing to grasp can broadcast its location in the world frame with respect to the robot’s base_link
then you can grasp the object based on that data. Otherwise you will have to implement perception to detect the object of interest to grasp it. Even in case of perception, you need to know the location of the camera (or any perception device) with respect to the robot’s base_link
.
I hope this clarifies your doubts!
Regards,
Girish
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.