ROS Learning Materials
Please install Docker using these instructions
Get the latest Docker images
docker pull rosukraine/learning:ros_basics
Please note: On OS Windows you should switch your Docker Engine to Linux containers mode
Launch docker container using the following command
docker run -d --name ros_basics -p 8080:8080 -p 8181:8181 -p 8282:8282 rosukraine/learning:ros_basics
You could stop this container using command
docker stop ros_basics
To start container again please type
docker start ros_basics
You could access Cloud9 web IDE in any modern browser by opening this link http://localhost:8181
Boilerplate code is located in ros_basics folder.
Simple hello ROS application
Simple serial interface hello from MCU example. It was implemented for Nucleo 144 for FTDI and Virtual COM Port (CDC).
Parameters usage example with launch file.
Echo immplementation using serial interface. It was implemented for Nucleo 144 for FTDI and Virtual COM Port (CDC).
Custom message package and subscriber.
Implementation of blocking API for message sending and receiving. Based on that API was implemented echo for Nucleo 144 Virtual COM Port (CDC).
Please clone https://github.com/yoneken/rosserial_stm32 into your workspace.
Use script example for STM32 message file generation
rosrun hello_hardware make_library.sh
Select C++ Project type. In case if you missed this step you could always convert project to C++.
Add rosserial/Inc directory as a "Source Location" in the project properties (C/C++ General > Paths and Symbols > Source Location)
In Cube window setup USART (by default it is USART2) using the following steps:
- Enable USARTx and select TX and RX pins
- Enable USARTx global interrupt
- Enable DMA for USARTx_TX and USARTx_RX
- Set both DMA priority to HIGH
- Set mode to Circular in RX DMA
Please use appropriate definition for your board type in ros_basics/task_4/hello_hardware/firmware/rosserial/Inc/STM32Hardware.h
#define STM32F4xx // Change for your device
In the same file it is also possible to change USART device which is used for communication by altering default constructor
public:
STM32Hardware():
huart(&huart2), rind(0), twind(0), tfind(0) {
}
There is an example project for Nucleo-144 board in hello_hardware folder.
It uses blocking API implemented in Task 3.
Based on that STM32Hardware class was implemented.
- Install pySerial package on host OS by running this command
pip install pyserial
-
Find location of pyserial package on your disk
-
Change you path in command line tool to folder examples
-
Launch ROS serial server node using this launch file as an example
roslaunch hello_hardware network.launch port:=8282
- Launch bridge in client mode
python ./tcp_serial_redirect.py -c localhost:8282 /dev/ttyUSB0 115200