Skip to content

Testing your code on the rover

Tim Freiman edited this page Sep 8, 2022 · 1 revision

Connecting to the Rover

  • Connect PC to router using the usb-ethernet adapter (flat white cable)
  • Turn on power bar by the door to turn on the router and antenna
  • Turn on rover using e-stop then power supply
  • Turn on Jetson and wait a bit for it to boot. The power button is the red push-button closest to the GPIO header. It must be held down for a second for the TX2 to boot.
  • Connect to the Jetson using ssh [email protected] with the password 123.
    • Refer to end of document to setup an SSH config file and SSH Key to streamline the connection process.

Verify Internet Connection

  • Check that the rover is connected to the Concordia wifi network using nmcli con show
    • If it is not, you have two options:
      1. Try to connect to it using sudo nmcli con up ConcordiaUniversity
      2. If 1 fails, use your phone to create a hotspot and refer to end of document
  • Use sudo route del default to modify the IP routing table on the TX2 so that it uses wifi for internet connections
  • Verify that the TX2 is connected to the internet using ping 1.1.1.1

Testing ROS changes

  • Enter the repo using robotics
  • Checkout the branch you would like to test. Stash any changes that are not yours using git stash
  • Rebuild the catkin workspace if you made any modifications to ROS components
    • Use rostings to navigate to the workspace
    • Run catkin_make to rebuild the workspace

Testing C code changes

  • Refer to "Setting up teensyduino" to get the necessary tools to upload to the teensies
  • Build the C code on your local machine (not on the TX2). Refer to the "Building the C Code" on the wiki
  • Flip the switch on the carrier board (board with all the black boards on it) so that the red LED is on
  • Remove the jumper from the teensy you want to upload to
  • Plug in the USB cable into the teensy and upload you code.
  • Check that your code is fine by flipping the switch on the carrier board back. If things start moving, turn it back off.
  • Debug :)

Setting up SSH for Convenience

Setup an SSH Config File

In ~/.ssh/ create a file called config

Host tx2
	Hostname 192.168.0.10
	User	 nvidia

This will allow you to use ssh tx2 as if it was ssh [email protected]

Setup SSH Key Authentication

First, generate an SSH keypair: - ssh-keygen -t ed25519 - Choose the default options and set a password if you want. Setting a password will make the system prompt you for it every time you want to use the key for authentication. Now we want to copy the public half of the key-pair onto the TX2 so that it can recognize us. - ssh-copy-id tx2 we can do this because we setup the config file. Without it: ssh-copy-id [email protected]. - After entering the password it will add the SSH key to the TX2 - Test the key by SSHing into the TX2. You should not be prompted for a password.

Conclusion

Now that you have the SSH config and SSH key, you can connect to the rover using SSH tx2

Setting up a New Connection on the TX2 for Hotspot

  • Start by reconnecting to the jetson using ssh tx2 -Y. This will enable graphical applications over SSH.
  • Run sudo nm-connection-editor
  • Create a new connection using your hotspot information (refer to the other connections for examples)
  • Connect to your hotspot using sudo nmcli con up [hotspot name]
Clone this wiki locally