Package: kappe
KappeKappe is an efficient data migration tool designed to seamlessly convert and split MCAP files.Table of contentTable of contentKappeTable of contentInstallationUsageConvertTopicRename a topicRemove a topicUpdate the ROS header timeChange ROS Timestamp to publish timeChange MCAP pub/log time from ROS headerAdd a time offset to ROS TimestampPointcloudRemove zero points from PointCloud2Rotate a pointcloudRename PointCloud2 field nameTFRemove TransformInsert Static TransformSchema MappingTrimPluginsROS1 to ROS2 conversionReproducibilityCutSplit on timeSplit on topicInstallationpip install kappeorrye tools install kappeUsageCreate a yaml config file containing the migrations you want to perform.Example:config.yamltopic:mapping:/points:/sensor/pointsRun the converter:kappe convert --config config.yaml ./input.mcapConvertkappe convert [-h] [--config CONFIG] [--overwrite] input outputConverts a single file or a directory of files to the MCAP format.TopicRename a topictopic:mapping:/points:/sensor/pointsRemove a topictopic:remove:-/pointsUpdate the ROS header timeAdds 8 second and 300 nanosec to the ROS header.time_offset:/sensor/points:sec:8nanosec:300Change ROS Timestamp to publish timeChange the time of the ROS Timestamp to the time the message was published.time_offset:/sensor/points:pub_time:TrueChange MCAP pub/log time from ROS headerUpdate the log/pub time from the ROS header.
Ifpub_timeis set, pub time will be used as source.
Ifsecand/ornanosecis set, the offset is used.time_offset:/sensor/points:update_publish_time:Trueupdate_log_time:TrueAdd a time offset to ROS TimestampAdd 15 seconds to the ROS Timestamp.time_offset:/sensor/points:sec:15nanosec:0PointcloudRemove zero points from PointCloud2point_cloud:/sensor/points:remove_zero:trueRotate a pointcloudpoint_cloud:/sensor/points:rotation:euler_deg:-180-0-0Rename PointCloud2 field nameChanges the field name of the PointCloud2 message, fromAzimuthAngletoazimuth_angle.point_cloud:/sensor/points:field_mapping:AzimuthAngle:azimuth_angleTFTo update a static transform you need to remove the old one and insert a new one.Remove TransformRemoves all transform where the child_frame_id istest_data_frameorother_frame.tf_static:remove:-test_data_frame-other_frameInsert Static TransformRotation can be specified ineuler_degorquaterniontf_static:insert:-frame_id:basechild_frame_id:also_base-frame_id:basechild_frame_id:sensortranslation:x:-0.1y:0z:0.1rotation:euler_deg:-0-90-0Schema MappingIf the new schema is not already in the mcap, kappe will try to load it either from your ROS2 environment or from./msgs.msg_schema:mapping:std_msgs/Int32:std_msgs/Int64TrimTrim the mcap file to a specific time range.time_start:1676549454.0time_end:1676549554.0PluginsKappe can be extended with plugins, for example to compress images. Source code for plugins can be found in theplugins, additional plugins can be loaded from./plugins.plugins:-name:image.CompressImageinput_topic:/imageoutput_topic:/compressed/imagesettings:quality:50ROS1 to ROS2 conversionKappe automatic converts ROS1 messages to ROS2 messages.
It will not reuse ROS1 definitions, all schemas will be loaded either from your ROS2 environment or from./msgs. If the ROS2 schema name has changed use themsg_schema.mappingto map the old schema to the new schema.The msg field will be mapped exactly, ROS1 time and duration will be converted to ROS2 time and duration (secs -> sec&nsecs -> nanosec).To download the common ROS2 schemas run:gitclone--depth=1--branch=humblehttps://github.com/ros2/common_interfaces.git./msgs/common_interfaces
gitclone--depth=1--branch=humblehttps://github.com/ros2/geometry2.git./msgs/geometry2ReproducibilityKappe saves the input/output path, the time and the version into a MCAP metadata field, calledconvert_metadata.
The config will be saved as an attachment namedconvert_config.yaml.Cutusage: kappe cut [-h] --config CONFIG [--overwrite] input [output_folder]Cuts a directory of mcaps into smaller mcaps, based on timestamp or topic.Whenkeep_tf_treeis set totrueall splits will have the same/tf_staticmessages.Split on timekeep_tf_tree:truesplits:-start:1676549454.0end:1676549554.0name:beginning.mcap-start:1676549554.0end:1676549654.0name:end.mcapkappe cut --config config.yaml ./input.mcap ./output_folderResults in a folder with the following structure:output_folder
├──beginning.mcap
└──end.mcapSplit on topicSplits the mcap file into multiple files, every time a message on the topic/markeris read.
The file will be splitbeforethe message is read.debounceis the time in seconds that the cutter will wait before splitting the file again, default is 0.keep_tf_tree:truesplit_on_topic:topic:"/marker"debounce:10