Skip to content

data format conversion #55

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

Open
softdream1 opened this issue May 6, 2025 · 1 comment
Open

data format conversion #55

softdream1 opened this issue May 6, 2025 · 1 comment

Comments

@softdream1
Copy link

I have used the recording example to get date in .bag format. I want to transform it into ros2 .db3 format for research. I'm really get troubles in it, please help me. My camera is gemini335l.

@zhonghong322
Copy link
Contributor

zhonghong322 commented May 22, 2025

Currently, recorded .bag files are only compatible with ROS 1 and do not support the ROS 2 .db3 format. Support for recording in both .bag and .db3 formats is planned for future releases of the OrbbecSDK. In the meantime, a temporary method is available to convert ROS 1 .bag files to ROS 2 .db3 format.

Preface
The format of the Bag file recorded using OrbbecViewer is. bag, which can be played back using the ROS1 standard Bag method:rosbag play orbbec.bagHowever, the standard Bag file format of ROS2 is. db3, so the Bag recorded by OrbbecViewer cannot be used for playback in ROS2 environment.
This document describes how to useros1_bridgeBuild a bridge between ROS1 and ROS2, convert the standard. bag file into a. db3 file, and finally play back the Bag recorded by OrbbecViewer through the Bag playback method of ROS2 standard:ros2 bag play orbbec_bag/

What is ros1_bridge?
ros1_bridgeIs an officially supported ROS software package used to implement the communication bridge between ROS1 and ROS2, allowing the two systems to pass topics, services, and operations to each other. Byros1_bridgeThe topic data of ROS1 can be passed to ros2.

How to use ros1_bridge

  1. Preparation before operation
    ● Required: In your Linux system, you must have ROS1 and ROS2 systems.
    ● Example environment:
    ○ Linux system: Ubuntu20.04
    ○ ROS1 system: ros1-noetic
    ○ ROS2 system: ros2-foxy

  2. Building and running ros1_bridge
    Run ros1_bridge and convert the standard. bag file into a. db3 file, and finally play back the Bag recorded by the OrbbecViewer through the ROS2 standard Bag playback method.
    ● First terminal (running roscore):


#start roscore
source /opt/ros/noetic/setup.bash
roscore

● Second terminal (build, run ros1_bridge):

mkdir -p ~/bridge_ws/src
cd ~/bridge_ws/src
git clone https://github.com/ros2/ros1_bridge.git
git checkout foxy 
source /opt/ros/noetic/setup.bash
source /opt/ros/foxy/setup.bash
colcon build --symlink-install --packages-select ros1_bridge --cmake-force-configure

source install/setup.bash
ros2 run ros1_bridge dynamic_bridge --bridge-all-1to2-topics

● Third terminal (ROS1 playback bag):

source /opt/ros/noetic/setup.bash
rosbag orbbec.bag

● Fourth terminal (see ROS2 image):

# Use rviz2 of ROS2 to check whether the image of ROS2 is normal
source /opt/ros/foxy/setup.bash
rviz2

● The fifth terminal (ROS2 playback bag):

# Use ROS2 standard recording method to record bag package
source /opt/ros/foxy/setup.bash
ros2 bag record -a -o orbbec_bag

# Use the ROS2 standard playback method to play back the bag package after recording
ros2 bag play orbbec_bag/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants