Custom RCcar with ROS Molodic + Donkeycar!!
-
Steer Servo Motor: Jetson nano J41 PWM, Caution: 3.3V
-
Throttle DC Motor: Waveshare Motorhat: I2C address 0x40
https://github.com/orocapangyo/donkey_ros 에서 수정하였습니다.
https://github.com/Road-Balance/donkey_ros
There's Notion Lecture Notes and Youtube video's about this project. But, It's written in Korean. Anyway, Here's the link
- [Notion Lecture Notes] https://www.notion.so/38a82d8f3f464a22933eef95b8a29fa4
Jetson Nano 4GB + IMX219 160
- Ubuntu 18.04
- ROS Melodic
- Opencv4
├── csi_camera => Handling Image data For IMX219 Camera
├── donkey_control => Control RC Car with Adafruit PCA9685
├── donkey_cv => Computer Vision Package with Opencv4
├── donkey_joy => Control RC Car with Logitech F710 Game Controller
│
(...)
├── Images
├── LICENSE
├── README.md
- Ros Packages installation
$ sudo apt-get install ros-melodic-cv-bridge
$ sudo apt-get install ros-melodic-image-view
- OpenCV4 installation
- Can be found in JetsonHacks repo
- Clone this Repo
$ cd ~/catkin_ws/src
$ git clone https://github.com/Road-Balance/donkey_ros.git
$ cd ../
$ catkin_make
$ source devel/setup.bash
- csi_camera package
Packages for Image Streaming
Check Camera Connection First!!!
gst-launch-1.0 nvarguscamerasrc sensor_id=0 ! \
'video/x-raw(memory:NVMM),width=3280, height=2464, framerate=21/1, format=NV12' ! \
nvvidconv flip-method=2 ! 'video/x-raw,width=960, height=720' ! \
nvvidconv ! nvegltransform ! nveglglessink -e
sensor_id
: this value depends on Camera Slot in Jetson Nano.
$ roscore
$ rosrun csi_camera webcam_pub.py
$ rosrun image_view image_view image:=/csi_image
$ roscore
$ rosrun csi_camera csi_pub.py
$ rosrun image_view image_view image:=/csi_image
- donkey_control package
Packages for controlling RC Car
with PCA9685
PWM driver.
You need to install Adafruit_PCA9685
python package first
There's four modes for controlling RC Car
- JoyStick Control
- Keyboard Control
- Blob Control
- Yolo4 Control
$ roscore
$ rosrun donkey_control joy_control.py
$ rosrun donkey_control blob_chase.py
- donkey_joy package
There's two modes for using joystick
- Button mode
- Axes mode
$ roslaunch donkey_joy joy_teleop_axes.launch
$ roslaunch donkey_joy joy_teleop_btns.launch
- donkey_cv package
Packages for OpenCV applications
- Find Blob with Certain color
- Publish Image location as a
geometry_msgs/Point
$ roscore
$ rosrun donkey_cv find_ball.py
Control RC Car with game controller
$ roscore
# Jetson
$ rosrun donkey_control joy_control.py
# Laptop or Jetson
$ roslaunch donkey_joy joy_teleop_axes.launch
# or
$ roslaunch donkey_joy joy_teleop_btns.launch
Control RC Car with keyboard
$ roscore
# Jetson
$ rosrun teleop_twist_keyboard teleop_twist_keyboard.py
# Laptop or Jetson
$ roslaunch donkey_joy joy_teleop_axes.launch
Find the any color box of the Jetson Nano on the screen and change the direction of the wheel accordingly.
$ roscore
$ rosrun csi_camera csi_pub.py
$ rosrun donkey_cv find_ball.py
$ rosrun donkey_control chase_the_ball.py
$ rosrun donkey_control blob_chase.py
Debugging with image_view
rosrun image_view image_view image:=/webcam_image
rosrun image_view image_view image:=/blob/image_mask
rosrun image_view image_view image:=/blob/image_blob
Find the object of the Jetson Nano on the screen and change the direction of the wheel accordingly.
#terminal #1
# camera image publish
zeta@zeta-nano:~/catkin_ws$ roslaunch jetson_csi_cam jetson_csi_cam.launch width:=416 height:=416 fps:=15
#terminal #2
#object detect using Yolo_v4
zeta@zeta-nano:~/catkin_ws$ roslaunch darknet_ros yolo_v4.launch
#terminal #3
zeta@zeta-nano:~/catkin_ws$ roslaunch donkey_control yolo_chase.launch