Git Product home page Git Product logo

arduino_raspberry_ros_car's Introduction

Arduino_Raspberry_ROS_Car Tutorials

chapter 1: Construction A ROS Car

​ (TB6612FNG 版本)

​ (A4950T 版本)

Download codes from Git:

git clone https://github.com/COONEO/Arduino_Raspberry_ROS_Car.git

Step One: Download programs for Arduino Mega 2560

Install Arduino IDE in your computer and add library where in Arduino_mega_2560_code/relative_library folder.than,download the code into your Arduino_mega_2560 board.

ps:新增了适配我们Arduino扩展板的程序,见文件夹 “RobotPIDDriver_tb6612” "RobotPIDDriver_A4950T"。配置过程参见如下的两篇微信公众号推文。

如果你使用的是Arduino 大功率电机及驱动器扩展板,那么烧录的程序就应该在该目录下:

Arduino_mega_2560_code/Arduino_mega_2560大功率电机扩展板_code/Arduino-大功率电机驱动板_PID调速_ROS/RobotPIDDriver

具体的步骤,该文件夹中有图片提示,详细的过程,在我们的微信公众号“COONEO” 知乎 “Neor” B站 “COONEO” 中均有。

Step Two: FLASH OS and LAUNCH ROS NODE

1.flash Ubuntu OS into your Pi 4B board (By Win32DiskImager.exe)

The OS img can be finding in our Wechat Official Account COONEO. Process like this:

  1. launch ROS node in Raspberry Pi

    #connect Raspberry Pi and Arduino
    sudo chmod 0777 /dev/ttyACM0
    
    #open a Terminal &&  download codes
    git clone https://github.com/COONEO/Arduino_Raspberry_ROS_Car.git
    
    # copy ROS node in your home folder
    cp -r Arduino_Raspberry_ROS_car/Raspberry_Pi_ROS_Node/catkin_ws ~/
    
    # change *.py file's permission 
    sudo chmod a+x Arduino_Raspberry_ROS_car/Raspberry_Pi_ROS_Node/catkin_ws/src/ros_arduino_bridge/ros_arduino_python/src/ros_arduino_python/*
    sudo chmod a+X Arduino_Raspberry_ROS_car/Raspberry_Pi_ROS_Node/catkin_ws/src/ros_arduino_bridge/ros_arduino_python/nodes/arduino_node.py
    
    cd catkin_ws
    catkin_make
    source devel/setup.bash
    roslaunch ros_arduino_python arduino.launch

    In the end,you can publish Topic "cmd_vel" msg to control ROS car runnning。

chapter 2: Gmapping with Arduino_Raspberry_Car

Step 1 : launch gmapping launch file and watching.

# open a Terminal 
cd catkin_ws
source devel/setup.bash
roslaunch launch_file gmapping_ekf.launch

# open a Rviz && Visual a map
rosrun rviz rviz

Step 2 : save the map

# open a Terminal 
# cd in your folder,P.S.
cd catkin_ws/src/launch_file/map/
rosrun map_server map_saver -f your_map_name

​ and then,the folder will create two files,they are your_map_name.pgm && your_map_name.yaml file.

chapter 3 : Run ROS navigation stack

Step 1 : launch navigation_ekf.launch file.

# open a Terminal
cd catkin_ws
source devel/setup.bash
roslaunch launch_file navigation_ekf.launch

# and open another Terminal
rosrun rviz rviz

select topics like this in Rviz.

and then,click the "2D Nav Goal" button to select a Goal pose.for details,please see the "demo_videos/03_ROS_Navigation_function.mp4" file.

Chapter 4 : Fire detect

# open a Terminal
cd catkin_ws
source devel/setup.bash
fire_detect_cpp.launch   #or "fire_detect.launch"

# and open another Terminal
rosrun rviz rviz

for more details,please see the "demo_videos/04_Fire_detect_based_on_color.mp4" file. or search the "COONEO" in your Bilibili.

chapter 5 : automatic following the line

Step 1 : launch the ros_arduino_bridge node.

# open a terminal 
cd catkin_ws
source devel/setup.bash

roslaunch ros_arduino_python arduino.launch

Step 2 : launch the line_track launch file.

# open another terminal 
cd catkin_ws
source devel/setup.bash
roslaunch line_track linetrack_red.launch

2022.05.11

author:ZhaoXiang Lee

COONEO Co.,Ltd

Web:http://cooneo.cc

E: [email protected]

For more details,you can search "COONEO" in your WeChat.

or search "COONEO" in Bilibili.

arduino_raspberry_ros_car's People

Contributors

zhaoxiangbox avatar

Stargazers

 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.