GithubHelp home page GithubHelp logo

yoneken / rosserial_stm32 Goto Github PK

View Code? Open in Web Editor NEW
217.0 217.0 72.0 94 KB

This is a part of [rosserial](https://github.com/ros-drivers/rosserial) repository to communicate with ROS system through a USART for STM32 embedded system.

License: BSD 2-Clause "Simplified" License

CMake 17.26% C++ 44.00% C 27.52% Python 9.77% Dockerfile 1.46%

rosserial_stm32's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rosserial_stm32's Issues

Not able to reconnect after rasperry client reboot

Hello,

I am able to correctly connect to the STM32 using rosserial_client from a raspberry pi. But if I reboot the raspberry, further connections are not possible unless I reload the STM code using STM32CubeIDE. I get the following error code :

ubuntu@tetra:~$ rosrun rosserial_python serial_node.py _port:=/dev/ttyUSB0 _baud:=115200
[INFO] [1588627303.075109]: ROS Serial Python Node
[INFO] [1588627303.095200]: Connecting to /dev/ttyUSB0 at 115200 baud
[ERROR] [1588627320.210673]: Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino

tested with :

  • provided /example/chatter sample code
  • STM32F405
  • ROS kinetic/raspberry PI3 /ubuntu 16.04

Am I missing some step ?

Thanks in advance !

Unable to sync with device error when porting to STM32F7 Discovery

Hi, I'm trying to use your code and trying to adapt to the F7 Discovery board. As I'm a Keil guy, I've tried to port it to UVision using the steps found in this link: https://blog.csdn.net/qq_37416258/article/details/84844051. I believe the writer is using your repository as a base. It does compile but I get the dreaded "(Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino" when I run rossserial. I've tried multiple UART ports and the issue is the same. Could you possibly help?

compile error on nucleo-stm32f466re

Hello.

Recently, I'm on a project using stm32 with ros

I should use this library to communicate with ros node, but compile error occurs like below

image

Plz let me know what would cause this issue...

entire error message is below

cannot convert 'uint8_t (*)[1024] {aka unsigned char (*)[1024]}' to 'const uint8_t* {aka const unsigned char*}' for argument '2' to 'HAL_StatusTypeDef HAL_UART_Transmit_DMA(UART_HandleTypeDef*, const uint8_t*, uint16_t)'

Sincerely looking forward to your answer

Thanks

Chang publish buffer

Hi, i tried to change the publish buffer of my stm32f4 by changing the rbuflen and tbuflen in STM32Hardware.h:
const static uint16_t rbuflen = 4096;
const static uint16_t tbuflen = 4096;
But when I established the connection with my pc, I still got this message:
Note: publish buffer size is 512 bytes
Is there any where else I have to modify in my firmware? Thank you for reading my question.

Windows vagrant setup is missing c++ compiler

I get an error that the c++ cant be found when running "docker-compose up prepare" for the windows setup. I have made this work by adding the "build-essential" apt package in the Dockerfile.

There still seems to be an issue that rosdep cannot be found at the end of the running (bash: rosdep: command not found
rosserial_stm32_prepare_1 exited with code 127).

how to generate header files for other STM32 Board

I am using STM32F103, how to add to change the code of STM32Hardware header class.

#define STM32F3xx // Change for your device
#ifdef STM32F3xx
#include "stm32f3xx_hal.h"
#include "stm32f3xx_hal_uart.h"
#endif /* STM32F3xx /

how to add header files for stm32f103 please help, I am cubeIDE

HardFault_Handler

While doing all the necessary steps and debugging through Stm32F407, it enters the HardFault_Handler interrupt and the program does not run.
When I examine the stage after which it entered, it enters after the following line of "STM32Hardware.h" file.

 inline uint32_t getRdmaInd (void) {return (rbuflen - __HAL_DMA_GET_COUNTER (huart-> hdmarx)) & (rbuflen - 1); }

Any advice please.

Slower execution speed leading to Lost Sync With Device in STM32F103

Using the rosserial_stm32 library, I am trying to publishing a message(std_msgs/UInt32) on the /chatter topic at a rate of 5Hz. The message gets published at a rate 20% lower as seen from the screenshot below. When estimating the time of execution, I found the time taken for each loop to be around 236ms which is roughly 4.2Hz.

image

image

I am also getting a Lost Sync with Device error very frequently (once every 2 minutes) as the code hangs. Any pointers to solutions?

Thanks!

getParam() cannot be used

Hello I am trying to use the subscription feature from your library.

After I create the instance for NodeHandle as nh, I tried to subscribe to the topic on my ROS system. However, I failed to retrieve the values I need from the topic using getParam().

Can you show what is the proper usage of the subscribing feature of your library as there is not much examples and resources about how to do it.

how to add another STM32 Board

#define STM32F3xx // Change for your device
#ifdef STM32F3xx
#include "stm32f3xx_hal.h"
#include "stm32f3xx_hal_uart.h"
#endif /* STM32F3xx /
#ifdef STM32F4xx
#include "stm32f4xx_hal.h"
#include "stm32f4xx_hal_uart.h"
#endif /
STM32F4xx /
#ifdef STM32F7xx
#include "stm32f7xx_hal.h"
#include "stm32f7xx_hal_uart.h"
#endif /
STM32F7xx */

This a piece of code from STM32Hardware header file, how to add stm32f103 microcontroller ? please guide

Unable to sync with device when using nucleo-f446re

When I run rosserial, the error said "Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino".
I checked USART2 that the global interrupt is enabled and also checked that DMA is added TX and RX. I also changed the buffer in STM32Hardware.h.(Change rbuflen=1024, tbuflen=2048 buffer to rbuflen=512 and tbuflen=512). But it didn't fix it. I don't know what to do....

"rosrun rosserial_stm32 make_libraries.py ." doesn't copy tfMessage.h

I had faced the problem when I tried to build my cpp code with odom_broadcaster.sendTransform(odom_trans) command.

It told me something like it couldn't find "tfMessage.h".

I'm not sure whether someone else got this problem as well or not.

Currently, I've got some workaround: just copy https://github.com/verlab/espuck_driver/blob/master/esp_firmware/libraries/ros_lib/tf/tfMessage.h into /Inc/tf in case someone just got problem like me.

stm32f4 and ros connection

Hi ~ yoneken
your job is about rosserial for stm32 so great.
May I ask you a question?
Do you have to use the uart to usb converter to connect ros host to stm32f board?
or how can you connect between ros host to stm32f board using uart (please tell a litte detail for me)?
thank you so much.

Can't publish and subscribe simultaneously

I am using a STM32f303vct6 board and STM32CubeIDE to code, when I run a single publisher or subscriber then evrything works fine however if I try to both publish and subscribe to different topics then the program comes to at a hault after a minute or so and then it neither subscribes nor publishes until I manually restart the board.

which version of rosserial do I need to use?

Hi, I'm trying your repo, I've created a CubeMX project with just an uart3, with DMA in CIRCULAR mode, clone your repo, catkin_make it, cd to my project, run make_lib, and all other stuff.
Project compile ok (i've change uart2 to 3 and define f7 uC). I've run it and on my computer run rosserial_server, but I get this WARN and there is not new topic (I'm trying chatter project):

[ WARN] [1584502199.794725206]: Bad message header length checksum. Dropping message from client. T41508 L29184 C239 114

Question about function read() of Class STM32Hardware

thank you for your sharing!
I try to transplant this code to F4, I can not understand how the function read() get data from Uart, your code just Receive data one time in function init(), does the function init() run more than one time and is there any other function which can Receive data from Uart?

Why to call flush() in HAL_UART_TxCpltCallback()?

Hello, I saw all your examples are publishers, and both call flush() in HAL_UART_TxCpltCallback().
If I want to implement a subscriber, whether I need to do something in HAL_UART_RxCpltCallback()?

Error with IMU msg version

Hi, I'm trying to publish IMU msg, but I get an error:

[ERROR] [1585245885.234709]: Mismatched protocol version in packet: lost sync or rosserial_python is from different ros release than the rosserial client
[INFO] [1585245885.235322]: Protocol version of client is Rev 0 (rosserial 0.4 and earlier), expected Rev 1 (rosserial 0.5+)

I have rosserial-client version 0.7.7:

~$ apt-cache policy ros-kinetic-rosserial-client 
ros-kinetic-rosserial-client:
  Instalados: 0.7.7-0xenial-20200109-041309+0000
  Candidato:  0.7.7-0xenial-20200109-041309+0000

thank

Which part of "STM32Hardware.h" should I edit?

Japanese

私はSTM32 Nucleo L4シリーズを使おうとしているのですが,変更する箇所はインクルードするファイルのf3をl4に変えるだけでいいのですか?また,ほかに変更しなければいけないと考えられる箇所はありますか?

English(machine translation)

I am trying to use the STM32 Nucleo L4 series, but is it only necessary to change f3 of the included file to l4? Also, are there any other places that you think you should change?

Change float64 type to PrimitiveDataType

float64 is currently of AVR_Float64DataType, a custom type implemented for arduino because it doesn't support float64 type.
It makes no sense to use this type of data since stm32 supports float64 variables

Trying with STM32CubeIDE

I'm trying to use your code as ST has developed new IDE which is compatible on C++ coding.
And at the time on building, I've encountered the error below.
undefined reference to `ros::normalizeSecNSec(unsigned long&, unsigned long&)'
Is it possible helping me fix this problem?

BTW, I'm using ros kinetic and NUCLEO-F303K8.

Build fails

With the latest code, build fails.
CMake Error at /root/catkin_ws/build/catkin_tools_prebuild/CMakeLists.txt:2 (project):
No CMAKE_C_COMPILER could be found.

DMA/USART initialization order

When auto-generating code from .ioc configurations using STM32CubeIDE (1.9.0) the order in which peripherals are created is not fixed. We observed that rosserial_stm32 only works if the DMA is initialized BEFORE the UART connection

MX_DMA_Init();
MX_USART2_UART_Init();

If you have this the other way round, you get connection errors using rosrun rosserial_server serial_node _port:=/dev/ttyACM0 _baud:=115200.

[ INFO] [1655841703.653152322]: Opened /dev/ttyACM0
[ INFO] [1655841705.653483835]: Opened /dev/ttyACM0
[ INFO] [1655841707.653914306]: Opened /dev/ttyACM0
[ INFO] [1655841709.654372123]: Opened /dev/ttyACM0

We don't know how to force the initialization order or how to handle this in rosserial_stm32. But this problem may be related to #33, #22 and other connection problems.

STM32CubeIDE project folder structure changed

The project structure in STM32CubeIDE has changed since this code was released so that the src and inc folders are moved from the project main folder to Core. This folder is already included in "source location" when importing the project.

So far I have failed to compile the project properly in STM32CubeIDE both for Windows and Linux. I am importing from existing ioc file with targeted language C++, which generates a main.c file with the hardware setup, but the code from the main.cpp file is left untouched. Should I rename the main.c to main.cpp and copy-paste the code from the original main.cpp to make it work? Would I also need to convert the project to C++ at some point - I see that this option is available. Could you please rewrite the instructions to make it work for newer versions of STM32CubeIDE and perhaps describe every step of the process?

I find this project really great and am really hoping for it to work.

wrong checksum for topic id and msg

Anytime I publish anything I keep getting "[INFO] [timestamp]: wrong checksum for topic id and msg"

I have messed around with delays in code and baud rates and versions of ROS but of no use. I know it's not an error but it is annoying and it would be nice if I can fix this.

Topics are not being seen by ROS

Hey!
I'm using your 'chatter' example to perform a simple publisher program, and after setting up the communication everything works fine except for the topic 'chatter' it's not being seen even when using 'rostopic list'. can you please tell why this is happening?
thanks in advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.