During this hackathon, your mission is to develop a autonomous driving system based on JetRacer Pro. We'll provide you a Nvidia Jetson nano embedded board.
https://www.waveshare.com/wiki/JetRacer_Pro_AI_Kit
- Download the JetRacer image and unzip it.
[https://drive.google.com/file/d/1ZBdqrwhW2n1uN8rughF7Puw98o76kUcH/view?usp=sharing]
- Download Etcher.
https://github.com/balena-io/etcher/releases/download/v1.19.21/balenaEtcher-1.19.21.Setup.exe
- Write the image using Etcher.
- Insert SD card to SD card slot of Jetson Nano (the slot is on the back of Jetson Nano module)
- Power on JetRacer carrier board
- Connect WIFI
- Run the following commands on the terminal
cd ~/jetracer
git checkout ws/pro
sudo python3 setup.py install
sudo reboot
- Configure Power Mode
You need to launch a new Terminal and enter the following commands to select 5W power mode.
sudo nvpmodel -m1
- Resize disk partition
sudo apt update
sudo apt install gparted
sudo gparted
Resize partition to maxsize
sudo apt update
sudo apt upgrade
If you see this error
Execute the lines below
sudo mv /var/lib/dpkg/info/ /var/lib/dpkg/info_old/
sudo mkdir /var/lib/dpkg/info
sudo apt update
sudo apt -f install
sudo mv /var/lib/dpkg/info/* /var/lib/dpkg/info_old/
sudo rm -rf /var/lib/dpkg/info
sudo mv /var/lib/dpkg/info_old/ /var/lib/dpkg/info/
sudo apt update
sudo apt upgrade
http://wiki.ros.org/melodic/Installation/Ubuntu
- Setup your sources.list
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
- Setup your keys
sudo apt install curl
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
- Installation
sudo apt update
sudo apt install ros-melodic-desktop-full
- Environment setup
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc
source /opt/ros/melodic/setup.bash
- Dependencies for building packages
python 2.7
sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential
sudo apt install python-rosdep
sudo rosdep init
rosdep update
python3(essential)
sudo apt install python3-pip python3-all-dev python3-rospkg
sudo apt install ros-melodic-desktop-full --fix-missing
If you make a python ros package, you should add this line at the top of python script
#!~/usr/bin/env python3
- Create a ROS Workspace
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
catkin_init_workspace
cd ~/catkin_ws
catkin_make
python3 (optional)
catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python3
sudo gedit ~/.bashrc
Add the below
++ source ~/catkin_ws/devel/setup.bash
++ alias cw='cd ~/catkin_ws'
++ alias cs='cd ~/catkin_ws/src'
++ alias cm='cd ~/catkin_ws && catkin_make'
++ alias cb='source ~/catkin_ws/devel/setup.bash'
++ alias sb='source ~/.bashrc'
source ~/.bashrc
ROS packages build
cm
- Check controller connection in https://hardwaretester.com/gamepad
#Waiting for connection
#Connection successful
- Install the package & Run
sudo apt install ros-melodic-teleop-twist-joy
rosrun joy joy_node
- Check the ros topic
rostopic echo /Joy
sudo apt install ros-melodic-usb-cam
sudo gedit /opt/ros/melodic/share/cv_bridge/cmake/cv_bridgeConfig.cmake
In line 96
-- set(_include_dirs "include;/usr/include;/usr/include/opencv")
++ set(_include_dirs "include;/usr/include;/usr/include/opencv4")
In line 119
-- set(libraries "cv_bridge;/usr/lib/aarch64-linux-gnu/libopencv_core.so.3.2.0;/usr/lib/aarch64-linux-gnu/libopencv_imgproc.so.3.2.0;/usr/lib/aarch64-linux-gnu/libopencv_imgcodecs.so.3.2.0")
++ set(libraries "cv_bridge;/usr/lib/aarch64-linux-gnu/libopencv_core.so.4.1.1;/usr/lib/aarch64-linux-gnu/libopencv_imgproc.so.4.1.1;/usr/lib/aarch64-linux-gnu/libopencv_imgcodecs.so.4.1.1")
Check the settings
cd ~/catkin_ws/src
git clone https://github.com/AveesLab/sea-me-hackathon-2024.git
cd ../
catkin_make
roscore
rosrun opencv_test opencv_test
- install ros package
sudo apt install ros-melodic-rosserial ros-melodic-rosserial-arduino
- download Arduino
Install this file
Extract arduino-1.8.19-linuxaarch64.tar in Downloads directory
cd ~/Downloads
tar -xvf arduino-1.8.19-linuxaarch64.tar
cd ~/Downloads/arduino-1.8.19
sudo sh install.sh
After connect arduino and Jetson nano, check connection
ls -l /dev/ttyACM0
Authorize
sudo usermod -a -G dialout jetson
sudo chmod a+rw /dev/ttyACM0
Install rosserial library
cd ~/catkin_ws/src/sea-me-hackathon-2024/ultrasonic_ros
arduino ultrasonic_ros.ino
Fix the code
cd ~/Arduino/libraries/Rosserial_Arduino_Library/src/ros
gedit msg.h
-- #include <cstring>
++ #include <string.h>
-- std::memcpy
++ memcpy
roscore
roslaunch usb_cam usb_cam-test.launch
rosrun rosserial_python serial_node.py _port:=/dev/ttyACM0 _baud:=9600
rosrun rosrun joy joy_node
rosrun control actuator.py
rosrun todo todo
You can see this picture