You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to figure out the behavior of ROS 2 Control running with a simulation, which does not run on real-time.
We want to use ROS 2 Control for a very complex system where (our custom) simulation might not be able to run in real-time.
I guess my question splits up into two directions, depending on how the simulation is 'connected' to ros2-control:
The simulation is running within a HW component:
I assume one way of integrating a simulation into ROS 2 Control is to run it within a HardwareComponent. Is that the case for example for the gz_ros2_control.
My question would now be, where at best I run the "actual" simulation/integration (which blocks and might take longer than the controller period), in the read() or in the write() callback? I would say I would best run the simulation in the write() with the controller's period as the time to simulate. How would ROS 2 Control react to the blocking call and the difference in simulation and system time.
The simulation is connected via topics like in [topic_based_ros2_control]:(https://github.com/PickNikRobotics/topic_based_ros2_control/tree/main)
As in our case the simulation is computationally very heavy it makes sens to use this approach, as it allows the simulation to run on a different machine.
Here, as in topic_based_ros2_control, during read() I would use the latest states received via subscriber and in write() I would asynchronously publish the commands.
The simulation itself publishes the simulated time on the /clock topic. How it the behavior of ROS 2 Control, when it is launched with --use-sim-time. Is it following the /clock no matter what, or are there any things I have to note?
Thanks for any help or advise. - After I have figured all of that out, I would be very happy to provide a best-practice or section for the documentation.
The text was updated successfully, but these errors were encountered:
Hi!
about gz_ros2_control: The read/udpate call is done here triggered by the physics engine update. There is no clock involved in the controller_manager then, it just depends on the arguments of the CM calls. (no ros2_control_node involved)
For the second point, the ros2_control_node should handle this now #859 #1810
I am trying to figure out the behavior of ROS 2 Control running with a simulation, which does not run on real-time.
We want to use ROS 2 Control for a very complex system where (our custom) simulation might not be able to run in real-time.
I guess my question splits up into two directions, depending on how the simulation is 'connected' to ros2-control:
The simulation is running within a HW component:
I assume one way of integrating a simulation into ROS 2 Control is to run it within a
HardwareComponent
. Is that the case for example for the gz_ros2_control.My question would now be, where at best I run the "actual" simulation/integration (which blocks and might take longer than the controller period), in the
read()
or in thewrite()
callback? I would say I would best run the simulation in thewrite()
with the controller's period as the time to simulate. How would ROS 2 Control react to the blocking call and the difference in simulation and system time.The simulation is connected via topics like in [topic_based_ros2_control]:(https://github.com/PickNikRobotics/topic_based_ros2_control/tree/main)
As in our case the simulation is computationally very heavy it makes sens to use this approach, as it allows the simulation to run on a different machine.
Here, as in topic_based_ros2_control, during
read()
I would use the lateststates
received via subscriber and inwrite()
I would asynchronously publish thecommands
.The simulation itself publishes the simulated time on the
/clock
topic. How it the behavior of ROS 2 Control, when it is launched with--use-sim-time
. Is it following the/clock
no matter what, or are there any things I have to note?Unfortunately, I could not find any documentation on this important behaviors, and there are quite some issues/PR's on that matter (https://github.com/ros-controls/ros2_control/issues?q=simulation+clock).
Thanks for any help or advise. - After I have figured all of that out, I would be very happy to provide a best-practice or section for the documentation.
The text was updated successfully, but these errors were encountered: