- Unity Version 2020.2+
- URDF Importer repo
- Niryo One URDF files from Niryo One ROS
- Working ROS environment
- Integrate the URDF Importer following these instructions
- Create a new directory in
Assetsand name itURDF - Clone the Niryo One ROS repo and copy the
niryo_one_descriptiondirectory intoAssets/URDF - This directory only includes a
.urdf.xacrofile which will need to be converted into a.urdffile before we can import it- Run the following command to convert Xacro to URDF,
rosrun xacro xacro --inorder -o PATH/TO/niryo_one.urdf PATH/TO/niryo_one.urdf.xacro - Copy the generated
niryo_one.urdffile toAssets/URDF - Right click on the this file and select
Import Robot from URDF - Select the co-ordinate system in which the meshes were designed. Default mesh orientation is Y-up which is supported by Unity but some packages often use Z-up and X-up configuration. For more information.
- Select the Convex Mesh Decomposer you want to use for the imported robot. More information can be found here.
- Click
Import
- Run the following command to convert Xacro to URDF,
- To add the controller to an imported robot click the
Enablebutton in the Inspector window in front of theController Scriptoption. This will add a Controller Script, FKrobot and Joint Control at runtime. - To prevent the joints from slipping set the
StiffnessandDampingto100,000and10,000respectively. - To be able to apply forces to the joints set the
Force Limitto10,000. - To prevent the robot from falling over, in the GameObject tree expand
niryo_one->world->base_linkand set the toggle forImmovablefor the base_link. - Press the play button to start the scene.
- Use the left and right arrow keys to select the articulation body you want to move.
- Use the up and down keys to move the articulation body clockwise and counterclockwise.
A guide to making a custom controller can be found here
Forward Kinematics scripts gives you the ability to see the current position of the end effector based on forward kinematics of the robot. You can use it to compare the end effector position of the robot of the articulation body to make sure the importer is working correctly.