Closed lucasw closed 4 months ago
roslibrust mentions having to turn on the ros1 feature to get the ros1 native nodes, looks like this happened automatically:
ros1_rlr$ cargo tree -e features | grep roslibrust
├── roslibrust feature "default"
│ └── roslibrust v0.9.0
│ ├── roslibrust_codegen feature "default"
│ │ ├── roslibrust_codegen v0.9.0
│ │ └── roslibrust_codegen feature "tokio"
│ │ └── roslibrust_codegen v0.9.0 (*)
│ ├── roslibrust_codegen_macro feature "default"
│ │ └── roslibrust_codegen_macro v0.9.0 (proc-macro)
│ │ ├── roslibrust_codegen feature "default" (*)
├── roslibrust feature "ros1"
│ └── roslibrust v0.9.0 (*)
├── roslibrust_codegen feature "default" (*)
├── roslibrust_codegen_macro feature "default" (*)
rostopic echo
works on a topic published by this node, but rostopic hz doesn't, no new messages
- isn't rostopic hz subscribing no different than echo, or is it doing something behind the scenes not supported here?
-> The difference is that rostopic hz uses rospy.AnyMsg
- something is missing from the message (connection header?) to break that?
This gets me a much smaller ROS_PACKAGE_PATH
, but not sure if build times are improved:
source ~/ros/ros1/install/overlay_2404_ws/install/setup.bash
If I don't want to have to know the right paths and build time, is there a way build.rs could search within ROS_PACKAGE_PATH just for the messages/message packages I need (which could be listed in build.rs). This would be the similar to having to list packages in package.xml. Or call rospack find
and build a special ROS_PACKAGE_PATH from that in shell script that needs to be run manually.
Fixed with updated version of roslibrust 8a0c98c48f8ae12a1256cf37d30fa6f7d751a8dd
Make a ros node with several subscriber and publishers using the roslibrust ros1 native feature:
https://github.com/Carter12s/roslibrust?tab=readme-ov-file#experimental-support-for-ros1-native
https://github.com/lucasw/ros_one2z/tree/main/ros1_rlr
So far roslibrust has seems to be able to find ros messages from ROS_PACKAGE_PATH better than rosrust (certain messages cause the rosrust build to fail, TBD insert link to issue/comments about that).
But maybe roslibrust build times are much longer (haven't tried rosrust recently) - is that because it is building a lot of messages that go unused? This also may be because I'm calling the message codegen macro, try following the example (https://github.com/Carter12s/roslibrust?tab=readme-ov-file#code-generation-of-ros-messages https://github.com/Carter12s/roslibrust/blob/master/example_package/build.rs). Could also try curating ROS_PACKAGE_PATH just for building this, only provide paths to the messages it needs.
Lots of basic ros features are missing (e.g.
__name
__ns
and topic remap https://github.com/Carter12s/roslibrust/issues/113), but really if only publishing and subscribing work the rest can be worked around. The namespace features can be implemented in the node (and then put into a library here, and then probably can figure out how to add them upstream after that).Probably need Corrosion and build with cmake to get the nodes to a place where rosrun and roslaunch will work, but perhaps the right cargo command (
--out-dir
?) can place the binaries where needed. But the name and namespacing comes first.Need to learn tokio to have multiple subscribers and timed publishing in the same node. Seems more complicated than it ought to be but I suppose rospy and roscpp went to a lot of effort to hide inherent complexities.
Haven't tried service calls yet- ultimately want dynamic reconfigure working (or 'dynamic dynamic reconfigure', don't bother with implementing .cfg message building) but could live without that for a while. Can implement the dynamic reconfigure interface manually here then maybe push it upstream or into a standalone crate later.