StarlingUAS / ProjectStarling

BRL Flight Arena Infrastructure 2.0
Other
17 stars 3 forks source link

Rosbridge multiple rosapi fix and foxglove compatibility #145

Closed mhl787156 closed 2 years ago

mhl787156 commented 2 years ago

This PR provides a fix to the warnings which pop up for multiple rosapi nodes. The full issue has been raised here: https://github.com/RobotWebTools/rosbridge_suite/issues/704

This PR hopefully also addresses foxglove plotting and how why live plotting does not appear to work.

mhl787156 commented 2 years ago

It now works! This is simulated trajectory.

https://user-images.githubusercontent.com/10742598/150415059-6fd92c0d-56a6-48c4-837e-f4a1b28396ac.mp4

Note: that this whole stack needs quite a beefy computer otherwise lag factors in.

mhl787156 commented 2 years ago

Created a temporary dockerfile at mickeyli789/rosbridge-suite:v0.1.0 which supports both runtime building of messages in env var MSGS_WS and plotting through foxglove. Currently used within mavros_controllers as plotting functionality and custom msgs needed asap.

mhl787156 commented 2 years ago

Most recent version now has a working rosbirdge-suite build.

Controllers in simulation must set the use_sim_time parameter for compatibility with foxglove. See https://github.com/foxglove/studio/issues/2697 for information. tl;dr foxglove uses whatever time is specified on the /clock topic. Also see here for how to set a node to use /clock as timesource: https://design.ros2.org/articles/clock_and_time.html

Proposal is base controller should have a USE_SIMULATED_TIME environment variable. Any controller launchfile should then have the following line:

<node pkg="mypkg" exec="controller ...>
    <param name="use_sim_time" value="$(env USE_SIMULATED_TIME false)"/>
   ...
</node>