Synchronize ros publisher with simulink - DELAY

2 views (last 30 days)
Hi, I'm using simulink to create a complex stateflow for controlling a ros simulated arm robot.
My setup:
The goal is to move the arm in three different positions using the stateflow. I have written a python node for reading joint positions sent by simulink, publishing them to ros. Another node is responsible to check if the arm arrives in the desired position publishing to simulink the state.
The problem arise when my stateflow tries to publish the second (and third) position that the arm should reach. In details: I have a delay of about 7 seconds between the command sent by simulink and the command published to the python node. I tried to use the Real-Time Pacer and the simulation > mode > "accelerator" but without any results. Is there a way to synchronize simulink with my python node? Increasing the publish rate of simulink? Any hints?
PS: If I bypass simulink and I use only my python to obtain the same trajectory I have no delay at all! Meaning that my python node should be reliable.

Answers (1)

Andres Drago
Andres Drago on 13 Nov 2018
I have the same problem usign Matlab in a laptop + ROS in Raspberry Pi. The image received from the RPI takes 5~7 seconds with no processing just image raw.

Categories

Find more on Publishers and Subscribers in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!