Try   HackMD
tags: ROS1 Jetson nano

Jetfalcon and setup environment

Before controlling Jetfalcon, you need to setup the operating environment.
If you had done this step, please go to the next unit: 1. Jetfalcon and teleoperation.

Hardware you need to prepare before writing image

To prepare your microSD card, you’ll need a computer with Internet connection and the ability to read and write SD cards, either via a built-in SD card slot or adapter. Notice space of the MicroSD card need bigger than 32 GB.

1. Write Image to the microSD Card

1-1. Install balenaEtcher

I suggest using balenaEtcher to write the image with Microsoft windows system. Please visit the official website to download the software: balenaEtcher official website

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Please click the "Download for Windows(x86|x64)" button to download and then run the file to install. If you can install smoothly then you can see the icon "balenaEtcher" in the desktop.

1-2. Download the image

Nvidia offer ubuntu 18.04 image for the Jetson nano now(2021/10/18). We can use the third-party image to write to the microSD Card. Please visit this webiste to download and unzip file:

1-3. Start writing image!

Ok! Now we have already prepared to write image to the microSD Card! Please double click icon "balenaEtcher" on your desktop to run the software.

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

If you can see the image above on your desktop, then you can follow the steps below to write image:

  1. click "Flash" from file and select your image. If you don't rename the image file, you should select "sd-blob-b01.img"
  2. If you use adapter, please insert it into your computer and then click "Select target" to select your microSD card.

Great! Now everything is done, you can see the similar image below:

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Please click the blue button "Flash!", and then you will need some time to flash the image. If the balenaEtcher finish flashing normally, you can see the similar image below:

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Now you can take out the microSD card from your computer.

2. Install Ubuntu 18.04 on Jetfalcon

In this step, we have to install Ubuntu 18.04 through the microSD card. Please insert the microSD card into the Jetson nano. After that, you can power on Jetson nano and follow install steps to install Ubuntu 18.04.

3. Install ROS-Melodic

we can use the ROS_melodic_install.sh to install ROS1, Please followe these steps below to install.

3-1. Open the terminator and download the project

Please press [ctrl] + [alt] + [t] on desktop to open the terminal

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Next, type the command to install git

sudo apt update && sudo apt install git

Now you can use git to download the project jetfalcon. Please type the command below to download the project jetfalcon

git clone https://github.com/kjoelovelife/jetfalcon

Download project jetfalcon

3-2. Use script to install ROS-Melodic

Please type the command below in the terminal to install ROS-melodic:

source ~/jetfalcon/install/ROS_melodic_install.sh

Install ROS-Melodic

I assume you use microUSB to power the jetson nano, this script will setup your power mode with 5W automatically. If not, you can change the power mode by yourself in the script before you install ROS-Melodic.

3-3. Test ROS-Melodic

Great! Now you have installed ROS-Melodic on your jetson nano. You can type the code bellow to test:

roscore

roscore

After test done, remember press [ctrl]+[c] in terminal for shutdowning the master node.

4. Build project jetfalcon workspace

This step is the last step and make sure you have done:

  1. Write Image to the microSD Card
  2. Install Ubuntu 18.01 on Jetfalcon
  3. Install ROS-Melodic

OK! Before building the workspace, there are some dependencies for the project jetfalcon. Please type the command below to install these dependencies:

source ~/jetfalcon/install/dependencies.sh

install dependencies

Next, please type the command below to build the workspace for project jetfalcon.

cd ~/jetfalcon/catkin_ws && catkin_make

Build workspace

Building workspace will take some times. You can buy a coffee or relax yourself in building time :).

After building done, please type the command below for setting up the operating environment in the terminal:

echo "source ~/jetfalcon/setup/environment.sh" >> ~/.bashrc

And then update the operating environment in the terminal, you can find some information shown on the terminal.

Update operating environment

5. Copy the parameters

There are many paramters to define the Jetfalcon's motion, but every Jetfalcon must need different values of the parametes to move. Therefore, There are many "default" parameters in the project jetfalcon and we need to copy these to the different Jetfalcon. We use hostname to distinguish different Jetfalcon, so copy these parameter from "default" to "hostanme" is the needed step. Please type the command below to copy the default parameters:

source ~/jetfalcon/setup/set_parameter.sh

There are three different informations can be shown on the terminal

Copy file.. : copy the default parameter to hostname parameter
File exsted.. : the hostname parameter had existed and pass it.
There are special..: must adjust manually

Now we have set up the operating environment! Please visit it to go next unit: 1. Jetfalcon and teleoperation.