- Home /
How to update the position of the base of a robot manipulator imported using a URDF file?
I have imported a UR3 robot manipulator using the URDF importer, into my project. I would like the user to click/tap on a plane and teleport the robot there. Usually, updating the position of an object is a very straightforward process
transform.position = new Vector3(posX, posY, posZ);
However, updating the position of the "base_link" leads to jittery motion and the robot returns to its initial position every frame. It seems like the code that imports with the URDF wants the robot to keep its position and perhaps there's another way to update the position of the robot, and I'm just not familiar with it.
For reference, I'm using the robot URDF file from the following GitHub repo:
https://github.com/Unity-Technologies/Robotics-Object-Pose-Estimation
I'd appreciate it if someone can help me with this problem. If this question has already been answered, then a gentle nudge in the right direction would be much appreciated.
Thanks!
Answer by Slimy619 · Oct 15, 2021 at 09:47 PM
I found the answer. Since the imported URDF has articulation bodies attached to all of the links, the way to update the position is by using the TeleportRoot() method. For example, for the UR3 robot, it will be,
transform.Find("world/base_link").GetComponent<ArticulationBody>().TeleportRoot(hitPose.position, hitPose.rotation);
This, obviously, should be applied to the root of the robot tree and it will properly update the positions of all other joints. In the case of the UR3 robot (and probably most other robots) is the "base_link".
I hope this helps someone else as well.
Your answer
Follow this Question
Related Questions
Camera rotation around player while following. 6 Answers
Slider handle doesn't intersect with the gaze 0 Answers
Auto positioning GUI Labels? 0 Answers
Check an Objects Rotation 2 Answers
Joystick position 0 Answers