Secure Autonomous Systems

Instructor: Prof. Sibin Mohan, The George Washington University

CSCI 6907/3907 | Fall 2022 | TR 12:45PM - 02:00PM PT | SMTH 115


MP IV: Rover Setup

Administrivia

Announcement Date Nov. 12, 2022
Submission Date Nov 18, 2022
Submission Time 06:00 PM, ET
Total Points 10

Objective

In this MP, we want to learn how a rover works. The following objectives are designed to help you familiarize yourself with some basic parts:

1. Run ROS on Rover

1-A: What is ROS?
ROS is an open-source, meta-operating system for your robot. It provides the services you would expect from an operating system, including hardware abstraction, low-level device control, implementation of commonly-used functionality, message-passing between processes, and package management. It also provides tools and libraries for obtaining, building, writing, and running code across multiple computers.
1-B: ROS core and communication
With ROS, you can easily separate your code base into packages containing small programs called nodes. To make those programs communicate between each other, ROS comes with three main communication tools:
  1. Topics: Those will be used mainly for sending data streams between nodes.
  2. Services: They will allow you to create a simple synchronous client/server communication between nodes.
  3. Action: They will provide you with an asynchronous client/server architecture, where the client can send a request that takes a long time. The client can asynchronously monitor the server's state and cancel the request anytime.
1-C: ROS data exchange
The primary mechanism for ROS nodes to exchange data is sending and receiving messages. Messages are transmitted on a topic, and each topic has a unique name in the ROS network. If a node wants to share information, it uses a publisher to send data to a topic. A node that wants to receive that information uses a subscriber to that same topic. Besides its unique name, each topic also has a message type, which determines the types of messages that are capable of being transmitted under that topic.

This publisher and subscriber communication have the following characteristics:
  1. Topics are used for many-to-many communication. Many publishers can send messages to the same topic and many subscribers can receive them.
  2. Publishers and subscribers are decoupled through topics and can be created and destroyed in any order. A message can be published to a topic even if there are no active subscribers.

data exchange

2. Startup the Rover

  1. Each rover will come with 2 LiPo batteries. Make sure the rover batteries are fully charged before using.
  2. Turn on the radio controller.
  3. Put one of the charged batteries in the correct position, as shown in the picture, and plug it into the rover.

    battery position

  4. Reconnect the sensor by plugging out and plugging it in again and turn on Rover ESC (Electronic Speed Controller) by pushing the button shown in the picture one time. (Don't hold the button for too long)

    ESC and sensor

  5. Connect your computer to the same network as the rover. The SSID is slabRouter, and the password is mp4router.
  6. According to the number of the rover you got, you can find its IP address here.

    1 192.168.0.223
    2 192.168.0.139
    3 192.168.0.205
    4 192.168.0.142
    5 192.168.0.193

  7. Open a terminal on your computer and make an ssh connection to the rover by typing ssh pi@rover-ip and put raspberry for the login password.
  8. We need to run several scripts through this shell, so one way of doing that is to lunch several shells by screen
    First, write this command to create a new shell
    screen -S ros_launch
    In the new shell, execute the rovers launch files
    roslaunch gwurover simple_control.launch
  9. Detach the shell and go back to the first shell by pressing this sequence of keys Ctrl+aand d
  10. You should be able to control the rover with the radio control by just moving the right stick
Here is a GIF showing the above steps. Note: the "echo" statements are just instructions/details for your reference. You do not need to type them out.

Typical rover startup process.

You can launch other missions (like simple_pid) in the same way.

CAUTION
  1. ALWAYS TURN THE ROVER OFF FIRST. Before turning the radio controller off, please turn off the rover first. If you don't do that, the rover will go full throttle and won't stop.
  2. To turn off the rover, kill the roslaunch process by pressing Ctrl+c in the shell. Then turn off the ESC by pressing the button on the ESC once. After that, you can turn off the radio controller.
  3. Check the battery every 10 minutes with the battery checker. Please charge the battery if the battery is lower than 20 percent.
    This is how to use battery checker and battery charger.
  4. When you are done, please put the batteries on storage mode

3. Run automated mission on Rover

  1. Got back to the shell that you ran the launch file by typing screen -r launch.
  2. Cancel the current running script by pressing ctr+c.
  3. Put the robot on the left-down corner of the space specified for the rover.
    That position is the (0,0) position for the rover.
  4. Run this command roslaunch gwurover simple_pid.launch.
  5. On the radio controller pull the SG key(Red) up and after that pull the SF key(Green) up to start the mission.
    radio

  6. The rover should follow a 2mx2m rectangle.

Submission Instructions