I have a LeafSystem
that DeclarePeriodicPublish(0.07, 0)
.
This LeafSystem
reads data from a rgbd camera, does some processing and save the result to an attribute of the LeafSystem
instance. The LeafSystem
also declares multiple output ports, which simply copy the value saved in the attribute to the output.
If I simulate this LeafSystem
by itself, the behavior is as expected and DoPublish
get called roughly every 0.07 seconds.
However, if I wire this LeafSystem
to a custom manipulation_station
, then DoPublish
only get called every 0.3 second.
I am not sure how to debug this issue. I have monitored CPU usage during simulation and the python command is not even using half the number of cores, so I am guessing CPU thrasing is not the issue here.
Any suggestion on how to fix this? Or maybe a better way to implement this read data -> processing -> publish data to other LeafSystems
behavior in drake?
Thank you!
Editted on June 4 2021:
The use case is as follows. My pipeline is:
Capture data from a real rgbd camera -> Perform some processing -> Send command to robot in simulation.
During demo, I'd like to show video of the robot in simulation side-by-side with the captured rgbd stream.
The robot in simulation is currently being captured by recording the computer screen.
However, rendering the incoming rgbd stream to screen is too slow. So I am keeping in computer memory the rgbd frame and their timestamp. After recording robot behavior, I then re-render the rgbd stream as a video using the timestamps and then merge this video with the recording of the robot to form one final video.
The time duration between two timestamps is 0.3 seconds. However, the processing of each rgbd frame only takes 0.05 seconds.
The timestamp is obtained using python native time.time() function.