tomas789 / kitti2bag

Convert KITTI dataset to ROS bag file the easy way!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Run from source code

ajay1606 opened this issue · comments

commented

Hello,

I am able to run and test kitti2bag by following instructions from here ( thanks to Magic-wei )and am able to get the bag file as expected.

But I am looking to test kitti2bag from the source code. Since i would like to modify the some part of code in kitti2bag.py

def save_gps_vel_data(bag, kitti, gps_frame_id, topic):
    for timestamp, oxts in zip(kitti.timestamps, kitti.oxts):
        twist_msg = TwistStamped()
        twist_msg.header.frame_id = gps_frame_id
        twist_msg.header.stamp = rospy.Time.from_sec(float(timestamp.strftime("%s.%f")))

Velocity to be published in Vehicle body coordinate, InsteaHello,
def save_gps_vel_data(bag, kitti, gps_frame_id, topic):
    for timestamp, oxts in zip(kitti.timestamps, kitti.oxts):
        twist_msg = TwistStamped()
        twist_msg.header.frame_id = gps_frame_id
        twist_msg.header.stamp = rospy.Time.from_sec(float(timestamp.strftime("%s.%f")))
//Here Velocity to be published in Vehicle body coordinate, Instead of FLU coordinate (vn ve vu instead of vf vl vu)
        twist_msg.twist.linear.x = oxts.packet.vf  
        twist_msg.twist.linear.y = oxts.packet.vl
        twist_msg.twist.linear.z = oxts.packet.vu
        twist_msg.twist.angular.x = oxts.packet.wf
        twist_msg.twist.angular.y = oxts.packet.wl
        twist_msg.twist.angular.z = oxts.packet.wu
        bag.write(topic, twist_msg, t=twist_msg.header.stamp) 

Any help much appreciated.

Regards,
Ajay