-
-
Notifications
You must be signed in to change notification settings - Fork 157
Example Universal Robots
This package provides an interface between ROS 2 and the UR3e, UR5e, and UR10e simulation models of the Universal Robots running in Webots. It includes several simulations of these robots.
Notes: If you are using the
develop
branch, make sure to check theWith the develop branch
panels.
With the develop branch
These examples are using the URDF spawning feature from The Ros2Supervisor node, thus there is a slight "freeze" at the beginning of the simulations as the Ros2Supervisor
has to spawn the UR5e robot.
The UR5e Simple Example
and the MoveIt2 Integration
examples require to use two launch files to start the simulation instead of one with the master
branch. The first one starts Webots with the chosen world while the second spawns the robot and starts the ROS 2 nodes.
All the others commands can be used as they are.
This simulation contains one UR5e robot in a very simple environment. This simulation can be started with the following launch file:
ros2 launch webots_ros2_universal_robot robot_launch.py
With the develop branch
The simulation can be started with the following launch file:
ros2 launch webots_ros2_universal_robot robot_world_launch.py
The robot can be spawned and the ROS 2 nodes started with:
ros2 launch webots_ros2_universal_robot robot_nodes_launch.py
The /ur_joint_trajectory_controller/follow_joint_trajectory
action server can be tested directly using the ROS2 action CLI interface to move the robot:
ros2 action send_goal /ur_joint_trajectory_controller/follow_joint_trajectory control_msgs/action/FollowJointTrajectory "{
trajectory: {
joint_names: [shoulder_pan_joint, shoulder_lift_joint, elbow_joint, wrist_1_joint, wrist_2_joint, wrist_3_joint],
points: [
{ positions: [3.02, -1.63, -1.88, 1.01, 1.51, 1.13], time_from_start: { sec: 5, nanosec: 500 } },
{ positions: [-1.01, 0.38, -0.63, -0.88, 0.25, -1.63], time_from_start: { sec: 6, nanosec: 500 } },
{ positions: [-1.01, 0.38, -0.63, -0.88, 0.25, 6.2], time_from_start: { sec: 50, nanosec: 500 } }
]
},
goal_tolerance: [
{ name: shoulder_pan_joint, position: 0.01 },
{ name: shoulder_lift_joint, position: 0.01 },
{ name: elbow_joint, position: 0.01 },
{ name: wrist_1_joint, position: 0.01 },
{ name: wrist_2_joint, position: 0.01 },
{ name: wrist_3_joint, position: 0.01 }
]
}"
This example shows how you can control the robotic arm by moving it in RViz with the help of MoveIt2
.
Run the following launch file to test it:
ros2 launch webots_ros2_universal_robot moveit_demo_launch.py
With the develop branch
The simulation can be started with the following launch file:
ros2 launch webots_ros2_universal_robot robot_world_launch.py
The robot can be spawned and the ROS 2 nodes started with:
ros2 launch webots_ros2_universal_robot robot_moveit_nodes_launch.py
Then you will be able to move the robotic arm in RViz and press Plan & Execute
to see the same movement in the Webots simulation.
This example shows how you can make control multiple robots to collaborate in a single simulation.
Run the UR5e and IRB 4600 simulation in Webots using:
ros2 launch webots_ros2_universal_robot multirobot_launch.py
- The Ros2Supervisor Node
- Using URDF or Xacro
- Import your URDF Robot in Webots
- Refresh or Add URDF a Robot in a Running Simulation
- Wheeled robots
- Robotic arms
- Automobiles
- Drones