Skip to content

ros-ukraine/learning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ROS Learning

ROS Learning Materials

License

ROS Basics

Environment

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

Tasks

Boilerplate code is located in ros_basics folder.

Task 1

ROS

Simple hello ROS application

Firmware

Simple serial interface hello from MCU example. It was implemented for Nucleo 144 for FTDI and Virtual COM Port (CDC).

Task 2

ROS

Parameters usage example with launch file.

Firmware

Echo immplementation using serial interface. It was implemented for Nucleo 144 for FTDI and Virtual COM Port (CDC).

Task 3

ROS

Custom message package and subscriber.

Firmware

Implementation of blocking API for message sending and receiving. Based on that API was implemented echo for Nucleo 144 Virtual COM Port (CDC).

Task 4

Installation of STM32 ROSSerial

Please clone https://github.com/yoneken/rosserial_stm32 into your workspace.

STM32CubeIDE Project Setup for FTDI

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) {
  }
STM32CubeIDE for Virtual COM Port (CDC)

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.

In order to run Serial to TCP bridge:
  1. Install pySerial package on host OS by running this command
pip install pyserial
  1. Find location of pyserial package on your disk

  2. Change you path in command line tool to folder examples

  3. Launch ROS serial server node using this launch file as an example

roslaunch hello_hardware network.launch port:=8282
  1. Launch bridge in client mode
python ./tcp_serial_redirect.py -c localhost:8282 /dev/ttyUSB0 115200

Releases

No releases published

Packages

No packages published

Languages