Extracting frame-wise steering angles from rosbag file

asked 2019-11-10 21:02:03 -0600

penstrokes75 gravatar image

I am working on Udacity's 40GB dataset. There are two topics from which I want to extract data: '/center_camera/image_color' and '/vehicle/steering_report'.

I ran

rosbag info dataset.bag

and the result was as follows:

/center_camera/image_color 15212 msgs : sensor_msgs/Image

/vehicle/steering_report 37976 msgs : dbw_mkz_msgs/SteeringReport

(I have printed only the relevant topics here).

As you can see by the number of msgs, there are 15212 frames and 37976 values for steering angles.

I extracted the frames and copied the data from /vehicle/steering_report to a text file. The text file had steering angles for different "timestamps".

I also printed the timestamps of the frames and searched for those timestamps in the text file, but could not find those exact timestamps.

How do I extract the frame-wise steering angle? I want the steering angle for each frame.

List of all topics for reference:

/can_bus_dbw/can_rx 539637 msgs : dataspeed_can_msgs/CanMessageStamped

/center_camera/image_color 15212 msgs : sensor_msgs/Image

/diagnostics 2252 msgs : diagnostic_msgs/DiagnosticArray (3 connections)

/left_camera/image_color 15212 msgs : sensor_msgs/Image

/right_camera/image_color 15212 msgs : sensor_msgs/Image

/tf 41877 msgs : tf2_msgs/TFMessage

/vehicle/brake_info_report 38040 msgs : dbw_mkz_msgs/BrakeInfoReport

/vehicle/brake_report 37980 msgs : dbw_mkz_msgs/BrakeReport

/vehicle/dbw_enabled 1 msg : std_msgs/Bool

/vehicle/filtered_accel 37976 msgs : std_msgs/Float64

/vehicle/fuel_level_report 7614 msgs : dbw_mkz_msgs/FuelLevelReport

/vehicle/gear_report 15191 msgs : dbw_mkz_msgs/GearReport

/vehicle/gps/fix 760 msgs : sensor_msgs/NavSatFix

/vehicle/gps/time 760 msgs : sensor_msgs/TimeReference

/vehicle/gps/vel 760 msgs : geometry_msgs/TwistStamped

/vehicle/imu/data_raw 75898 msgs : sensor_msgs/Imu

/vehicle/joint_states 114054 msgs : sensor_msgs/JointState

/vehicle/misc_1_report 15191 msgs : dbw_mkz_msgs/Misc1Report

/vehicle/sonar_cloud 3844 msgs : sensor_msgs/PointCloud2

/vehicle/steering_report 37976 msgs : dbw_mkz_msgs/SteeringReport

/vehicle/surround_report 3844 msgs : dbw_mkz_msgs/SurroundReport

/vehicle/suspension_report 38044 msgs : dbw_mkz_msgs/SuspensionReport

/vehicle/throttle_info_report 76079 msgs : dbw_mkz_msgs/ThrottleInfoReport

/vehicle/throttle_report 37978 msgs : dbw_mkz_msgs/ThrottleReport

/vehicle/tire_pressure_report 1521 msgs : dbw_mkz_msgs/TirePressureReport

/vehicle/twist_controller/parameter_descriptions 1 msg : dynamic_reconfigure/ConfigDescription

/vehicle/twist_controller/parameter_updates 1 msg : dynamic_reconfigure/Config

/vehicle/wheel_speed_report 76077 msgs : dbw_mkz_msgs/WheelSpeedReport

edit retag flag offensive close merge delete

Comments

How do I extract the frame-wise steering angle? I want the steering angle for each frame.

just an observation: there may not be any.

Unless the dataset producer states that steering angles are time-matched with frames there would be no obligation for that to have happened.

I've not checked the 40Gb of data, so it could be that there still is time-matched data in there though.

gvdhoorn gravatar imagegvdhoorn ( 2019-11-11 01:32:26 -0600 )edit

So, I may not be able to train my CNN model on individual frames to predict steering angles?

How do I check if there is time-matched data?

And if the data isn't time-matched, what should I do? Choose the closest timestamp for every frame?

penstrokes75 gravatar imagepenstrokes75 ( 2019-11-11 03:25:55 -0600 )edit

I have no idea. I just wanted to make you realise there may just not be "frame-synchronised steering angle[s]".

gvdhoorn gravatar imagegvdhoorn ( 2019-11-11 04:03:32 -0600 )edit