koide3 / hdl_graph_slam

3D LIDAR-based Graph SLAM
BSD 2-Clause "Simplified" License
1.93k stars 723 forks source link

bag_player.py Problem #252

Open gurselturkeri opened 1 year ago

gurselturkeri commented 1 year ago

When I run rosrun hdl_graph_slam bag_player.py sample.bag I get an error:


done
Traceback (most recent call last):
  File "/home/gursel/catkin_ws/src/hdl_graph_slam/src/hdl_graph_slam/bag_player.py", line 223, in <module>
    main()
  File "/home/gursel/catkin_ws/src/hdl_graph_slam/src/hdl_graph_slam/bag_player.py", line 220, in main
    BagPlayer(args.input_bag, args.start, args.duration)
  File "/home/gursel/catkin_ws/src/hdl_graph_slam/src/hdl_graph_slam/bag_player.py", line 41, in __init__
    self.publishers[con.topic] = rospy.Publisher(con.topic, msg_class, queue_size=256)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/topics.py", line 842, in __init__
    super(Publisher, self).__init__(name, data_class, Registration.PUB)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/topics.py", line 140, in __init__
    raise ValueError("topic parameter 'data_class' is not initialized")
ValueError: topic parameter 'data_class' is not initialized```
981213 commented 1 year ago

It seems that bag_player.py is a Python3 script and you need ROS noetic to use that.