Gear Insertion Policy#
Overview#
This tutorial demonstrates a learning-based gear insertion policy using Isaac for Manipulation in Isaac Sim. The robot uses a trained policy to precisely insert a gear into a peg stand, demonstrating advanced manipulation with contact-rich tasks.
Prerequisites#
Follow the setup instructions in Setup for Simulated Robot with Isaac for Manipulation in Isaac Sim.
Tutorial#
Launch Isaac Sim#
Open Isaac Sim and load the scene:
https://omniverse-content-production.s3-us-west-2.amazonaws.com/Assets/Isaac/5.1/Isaac/Samples/ROS2/Scenario/isaac_manipulator_scene.usd
Tip
We recommend setting a
ROS_DOMAIN_IDviaexport ROS_DOMAIN_ID=<ID_NUMBER>for every new terminal where you run ROS commands, to avoid interference with other computers in the same network (ROS Guide).Hit Play in Isaac Sim to start the simulation.
Configure the Gear Assembly Workflow#
Open the
sim_launch_params.yamlfile and set thegrasps_file_pathto the path to the grasps file you want to use.grasps_file_path: $(ros2 pkg prefix --share isaac_manipulator_robot_description)/config/robotiq_2f_140_grasps_large_gear.yaml segmentation_type: SEGMENT_ANYTHING object_detection_type: SEGMENT_ANYTHING enable_nvblox: 'false' workflow_type: GEAR_ASSEMBLY
Run Gear Insertion Policy#
Once you hit Play on the scene in Isaac Sim, go to the Window tab and select Script Editor.
Once the robot is in the gear insertion position, you can run the gear insertion workflow as described below.
Open a new terminal and activate the Isaac ROS environment:
isaac-ros activateRun the gripper driver:
ros2 run isaac_manipulator_isaac_sim_utils isaac_sim_gripper_driver.py
In a new terminal, run the following command to open the gripper:
ros2 action send_goal \ /robotiq_gripper_controller/gripper_cmd \ control_msgs/action/GripperCommand "command: {position: 0.0, max_effort: 100.0}"
Paste contents of the script from
isaac_manipulator_bringup/test/isaac_sim_script_editor_scripts/place_robot_in_gear_insertion_position.pyin the Isaac Sim Script Editor.Run it and wait until the robot is in the gear insertion position.
Run the script again to make sure gear is in correct position.
Close the gripper via this call:
ros2 action send_goal \ /robotiq_gripper_controller/gripper_cmd \ control_msgs/action/GripperCommand "command: {position: 0.50, max_effort: 100.0}"
Launch the gear insertion workflow:
export ENABLE_MANIPULATOR_TESTING=manual_isaac_sim launch_test $(ros2 pkg prefix --share isaac_manipulator_bringup)/test/gear_insertion_pol_test_sim.py
Wait for user input prompt to start the insertion process. Once prompted, run this command:
ros2 topic pub /input_points_debug geometry_msgs/msg/Point "{x: 0.0, y: 0.0, z: 0.0}"
The robot should insert the gear into the peg stand.
Next Steps#
Try the Gear Assembly tutorial for the full assembly workflow
Try the Pick and Place tutorial for general manipulation workflows
Learn more about Isaac for Manipulation Reference Architecture