GithubHelp home page GithubHelp logo

donkey_ros's Introduction

Donkey ROS

Donkey car with ROS!!

How to make it?

There's Notion Lecture Notes and Youtube video's about this project. But, It's written in Korean. Anyway, Here's the link

Tested System information

Jetson Nano 4GB

  • Ubuntu 18.04
  • ROS Melodic
  • Opencv4

Packages with Brief Explanation

├── 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
└── STL_Files

Prerequisite

  1. Ros Packages installation
$ sudo apt-get install ros-melodic-cv-bridge
$ sudo apt-get install ros-melodic-image-view
  1. OpenCV4 installation
  1. Clone this Repo
$ cd ~/catkin_ws/src
$ git clone https://github.com/Road-Balance/donkey_ros.git

$ cd ../
$ catkin_make
$ source devel/setup.bash

Usage

  1. 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.

Webcam Puslish

$ roscore

$ rosrun csi_camera webcam_pub.py
$ rosrun image_view image_view image:=/csi_image

CSI Camera Publish

$ roscore

$ rosrun csi_camera csi_pub.py
$ rosrun image_view image_view image:=/csi_image
  1. donkey_control package

Packages for controlling RC Car with PCA9685 PWM driver. You need to install Adafruit_PCA9685 python package first

There's two modes for controlling RC Car

  • JoyStick Control
  • Blob Control
$ roscore

$ rosrun donkey_control joy_control.py
$ rosrun donkey_control blob_chase.py
  1. 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
  1. 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

Application

1. joy_control

Control RC Car with logitech F710 game controller

$ roscore

# Jetson
$ rosrun donkey_control joy_control.py

# Laptop or ROS Slave PC
$ roslaunch donkey_joy joy_teleop_axes.launch
# or
$ roslaunch donkey_joy joy_teleop_btns.launch

2. blob_tracking

Find the green 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

Nothing

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

sudo apt-get install ros-melodic-cv-bridge
sudo apt-get install ros-melodic-image-view

rosrun csi_camera webcam_pub.py
rosrun image_view image_view image:=/csi_image

take photo

python range_detector.py --image frame0000.jpg --filter HSV --preview

rosrun donkey_cv find_ball.py

rosrun image_view image_view image:=/csi_image
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

roslaunch donkey_control blob_control.launch 

rosrun csi_camera csi_pub.py
rosrun donkey_cv find_ball.py 
rosrun donkey_control chase_the_ball.py 
(env)  rosrun donkey_control blob_chase.py 

donkey_ros's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.