Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update ROS1 docs on bag reader and writer not needing roscore, but live traffic does #910

Open
dehann opened this issue Sep 18, 2022 · 2 comments

Comments

@dehann
Copy link
Member

dehann commented Sep 18, 2022

update to docs page to clarify when and when not roscore is necessary.
https://juliarobotics.org/Caesar.jl/latest/examples/using_ros/

RosbagReader and RosbagWriter do not need roscore to be running per se.
Live traffic pub sub does need roscore running.

Extra info, likely also has something to do with initnode() call.

@dehann
Copy link
Member Author

dehann commented Mar 27, 2023

HI @Affie , could you link perhaps the Python script you've been using please? The one that can read bag files but does not need the rest of ROS...

@Affie
Copy link
Member

Affie commented Mar 27, 2023

using PyCall
py"""
# needs rosbags installed in python `pip install rosbags`
from rosbags.rosbag1 import Reader
from rosbags.serde import deserialize_ros1, deserialize_cdr, ros1_to_cdr
"""
#setup the rosbag reader 
reader = py"filename.bag')"
# open rosbag
reader.open()
# list of topics
topics = reader.topics
# reading like this
for (connection, timestamp, rawdata) in reader.messages()
    msg = py"deserialize_ros1($(Vector{UInt8}(rawdata)),$(connection[3]))"
    @show msg
    #do something with msg
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants