lucasw / ros_one2z

Similar node graphs in vanilla ros1 and ros2 and also zenoh, focus on localhost using python but also C++ and maybe rust
BSD 3-Clause "New" or "Revised" License
4 stars 0 forks source link

bag/mcap to/from image sequence and video #6

Open lucasw opened 8 months ago

lucasw commented 8 months ago

Trying out https://github.com/mlaiacker/rosbag2video

ros2 launch ros2_example_pkg example_launch.xml
ros2 bag record -a -b 10000
cd rosbag2_*
../src/rosbag2video/ros2bag2video.py -v -t /modified_image .

Example ros2 mcap bag

rosbag2_2023_11_04-07_23_24_bouncing_ball.zip

lucasw commented 7 months ago

https://github.com/orgs/foxglove/discussions/88#discussioncomment-7522958 h264 in mcap- but want to use ros1msg and ros2msg instead of protobuf (and want to have tools to convert to/from any of those, along with to/from image/compressed image and compressed video).

https://docs.foxglove.dev/docs/visualization/message-schemas/compressed-video has ros1 and 2 messages, so shouldn't be an issue to convert from one to another, but not sure how that is done, if a table of matching formats is needed (from scratch, or is somewhere in mcap libraries, or somehow automatic, just load from protobuf and write to ros msg and it'll do the right thing).

Is there an open264 for python? https://github.com/cisco/openh264 Looks like it has C++ and a rust wrapper.

lucasw commented 7 months ago

What happens when ros1_play_mcap.py is used on a protobuf image sequence mcap (like https://github.com/foxglove/community/files/13400734/demo_2023-11-18_06-06-59.zip)?

The ros1 messages are in foxglove/schemas among other things, catkin build this:

git clone git@github.com:foxglove/schemas.git
rosmsg show CompressedImage
[sensor_msgs/CompressedImage]:
std_msgs/Header header
  uint32 seq
  time stamp
  string frame_id
string format
uint8[] data

[foxglove_msgs/CompressedImage]:
time timestamp
string frame_id
uint8[] data
string format
lucasw commented 7 months ago

From mcap foxglove.CompressedImage (recorded using https://mcap.dev) to ros1msg sensor_msgs/CompressedImage: https://github.com/lucasw/ros_one2z/commit/44cc893526a187bf9c68c583e1623d796413c131 - need a big convert of every protobuf message that has a ros1 equivalent (something like that exists in ros1-2 bridges elsewhere)