Ask Your Question
2

How to use ros and stm32 communication

asked 2017-04-15 07:04:14 -0500

DreamHigh gravatar image

I would like to use stm32 to write the motor driver, use ROS to control, but I do not know how to use rosserial and stm32 communication.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2017-04-16 11:18:24 -0500

rreignier gravatar image

updated 2017-04-24 07:01:09 -0500

Hello,

It will depend on which framework you use to program your microcontroller.

For example there is already rossserial-mbed that works with boards supported by mbed. If you are not using mbed, you have to create the interface in the hardware file. Basically, you have to provide a method to write a byte on a buffered serial port, a method to read a byte from a buffered serial port and a method to give the time elapsed since the beginning of the program in milliseconds.

For example :

Everything is explained in the wiki.

(Edited for better formatting)

edit flag offensive delete link more

Comments

Thanks very much,I have found rosserial_stm32f1 package(https://github.com/spiralray/stm32f1_rosserial.git),but this project has some error when i run it .So i want to move roslib in this project to stm32 stlibrary,then using topic communicate with ros,What do you think about it?

DreamHigh gravatar image DreamHigh  ( 2017-04-17 06:39:03 -0500 )edit

I have never used stm32plus so I cannot help you with this library. In the meantime, I have fixed the issue with the one using ChibiOS. And I am using it successfully right now ( https://github.com/romainreignier/rob... ).

rreignier gravatar image rreignier  ( 2017-04-17 11:03:59 -0500 )edit

Congratulatios!But,I have never used ChibiOS.Though I had a simple look at it, i am no idea how to use it.If you can ,i hope you can give me a tutorial of ChibiOS. thx again.

DreamHigh gravatar image DreamHigh  ( 2017-04-19 01:36:10 -0500 )edit

Congratulatios!But,I have never used ChibiOS.Though I had a simple look at it, i am no idea how to use it.If you can ,i hope you can give me a tutorial of ChibiOS. thx again.

DreamHigh gravatar image DreamHigh  ( 2017-04-19 01:38:11 -0500 )edit

I can give you a simple example on how to run rosserial with ChibiOS but the difficulty is to use the several stm32 peripherals. No, I think, the best for you is to create a rosserial hardware file for the stm32 environnement you are used to. Maybe I can help you. Whick frameworks it is?

rreignier gravatar image rreignier  ( 2017-04-19 02:08:48 -0500 )edit

I‘m so appreciated for your help. As for the hardware,I use the develop kit with STM32f103RCT6 MCU. And I puzzled about the communication between ros and the STM32f103.

DreamHigh gravatar image DreamHigh  ( 2017-04-21 21:18:29 -0500 )edit

Ok but which library do you use to program it? The easiest way is to use the Arduino port for STM32F1 from stm32duino. I have just added support for it in rosserial, I hope it will be merged soon (PR).

rreignier gravatar image rreignier  ( 2017-04-22 09:44:54 -0500 )edit

I use the STLIB 3.5 version with function. but i have never used stm32duino.According to the information online ,I think the usage of this library is the same as arduino 。

DreamHigh gravatar image DreamHigh  ( 2017-04-24 02:55:40 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2017-04-15 07:04:14 -0500

Seen: 6,604 times

Last updated: Apr 24 '17