Simulation ========== Apart from being used with a real robot, the ROS driver can be used with ros2_control's mock hardware or the URSim simulator (which is equivalent from the driver's perspective). Additionally, the robot can be simulated using `Gazebo Classic `_ or `GZ Sim `_ but that's outside of this driver's scope. .. _usage_with_official_ur_simulator: Usage with official UR simulator -------------------------------- The easiest way to use URSim is the `Docker image `_ provided by Universal Robots (See `this link `_ for a CB3-series image). To start it, we've prepared a script: .. code-block:: bash ros2 run ur_client_library start_ursim.sh -m With this, we can spin up a driver using .. code-block:: bash ros2 launch ur_robot_driver ur_control.launch.py ur_type:= robot_ip:=192.168.56.101 launch_rviz:=true You can view the polyscope GUI by opening ``_. When we now move the robot in Polyscope, the robot's RViz visualization should move accordingly. For details on the Docker image, please see the more detailed guide :ref:`here `. Mock hardware ------------- The package can simulate hardware with the ros2_control ``MockSystem``. This emulator enables an environment for testing of "piping" of hardware and controllers, as well as testing robot's descriptions. For more details see `ros2_control documentation `_ for more details. .. note:: Some driver functionalities currently don't work with mock hardware: * The TCP pose broadcaster does not work. * The passthrough trajectory controller does not function when calling the follow joint trajectory action. * The force mode controller also does not respond when trying to start force mode. * The GPIO controller cannot verify that it has changed the state of an I/O pin, so it will report a failure when trying to set an I/O pin.