ECE/MAE 148 FA19 Team 7 Project: adaptive cruise control on autonomous driving RC car.
Please checkout our wiki page for more information: https://guitar.ucsd.edu/maeece148/index.php/2019FallTeam7#References
We use ROS in this project to work with RPLidar. Therefore please install ROS on your Jetson/Rpi first.
Follow the tutorials below to install ROS and setup catkin workspace:
http://wiki.ros.org/melodic/Installation/Ubuntu
http://wiki.ros.org/ROS/Tutorials/InstallingandConfiguringROSEnvironment
In order to communicate with RPLidar, we use the offical RPLidar ROS package:
https://github.com/robopeak/rplidar_ros
Wiki page for this package is:
To install this package, ssh into jetson and clone the repo into catkin_ws/src
:
cd ~/catkin_ws/src
git clone https://github.com/robopeak/rplidar_ros.git
Then build this package:
cd ~/catkin_ws
catkin_make
This project uses YOLO for pedestrain and traffic sign detection. Please install YOLO under projects/d3
following the instruction:
https://pjreddie.com/darknet/install/
Make sure to download pretrained YOLO weights. For more information please refer to:
https://pjreddie.com/darknet/yolo/
cd ~/projects
git clone https://github.com/InspireX96/ECE148AdaptiveCruiseControl.git
Install required python packages in addition to packages in donkeycar framework
cd ECE148AdaptiveCruiseControl
pip install -r requirements.txt # NOTE: you may need to run this command in sudo
To setup this project on top of existing donkey framework, simply run command:
cd src
./setup.sh
Use the launch file in RPLidar ROS package to turn on the LIDAR.
roslaunch rplidar_ros rplidar.launch
If you get some error messages here, please refer to the Notes section
Now it's time to run the vehicle!
cd ~/projects/d3
python manage_modified.py drive
Autopilot feature is preserved in manage_modified.py
. Usage is the same as the original manage.py
. Please refer to the original donkey framework for more information.
There are three drive modes to select:
- Manual steering and throttle
- Manual steering and adaptive cruise control throttle
- AI steering and adaptive cruise control throttle
To visualize different LIDAR filters and LIDAR distance calculaor, you can run lidar_filter_player.py
.
Before running this script, please make sure ROS is publishing LIDAR scans, so you can visualize them in real time.
You can manually run unit tests of this package. Please install the setup.py
in order to let pytest find this package on your computer. You can setup using pip:
pip install -e .
Then run the unit tests:
pytest -v
This problem may cause apt-get update
failure or catkin_make
failure.
https://askubuntu.com/questions/929805/timedatectl-ntp-sync-cannot-set-to-yes
sudo service ntp stop
sudo ntpd -gq
sudo service ntp start
timedatectl # check if ntp is synchronized
https://answers.ros.org/question/190317/ros-cant-find-package/
cd ~/catkin_ws
source devel/setup.bash
When running command roslaunch rplidar_ros rplidar.launch
, this error message appears:
Error, cannot bind to the specified serial port /dev/ttyUSB0.
To solve this, we need to change the permission of ttyUSB0 by:
sudo chmod 666 /dev/ttyUSB0
After running command roslaunch rplidar_ros rplidar.launch
and trying to visualize in Rviz, Rviz does not show LIDAR scan and throws error message:
For frame [laser]: Fixed Frame [map] does not exist
This is because tranformation from world to lidar frame is not defined. You can publish it manually by:
rosrun tf static_transform_publisher 0 0 0 0 0 0 map laser 10
Alternatively, you can run this command instead:
roslaunch rplidar_ros view_rplidar.launch
sudo apt-get install python3-pip python3-yaml
sudo pip3 install rospkg catkin_pkg
This project is intended to be used within the donkey car framework https://github.com/autorope/donkeycar.git
Object detection utilizes YOLO:
@article{yolov3,
title={YOLOv3: An Incremental Improvement},
author={Redmon, Joseph and Farhadi, Ali},
journal = {arXiv},
year={2018}
}
Travis CI with ROS utilizes .travis.yml
sections from from https://github.com/felixduvallet/ros-travis-integration.git
Copyright (c) 2016, Felix Duvallet
All rights reserved.