Skip to content

Python script for TerraSentia rosbag data extraction

Notifications You must be signed in to change notification settings

matval/terrasentia_utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terrasentia_utils

Python script for TerraSentia rosbag data extraction

To use the package, import DataExtractor

from terrasentia_utils.rosbag_data_extractor import DataExtractor

Create a configuration class data contains the parameters for data extraction

class Config:
    def __init__(self):
        self.center_image_topic = "/terrasentia/zed2/zed_node/left/image_rect_color"
        self.center_depth_topic = "/terrasentia/zed2/zed_node/depth/depth_registered"
        self.center_cam_info    = "/terrasentia/zed2/zed_node/left/camera_info"
        self.odom_topic         = "/terrasentia/ekf"
        self.imu_topic          = "/terrasentia/imu"
        self.motion_cmd_topic   = "/terrasentia/motion_command"
        self.mhe_topic          = "/terrasentia/mhe_output"

        # Define sensors transformations
        self.lidar_offset       = [0.17, 0, 0.35]
        self.camera_offset      = [0.17, 0, 0.37]

        self.cam2base = np.array([
            [ 0.0, 0.0, 1.0, self.camera_offset[0]], 
            [-1.0, 0.0, 0.0, self.camera_offset[1]],
            [ 0.0,-1.0, 0.0, self.camera_offset[2]],
            [ 0.0, 0.0, 0.0, 1.0 ]])

        self.get_freq           = 2             # Frequency we get the image frames from rosbag

Create a DataExtractor object that contains the rosbag data

configs = Config()
data_obj = DataExtractor(configs, rosbag_path)

Retrieve the rosbag data

bag_dict    = data_obj.get_dict()
images_dict = data_obj.get_images()
maps_dict   = data_obj.get_maps()

About

Python script for TerraSentia rosbag data extraction

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages