(!) Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.

Setting up Copernicus

Description: Setting up Copernicus for the first time

Keywords: Copernicus

Tutorial Level: BEGINNER

Instructions:

  1. Connect a keyboard, mouse and monitor to the on-board PC.
  2. The default username and password for the robot will be provided in the user manual that comes with your customized Copernicus.
  3. The system will boot into the Ubuntu interface.
  4. Connect the Copernicus on-board PC to a Wi-Fi network. It is recommended that you connect it to the same network as your workstation.
  5. Find the Copernicus’s IP address by firing up a terminal and typing in:
    $ hostname –I
  6. If you have your workstation connected to the same Wi-Fi network as Copernicus, they should be able to ping each other. On your workstation:
    $ ping <COPERNICUS_IP>
    on Copernicus on-board pc:
    $ ping <WORKSTATION_IP>
  7. Knowing the IP of the Copernicus on-board pc, it is now possible to remotely access Copernicus from your workstation through ssh:
    $ ssh <USER_NAME>@<COPERNICUS_IP> (This is the user name that will be provided to you in the Copernicus user manual)
  8. Since ROS requires both systems to have complete bi-directional connectivity on all ports, it is necessary to ensure that communication is possible via all the ports. We can run the following steps to check the connection. On the remote terminal, run the following:
    $ netcat –I 1234
    On the workstation terminal, run the following:
    $ netcat <COPERNICUS_IP> 1234
    If the connection is successful, you should be able to type messages back and forth between the two terminals. We can now disconnect the mouse, keyboard and monitor from Copernicus and control Copernicus remotely from your workstation.
  9. Display features are not available in ssh, so instead we can run graphical visualisation tools like RViz from your workstation by setting up the ROS master environment on both the Copernicus PC and your workstation PC.

    In Copernicus PC or the ssh remote access terminal, enter the following:

    $ export ROS_IP=<COPERNICUS_IP>
    $ export ROS_MASTER_URI=http://<COPERNICUS_IP>:11311
    Fire up another terminal in your workstation and determine the IP address by running:
    $ hostname –I
    On your workstation terminal, enter the following:
    $ export ROS_IP=<WORKSTATION_IP>
    $ export ROS_MASTER_URI=http://<COPERNICUS_IP>:11311
    This will configure Copernicus as the ROS Master and the ROS IP of the respective devices will be setup as well. The following test can be used to ensure that the systems are properly configured. On Copernicus PC or the remote access terminal, run:
    $ roscore
    On the workstation terminal, run:
    $ rostopic list 
    You should be able to see the list of topics running from the roscore in Copernicus.
  10. We can include the ROS MASTER and ROS IP setup command in step 9 at the bottom of the .bashrc file to be executed in every new terminal.
  11. For RViz to function properly, Copernicus will need to be able to resolve your workstation hostname and vice versa and we can do that by editing the /etc/hosts file on both devices. To find out the hostname of your workstation or Copernicus:
    $ hostname
    Knowing the hostname for both devices, we can now edit the /etc/hosts file. Fire up your favorite text editor on your workstation with sudo privilege and make the following edits:
    xxx.xx.xx.xxx    localhost 
    xxx.xx.xx.xxx    workstation_hostname
    
    <COPERNICUS_IP>       Copernicus_hostname    #add this line into the file
    
    # The following lines are desirable for IPv6 capable hosts (DO NOT make any changes here)
    ::1     ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters

    Similarly, fire up a text editor with sudo privilege on the remote access terminal or on Copernicus's on-board PC and include your <WORKSTATION_IP> and workstation_hostname into the /etc/hosts file.

  12. Alternatively, from step 9 onwards, we can replace ROS IP with ROS HOSTNAME and use the Copernicus's hostname instead of IP for ROS MASTER URI. We will need to resolve both hostnames in /etc/hosts manually. For example, on your workstation terminal:
    $ export ROS_HOSTNAME=<WORKSTATION_HOSTNAME>
    $ export ROS_MASTER_URI=http://<COPERNICUS_HOSTNAME>:11311
    Then, on your workstation fire up your text editor with sudo privilege to edit the /etc/hosts file like this:
    xxx.xx.xx.xxx    localhost 
    #xxx.xx.xx.xxx    workstation_hostname
    
    <COPERNICUS_IP>       Copernicus_hostname         #add these lines into the file
    <WORKSTATION_IP> workstation_hostname   #add these lines into the file
    
    # The following lines are desirable for IPv6 capable hosts (DO NOT make any changes here)
    ::1     ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters

    Note: Remember to comment out the original device hostname settings with '#' and leave only one instance of configuration for one device. Then, on the remote access terminal or on Copernicus on-board PC:

    $ export ROS_HOSTNAME=<COPERNICUS_HOSTNAME>
    $ export ROS_MASTER_URI=http://<COPERNICUS_HOSTNAME>:11311
    Then, make the same changes on the /etc/hosts file on the Copernicus on-board PC. The ROS Master configuration here can also be included into your .bashrc for both devices as mentioned in step 10.

Wiki: Robots/Copernicus/Tutorials/Setting up your workstation (last edited 2021-06-28 07:57:33 by Botsync)