bag recording with OAK-D for RTAB-Map

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

bag recording with OAK-D for RTAB-Map

Parastou Bakhtiari
Hi,

I have found this .py file in the github repo depthai_sdk/examples/recording/rosbag_record.py which is related to recording a bag file.

I am trying to record rosbag file using OAK-D W POE camera and launch RTAB-Map on this recorded bag file.

Would you please tell me where can I find the document related to recording the bag file compatible with RTAB-Map? I need /tf and /tf_statics, too.

and which ROS version do you suggest? ROS Noetic or ROS2 Humble?

Thank you.
Reply | Threaded
Open this post in threaded view
|

Re: bag recording with OAK-D for RTAB-Map

matlabbe
Administrator
Hi,

Yeah, you would need /tf, /tf_static, the camera_info and the image topics. You could do it on ros1 or ros2, it doesn't matter. ros1 is deprecated this year, so I suggest to record a ros2 bag if you can.

Here an example with an OAK-D.

ros1:
rosbag record /tf /tf_static \
   /stereo_inertial_publisher/right/image_rect \
   /stereo_inertial_publisher/stereo/depth \
   /stereo_inertial_publisher/right/camera_info

ros2:
ros2 bag record /tf /tf_static \
   /right/image_rect \
   /right/camera_info \
   /stereo/depth

When you replay a bag, don't forget to add "--clock" argument.
Reply | Threaded
Open this post in threaded view
|

Re: bag recording with OAK-D for RTAB-Map

Parastou Bakhtiari
Hi Matlabbe,

Thanks for your kind guidance. Would you please help me to figure out a problem?
I Have an issue with ORB-SLAM3, I have used this repository to build the wrapper, and I have attached the bag file I used in a shared google drive folder to this message. Also I have attached the calibration yaml file that I used.
I use this
ros2 run orbslam3 stereo /home/parastou/Dev/ORB_SLAM3/Vocabulary/ORBvoc.txt /home/parastou/ros2_ws/calibrationn.yaml false --ros-args --remap /camera/left/image_raw:=/left/image_rect --remap /camera/right/image_raw:=/right/image_rect

but I get this error below, I would really appreciated it if you could help me in this matter.
ORB-SLAM3 Copyright (C) 2017-2020 Carlos Campos, Richard Elvira, Juan J. Gómez, José M.M. Montiel and Juan D. Tardós, University of Zaragoza.
ORB-SLAM2 Copyright (C) 2014-2016 Raúl Mur-Artal, José M.M. Montiel and Juan D. Tardós, University of Zaragoza.
This program comes with ABSOLUTELY NO WARRANTY;
This is free software, and you are welcome to redistribute it
under certain conditions. See LICENSE.txt.

Input sensor was set to: Stereo

Loading ORB Vocabulary. This could take a while...
Vocabulary loaded!

Initialization of Atlas from scratch
Creation of new map with id: 0
Creation of new map with last KF id: 0
Seq. Name:

Camera Parameters:
- Camera: Pinhole
- Image scale: 1
- fx: 798.979
- fy: 798.979
- cx: 658.313
- cy: 350.73
- k1: 0
- k2: 0
- p1: 0
- p2: 0
- k3: 0
- fps: 30
- color order: RGB (ignored if grayscale)

Depth Threshold (Close/Far Points): 2.8125

ORB Extractor Parameters:
- Number of Features: 1500
- Scale Levels: 8
- Scale Factor: 1.2
- Initial Fast Threshold: 20
- Minimum Fast Threshold: 7
There are 1 cameras in the atlas
Camera 0 is pinhole
Shutdown

Saving keyframe trajectory to KeyFrameTrajectory.txt ...
double free or corruption (out)
[ros2run]: Aborted

Ubuntu 22.04
ROS2 Humble
OpenCV 4.5.4
pangolin version: 0.9.3
g++ 11.4.0
Eigen3 3.4.0


yaml file:
%YAML:1.0

#--------------------------------------------------------------------------------------------
# Camera Parameters. Adjust them!
#--------------------------------------------------------------------------------------------
Camera.type: "PinHole"

# Camera calibration and distortion parameters (OpenCV)
# Copied from the EEPROM data dump in depthai_demo.py.
Camera.fx: 798.97924805
Camera.fy: 798.97924805
Camera.cx: 658.31286621
Camera.cy: 350.72979736

Camera.k1: 0.0
Camera.k2: 0.0
Camera.k3: 0.0
Camera.k4: 0.0
Camera.p1: 0.0
Camera.p2: 0.0

Camera2.fx: 798.95129395
Camera2.fy: 798.95129395
Camera2.cx: 638.31915283
Camera2.cy: 368.72369385

Camera2.k1: 0.0
Camera2.k2: 0.0
Camera2.k3: 0.0
Camera2.k4: 0.0
Camera2.p1: 0.0
Camera2.p2: 0.0

Camera.bFishEye: 0

Camera.width: 1280
Camera.height: 720

# Camera frames per second
Camera.fps: 30.0

# stereo baseline times fx
Camera.bf: 59.9234475

# Color order of the images (0: BGR, 1: RGB. It is ignored if images are grayscale)
Camera.RGB: 1

# Close/Far threshold. Baseline times.
ThDepth: 37.5

#--------------------------------------------------------------------------------------------
# ORB Parameters
#--------------------------------------------------------------------------------------------

# ORB Extractor: Number of features per image
ORBextractor.nFeatures: 1500

# ORB Extractor: Scale factor between levels in the scale pyramid      
ORBextractor.scaleFactor: 1.2

# ORB Extractor: Number of levels in the scale pyramid  
ORBextractor.nLevels: 8

# ORB Extractor: Fast threshold
# Image is divided in a grid. At each cell FAST are extracted imposing a minimum response.
# Firstly we impose iniThFAST. If no corners are detected we impose a lower value minThFAST
# You can lower these values if your images have low contrast                  
ORBextractor.iniThFAST: 20
ORBextractor.minThFAST: 7

#--------------------------------------------------------------------------------------------
# Viewer Parameters
#--------------------------------------------------------------------------------------------
Viewer.KeyFrameSize: 0.1
Viewer.KeyFrameLineWidth: 2
Viewer.GraphLineWidth: 1.2
Viewer.PointSize: 3
Viewer.CameraSize: 0.1
Viewer.CameraLineWidth: 4
Viewer.ViewpointX: 0
Viewer.ViewpointY: -0.5
Viewer.ViewpointZ: -1.5
Viewer.ViewpointF: 700


link to bag file: https://drive.google.com/drive/folders/1yUU-CYAQIH9XwOTov4gRZ67wckl34Fh_?usp=drive_link