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+.
Please install the following packages when ROS Noetic is installed properly.
- ROS teleop_twist_keyboard
sudo apt-get install ros-noetic-teleop-twist-keyboard
rosrun teleop_twist_keyboard teleop_twist_keyboard.py
- ROS rosserial
sudo apt install ros-noetic-rosserial
- ROS rosserial_stm32
cd src
git clone https://github.com/yoneken/rosserial_stm32.git
cd ..
catkin_make
- 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.
Make sure the STM32 usb port is connected to raspberry pi usb port.
- ROSCORE
cd development/agv_base_control
roscore
- Set authority to serial port
sudo chmod 777 /dev/ttyACM0 ##Note that ttyACM0 may not fit yours
- Bring up ROS serial node
rosrun rosserial_python serial_node.py _port:=/dev/ttyACM0 _baud:=115200
- Checkout ROS message
rostopic echo <your_topic>
- Visualize nodes relationshiop
rosrun rqt_graph rqt_graph
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.
- Activate roscore
cd
roscore
- Set authority to serial port
sudo chmod 777 /dev/ttyACM0
- Bring up ROS serial node
rosrun rosserial_python serial_node.py _port:=/dev/ttyACM0 _baud:=115200
- Start teleop_twist_keyboard control
rosrun teleop_twist_keyboard teleop_twist_keyboard.py
- Start encoder-odometry conversion
rosrun robot_encoder_odom robot_encoder_odom_node
- 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
- 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.


