Skip to content

simulator development

Cristian Beltran edited this page Oct 25, 2021 · 2 revisions

Simulator Development

Follow this step-by-step guide to start developing with simulated robots. Make sure to complete the initial setup before proceeding further.

Content:

Note 1: If no Nvidia drivers are present, the Docker runtime is set to runc, instead of nvidia, to bypass nvidia-docker2 when entering the container. However, 3D accelerated tools, including Gazebo and Rviz, will most likely not work. You can modify the default runtime in ~/.bashrc.

Step 0: Start up your terminals

It is recommended to use Terminator with a split window view. It makes the process much easier. To start up a Terminator window with a pre-configured view, use one of the following commands, depending on your machine setup.

For a single machine:

cd ~/o2ac-ur && ./LAUNCH-TERMINATOR-TERMINAL.sh 

For the split setup with a real-time kernel, use these lines for the vision and robot PC respectively:

cd ~/o2ac-ur && ./LAUNCH-TERMINATOR-TERMINAL.sh vision
cd ~/o2ac-ur && ./LAUNCH-TERMINATOR-TERMINAL.sh rt

Caution: The shell script overwrites your Terminal configuration file. Start it from a non-Terminator terminal while Terminator is closed.

You can also enter the docker container manually in any terminal:

cd ~/o2ac-ur && sh RUN-CONTAINER.sh

Remember that you can split Terminator terminals horizontally and vertically (Ctrl+E, Ctrl+O).

Step 1: Launch the Simulator

  1. Enter the Docker container as described above.

  2. To start the robots in kinematic-only simulation (MoveIt), execute this:

    roslaunch o2ac_moveit_config demo.launch

    If you encounter xacro errors, see troubleshooting.

  3. OPTIONAL: (Not maintained) To simulate cameras, physical parts and dynamics, you should launch Gazebo via roslaunch, and then MoveIt from a separate terminal window:

    roslaunch o2ac_gazebo o2ac_gazebo.launch
    roslaunch o2ac_moveit_config o2ac_moveit_planning_execution.launch sim:=true

Step 2: Send motion commands to the robots in the simulation

See the ReadMe in the o2ac_moveit_config package for more details on how to move the robots with the MoveIt GUI. For sending motion commands from another node, read the below.

  1. Inside the Docker container, start a ROS node running e.g. the assembly task:

    rosrun o2ac_routines assembly.py
  2. The script starts up a command line interface. Use it to run the functions you wish to execute, or simply type "start" and press Enter to see the robot perform the assembly.

Check the other executable files in the o2ac_routines package (taskboard.py, calibration.py, osx_view_testing.py) to see more examples.

Step 3: Observe camera images, extract depth data

  1. If Gazebo is running, it is publishing the different camera streams as rostopics. To display an image stream:

    rosrun rqt_image_view rqt_image_view

    You can use rostopic list to see other available data streams.