Skip to content

Commit

Permalink
fix: Compatible with latest pykitti
Browse files Browse the repository at this point in the history
  • Loading branch information
ulterzlw committed Jun 22, 2019
1 parent ba728fb commit c4763d7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,8 @@ ENV/
# Pycharm
*.idea

# Visual Studio Code
.vscode/

# Temporary files from text editors
*~
2 changes: 1 addition & 1 deletion kitti2bag/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .kitti2bag import run_kitti2bag
from kitti2bag import run_kitti2bag


def main():
Expand Down
8 changes: 4 additions & 4 deletions kitti2bag/kitti2bag.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def save_dynamic_tf(bag, kitti, kitti_type, initial_time):

elif kitti_type.find("odom") != -1:
timestamps = map(lambda x: initial_time + x.total_seconds(), kitti.timestamps)
for timestamp, tf_matrix in zip(timestamps, kitti.T_w_cam0):
for timestamp, tf_matrix in zip(timestamps, kitti.poses):
tf_msg = TFMessage()
tf_stamped = TransformStamped()
tf_stamped.header.stamp = rospy.Time.from_sec(timestamp)
Expand Down Expand Up @@ -360,16 +360,16 @@ def run_kitti2bag():
print('Path {} does not exists. Exiting.'.format(kitti.sequence_path))
sys.exit(1)

kitti.load_calib()
kitti.load_timestamps()
kitti._load_calib()
kitti._load_timestamps()

if len(kitti.timestamps) == 0:
print('Dataset is empty? Exiting.')
sys.exit(1)

if args.sequence in odometry_sequences[:11]:
print("Odometry dataset sequence {} has ground truth information (poses).".format(args.sequence))
kitti.load_poses()
kitti._load_poses()

try:
util = pykitti.utils.read_calib_file(os.path.join(args.dir,'sequences',args.sequence, 'calib.txt'))
Expand Down

0 comments on commit c4763d7

Please sign in to comment.