Use MoveIt Studio with Hardware

By default, MoveIt Studio is configured to use a simulation environment.

This guide will cover how to configure MoveIt Studio to be used with robot hardware.

The .env file

MoveIt Studio contains a .env file that sets a variety of environment variables. The variables that we need to change are:

  • STUDIO_CONFIG_PACKAGE

  • MOCK_HARDWARE

  • STUDIO_DOCKER_TAG

  • STUDIO_HOST_USER_WORKSPACE

STUDIO_CONFIG_PACKAGE sets the name of the site config package which defines the current robot. The default value of picknik_001_ur5e_config will use the definition of an example real-hardware UR5e, which uses mock components unless you set MOCK_HARDWARE=false in your .env file. Changing this value to picknik_ur5e_gz_config defines a UR5e robot fully simulated in Gazebo.

STUDIO_DOCKER_TAG specifies the version of the MoveIt Studio Docker image that will be pulled.

STUDIO_HOST_USER_WORKSPACE defines the path to a local Colcon workspace that will be mounted into the MoveIt Studio environment for custom Behaviors and site config packages. This workspace is mounted into the /opt/moveit_studio/user_ws folder inside the MoveIt Studio Docker containers. By default, this value is set to /dev/null, which means the /opt/moveit_studio/user_ws folder will not exist inside the containers.

Configuring CycloneDDS for Multiple PC setup

Note

The following section provides basic instructions on how to configure DDS settings for a two PC setup, one running the Agent and one running the Robot Drivers. For more information, please refer to this guide on Configuring DDS for MoveIt Studio.

To enable interprocess communication between machines in your ROS network, you must define the following variables in the .env file.

  • CYCLONEDDS_NETWORK_INTERFACE

  • CYCLONEDDS_PEER_ADDRESSES

The values to use for CYCLONEDDS_NETWORK_INTERFACE and CYCLONEDDS_PEER_ADDRESSES depend on the configuration of the network interfaces the Agent Computer and the Driver Computer use to communicate with each other.

  • For each system, CYCLONEDDS_NETWORK_INTERFACE needs to be set to the name of the network interface which is used to connect to the ROS network.

  • For each system, CYCLONEDDS_PEER_ADDRESSES needs to be set to a comma-separated list containing the IP addresses of the Agent Computer and Driver Computer.

You can find the current names of the network interfaces on each system by running ip a from the command line. The output from this command will be different for the Agent Computer and the Driver Computer.

For example, suppose our system consists of two computers:

  • An “Agent Computer” which runs MoveIt Studio.

  • A “Driver Computer” running a real-time operating system for communicating with the hardware.

The Agent Computer has two network interfaces (one to connect to the internet and another to connect to the Driver Computer), so the network interface information would look similar to this:

$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
      valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
      valid_lft forever preferred_lft forever
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 1c:69:7a:0f:3e:75 brd ff:ff:ff:ff:ff:ff
    altname enp0s31f6
    inet #.#.#.#/24 brd #.#.#.255 scope global dynamic noprefixroute eno1
       valid_lft 68323sec preferred_lft 68323sec
    inet6 #::#:#:#:#/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
3: enp112s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether f4:3a:8c:70:c2:b1 brd ff:ff:ff:ff:ff:ff
    inet 192.168.10.10/24 brd 192.168.10.255 scope global noprefixroute enp112s0
      valid_lft forever preferred_lft forever
    inet6 fe80::c8e:a7ff:f36f:1ef4/64 scope link noprefixroute
      valid_lft forever preferred_lft forever

The Driver Computer uses two wired network interfaces (one to connect to the Agent Computer and another to connect to the robot’s Control Box), so its network interface information would look like this:

$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
      valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
      valid_lft forever preferred_lft forever
2: enp112s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether f4:3a:8c:70:c2:b1 brd ff:ff:ff:ff:ff:ff
    inet 192.168.10.12/24 brd 192.168.10.255 scope global noprefixroute enp112s0
      valid_lft forever preferred_lft forever
    inet6 fe80::6a48:1686:19d8:3085/64 scope link noprefixroute
      valid_lft forever preferred_lft forever
3: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether f4:3a:8c:70:c2:b1 brd ff:ff:ff:ff:ff:ff
    altname enp0s31f6
    inet 192.10.0.12/24 brd 192.10.0.255 scope global noprefixroute eno1
      valid_lft forever preferred_lft forever
    inet6 fe80::a6ae:11ff:fe1e:cb89/64 scope link noprefixroute
      valid_lft forever preferred_lft forever

Using the example output above, we would append the following entries to the .env file on the Agent Computer:

CYCLONEDDS_NETWORK_INTERFACE=enp112s0
CYCLONEDDS_PEER_ADDRESSES=192.168.10.10,192.168.10.12

And append the following entries to the .env file on the Driver Computer:

CYCLONEDDS_NETWORK_INTERFACE=enp112s0
CYCLONEDDS_PEER_ADDRESSES=192.168.10.10,192.168.10.12

For a concrete example of this setup, refer to the Example UR5 Hardware Setup Guide.