Skip to content

It is a repository for students in IC382 2021-2022.

Notifications You must be signed in to change notification settings

loganqin/IC382-ROS-STM32

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IC382-ROS-STM32

This repository is used to develop a ROS base controller with STM32 for AGV. Noted that this repository is developed and tested by ROS-Noetic and Ubuntu Server 18.04 64 bit in raspberry pi 3B+.

Installation

Please install the following packages when ROS Noetic is installed properly.

  1. ROS teleop_twist_keyboard
sudo apt-get install ros-noetic-teleop-twist-keyboard
rosrun teleop_twist_keyboard teleop_twist_keyboard.py
  1. ROS rosserial
sudo apt install ros-noetic-rosserial
  1. ROS rosserial_stm32
cd src
git clone https://github.com/yoneken/rosserial_stm32.git
cd ..
catkin_make

Compile STM32CUBMX code

  1. User chatter as an example
cd IC382-ROS-STM32/src/rosserial_stm32/src/ros_lib/examples
sudo cp -avr chatter/ ~/development/STM32_cubmx_program/
cd ~/development/STM32_cubmx_program/chatter
rosrun rosserial_stm32 make_libraries.py .

**You may see a question about choosing a non-unique executable, please choose the one in src/rosserial. Usually, it is option 2.

**Please check your make_libraries.py and make sure it is suitable for python3.

**The pre-build STM32_cubmx_program is packed into this repository for reference.

Test rosserial with STM32

Make sure the STM32 usb port is connected to raspberry pi usb port.

  1. ROSCORE
cd development/agv_base_control
roscore
  1. Set authority to serial port
sudo chmod 777 /dev/ttyACM0  ##Note that ttyACM0 may not fit yours
  1. Bring up ROS serial node
rosrun rosserial_python serial_node.py _port:=/dev/ttyACM0 _baud:=115200
  1. Checkout ROS message
rostopic echo <your_topic>
  1. Visualize nodes relationshiop
rosrun rqt_graph rqt_graph

System startup procedure

Make sure the STM32 usb port is connected to raspberry pi usb port.

This part is very similar to "Test rosserial with STM32". However, some steps are removed because they are not necessary when the connection is confirmed.

A. Startup each module individually

  1. Activate roscore
cd 
roscore
  1. Set authority to serial port
sudo chmod 777 /dev/ttyACM0
  1. Bring up ROS serial node
rosrun rosserial_python serial_node.py _port:=/dev/ttyACM0 _baud:=115200
  1. Start teleop_twist_keyboard control
rosrun teleop_twist_keyboard teleop_twist_keyboard.py
  1. Start encoder-odometry conversion
rosrun robot_encoder_odom robot_encoder_odom_node

B. Startup ALL NODES together

  1. Start up the base control system Without odom. You may need to disable RVIZ if you plan to run in raspberry pi.
cd development/agv_base_control
source devel/setup.bash
sudo chmod 777 /dev/ttyACM0
roslaunch robot_encoder_odom agv_base_control_odom.launch
  1. Start up the base control system With odom. You may need to disable RVIZ if you plan to run in raspberry pi.
cd development/agv_base_control
source devel/setup.bash
sudo chmod 777 /dev/ttyACM0
roslaunch robot_encoder_odom agv_base_control_odom.launch

**For the usage of teleop_twist_keyboard, please refer to http://wiki.ros.org/teleop_twist_keyboard.

RVIZ Visualization

image image

ROS Node Graph

image

About

It is a repository for students in IC382 2021-2022.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages