-
Notifications
You must be signed in to change notification settings - Fork 1
General ‐ Post Processing
More infos to kleinkram:
- https://docs.datasets.leggedrobotics.com/usage/getting-started.html
- https://datasets.leggedrobotics.com
Quick start on OPC
pip install kleinkram
pip install kleinkram --pre # To get the previou dev version
klein --install-completion
klein loginFor uploading a mission take a look at the box_utils/box_kleinkram/upload_mission.py
/out # All files will be uploaded to GoogleDrive
klein mission upload --mission $MISSION_UUID --path /file.bag # Uploading to Kleinkram- ap20_python_online_matcher.py
- ap20_validate.py
- color_correction.py
- graph_msf.py
- dlio.py
- open3d_slam.py
- hesai.py
- hdr_timestamp_adjuster.py
- update_camera_info.py # TODO
- update imu_intrinsics.py # TODO
- create_tf_static.py # TODO
- imu_timesync.py
- health_check_mission.py
| File | Input | Output | Description |
|---|---|---|---|
| merge_mission.py | *_x.bag | *.bag | Merges files and removes index. |
| ros2_to_ros1.py | jetson_hdr.mcap | jetson_hdr.bag | Convert ROS2 to ROS1 format. |
| color_correction.py | nuc_alphensense.bag | nuc_alphensense_corrected*.bag | Color correction for alphasense. |
| rectify.py | TBD | TBD | Rectification of all images. |
| topic_freq.py | *.bag | pngs | Topic frequency plots. |
| cpt7_replay.launch | nuc_cpt7.bag | Corrects CPT7 messages | |
| box_post_processor.launch | *_lpc_tf.bag | Corrects tf | |
| replay_packets.launch | *_nuc_hesai_0.bag | Hesai | |
| zed2i_replay.launch | *_jetson_zed2i.svo2 | Zed2i | |
| atn_position3_fuser position3_fuser_replay.launch | *_jetson_ap20.bag, *_nuc_cpt7.bag, *_nuc_tf.bag, *_nuc_livox.bag (for visualization) | *.csv | Offline motion estimation with Prism and GNSS. |
HDR is recorded in ROS2 MCAP files, Zed2i is recorded in native .svo files.
Navigate to a directory with existing mission directories (e.g.: /data).
Run boxi convert_mcap —-pattern=“202407*” with regex matching the missions you want to convert.
This will process the /hdr subdirectory in each mission directory and save a xyz_jetson_hdr.bag file in the existing mission directory alongside the existing ros1 bag files.
Note that if the .metadata file in the hdr subdirectory is missing because the recording was interrupted, the processing will fail, and the data must be uncorrupted.
You need the version of the zed-ros-wrapper submodule that overwrites the published timestamps with the original image timestamps.
Navigate to the zed-ros-wrapper directory and check out the grandTour branch of the forked repo.
Then, you can open two terminals on the jetson. In one terminal, run the ros wrapper in svo input mode, and in the other, record a rosbag of the output topics you want:
In the first terminal, record your rosbag:
rosbag record -O xyz.bag /zed2i/zed_node/left_raw/image_raw_color /zed2i/zed_node/right_raw/image_raw_color
In the second terminal, run the zed_wrapper node, in svo input mode, on your .svo file
roslaunch zed_wrapper zed2i.launch svo_file:=/data/xyz/xyz_jetson_zed2i.svo2
For running the offline optimization, get the Graph-MSF Repo on branch feature/gt_generation.
Then, build and run the fuser:
catkin build atn_position3_fuser
roslaunch atn_position3_fuser position3_fuser_replay.launchIn a separate terminal, one can play the rosbags with the endings as shown above in the table, e.g.
rosbag play 2024-09-14-20-42-22_jetson_ap20.bag 2024-09-14-20-42-22_nuc_cpt7.bag 2024-09-14-20-42-22_nuc_tf.bag 2024-09-14-20-42-22_nuc_livox.bag --clockThis will then visualize the box trajectory. At the end of the mission, one can (right now manually) trigger the offline optimization while specifying the max. Number of optimization iterations:
rosservice call /graph_msf/trigger_offline_optimization "max_optimization_iterations: 70"Usually, this will require less than 70 iterations and will store several files in at <atn_position_3_fuser_dir>/logging.
To visualize the latest optimization result (creating plots), one can run:
rosrun graph_msf_ros plot_latest_quantitites_in_package_dir.py atn_position3_fuserThis will automatically detect the latest run in the directory specified above and generate several plots, including the uncertainty along the trajectory.
To visualize the offline computed trajectory in RVIZ, you can manually convert the .csv files from above to rosbags.
rosrun graph_msf_ros manual_pose_files_to_tf_and_odom_bag.py atn_position3_fuser <imu_sensor_frame>Which will generate a bag file containing the TF information from world_offline-><imu_sensor_frame>. The latter can e.g. be State.
Next, this can be visualized in RVIZ by running
roslaunch atn_position3_fuser position3_fuser_replay_offline_bag.launchThe location of the generated bag file (together with 2 other bag files) can either be set in the launch file, or given as an argument:
- estimate_file
- pt_file
- tf_file
Run the check_freq (?) script on the resulting directory of rosbags to check the data is as expected.
Presented by RSL.