How To Drive It - VTAstrobotics/Documentation GitHub Wiki


Contents

Prerequisites

To understand the content in this page, you should know

  • Basic Linux (cd, ls, etc.)
  • How to power and boot the Jetson Nano

Setup

To begin, you should have the Jetson Nano onboard the robot powered via the barrel jack connector and be logged into the Astrobotics user. Plug an Xbox controller into one of the Jetson Nano's USB ports--this is what you will use to control the robot.

Open two separate terminals on the Jetson Nano. We will call these Terminal1 and Terminal2 arbitrarily. Let's first focus on Terminal1.

Terminal1

Use the following command to navigate to the directory where our startup files are:

cd Documents/Astrobotics2022/dfiles/

Now launch the drivetrain file. After you hit enter, you will be prompted for a password--enter the Jetson Nano user password:

./startup docker_drivetrain

Once docker_drivetrain has finished starting up, run the ROS2 joy node to read and interpret the input from the Xbox controller:

ros2 run joy joy_node

Once it's done, it should output some text in the terminal indicating that it started successfully. It should start with, “Opened joystick: PDP Xbox 360…”

Now we can move on to Terminal2.

Terminal2

In Terminal2, follow the same initial startup process as Terminal1:

Use the following command to navigate to the directory where our startup files are:

cd Documents/Astrobotics2022/dfiles/

Now launch the drivetrain file. After you hit enter, you will be prompted for a password--enter the Jetson Nano user password:

./startup docker_drivetrain

Run the following command to check that it is detecting the joy node:

ros2 topic list

It should return a few items. Check that "/joy" is among them.

Start teleop to control the robot:

ros2 run teleop drivetrain

You should now be able to control the robot using the buttons and joysticks on the Xbox controller.