rosserial_java_符辰洲/rosserial_stm32

rosserial_stm32

Note

This is a part of rosserial repository to communicate with ROS system through a USART for STM32 embedded system.

Limitation

The original code is focused on STM32F3xx, 4xx, and 7xx series and it uses the STM32CubeIDE or STM32CubeMX HAL.

If you use the package for other series, please edit the following line on src/ros_lib/STM32Hardware.h .

Generate code

$ cd target_workspace (It should contain Inc and Src directories).

$ rosrun rosserial_stm32 make_libraries.py .

Never forget to change the project type to cpp project in STM32CubeIDE or SW4STM32!!

For STM32CubeIDE users: You have to add /Inc directory as a "Source Location" in the project properties(C/C++ General > Paths and Symbols > Source Location).

Examples

Share your implementation based on this repo here

Make sure your code is working before adding your repo here ;)

On a Windows machine with virtual machine

Note

Make sure Hyper-V is correctly disabled.

Required softwares

VirtualBox

Vagrant

Run

Generate headers for STM32

Terminal 1

> cd *rosserial_stm32 dir*

> vagrant up

> vagrant ssh

$ cd rosserial_stm32

$ docker-compose up prepare

Then, a sample project is generated on rosserial_stm32/src/ros_lib/examples/chatter/ .

Build code with STM32CubeIDE on Windows

Open new workspace

Import the project as a ac6 System Workbench for STM32 project

Open *.ioc file with Device Configuration Tool

Generate codes with the tool

Change project type to C++ project on Eclipse

Only STM32CubeIDE users: Add /Inc directory to "Source Location" on project properties (C/C++ General > Paths and Symbols > Source Location)

Build

Launch rosseral server

Terminal 1

$ docker-compose up srv

Flash binary on STM32 and start a demo

Terminal 2

> cd *rosserial_stm32 dir*

> vagrant ssh

$ cd rosserial_stm32

$ docker-compose up client

Stop and remove all containers

Terminal 2

[Ctrl+C]

$ exit

Terminal 1

[Ctrl+C]

$ docker stop $(docker ps -q)

$ docker rm $(docker ps -q -a)

$ exit

> vagrant halt

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值