Carter12s / roslibrust

A rust client for working with ROS's rosbridge.
https://docs.rs/roslibrust
MIT License
42 stars 6 forks source link

MasterClient get_published_topics() from another crate #187

Open lucasw opened 1 month ago

lucasw commented 1 month ago

I ended up adding pub in a few places (https://github.com/lucasw/roslibrust/tree/pub_master_client) until I could get this rostopic list working:

https://github.com/lucasw/mcap_tools/blob/main/mcap_tools/src/bin/rostopic_list.rs

A step up from that could be to move the master client creation into roslibrust, and then less needs to be exposed, or something else with a master client hidden inside it and only support get_published_topics() (and others later, if other tools demand it)- or is there another route that already exists that I didn't see?

A duplicate rostopic list isn't the goal, but duplicating the record_all feature of rosbag record -a is- it polls the rosmaster once a second for all topics and then adds subscribers or removes them accordingly.

Carter12s commented 1 month ago

Yeah nice, this all tracks.

Was noticing as I was wandering through the crate earlier that we have a bunch of pub vs pub(crate) issues. I'm trying to make an effort now to really start finalizing the overall API of the crate, now that both the rosbridge and ros1 implementations are really working.

I previously went through this with rosbridge, and ended up adding a feature called rosapi that exposes these features via rosbridge's intended method (the calling services on the rosapi node). The "end game" I'd like to start moving things towards is having a RosApi trait and then implementing that trait on both ros1 and rosbridges's nodehandles.

I'm also starting in earnest to plan to break up the main roslibrust crate into a few crates that have more modular functionality. Someone I was talking to voiced some interest in having MasterClient in its own crate, and I mulling over whether that makes sense or not (it probably does).