lardemua / atlascar2

Core packages for the LAR DEMUA Atlas Project
6 stars 1 forks source link

Calibrating AtlasCar2 with VLP #32

Closed manuelgitgomes closed 2 years ago

manuelgitgomes commented 2 years ago

With the new configuration of AtlasCar2, a calibration is needed. It is also needed for me to familarize with the calibration method.

manuelgitgomes commented 2 years ago

Hello @miguelriemoliveira and @danifpdra. I have an error that I'd like your help. After adding:

<node name="interactive_pattern" pkg="mmtbot_gazebo" type="interactive_pattern" output="screen"/>

to the gazebo launch file, an error message appears:

[ERROR] [1650368616.981114039]: GetModelState: model [charuco_800x600] does not exist

However, the model does exist and is placed on the GAZEBO_MODELS_PATH as it can be placed in the gazebo itself:

image

I tried to change the interactive pattern to the launch file of the car, and it did not work. What can I do to solve this?

danifpdra commented 2 years ago

Hi @manuelgitgomes ,

Which command are you using?

Can you pull and try it now?

danifpdra commented 2 years ago

Hi @manuelgitgomes ,

It's working now but the interactive pattern must be present in the *.world file so I replaced that world for the larcc one with only the lights and the pattern.

I don't have the world that was being called, you need to add it to the folder atlascar2_gazebo/worlds/, add the interactive pattern code block that you can copy from the larcc.world and then replace here (in the gazebo.launch file) the correct name

<arg name="world_name" value="$(find atlascar2_gazebo)/worlds/larcc.world"/>

If you have any questions let me know

manuelgitgomes commented 2 years ago

Thank you, @danifpdra, I will try it!

manuelgitgomes commented 2 years ago

Hello @miguelriemoliveira! I am having problems when recording a collection. When recording a collection, this error appears:

[ERROR] [1650563879.968811, 812.634000]: bad callback: <bound method InteractiveMarkerServer.processFeedback of <interactive_markers.interactive_marker_server.InteractiveMarkerServer object at 0x7f7a99a684c0>>
Traceback (most recent call last):
  File "/opt/ros/noetic/lib/python3/dist-packages/rospy/topics.py", line 750, in _invoke_callback
    cb(msg)
  File "/opt/ros/noetic/lib/python3/dist-packages/interactive_markers/interactive_marker_server.py", line 353, in processFeedback
    feedback_cb(feedback)
  File "/opt/ros/noetic/lib/python3/dist-packages/interactive_markers/menu_handler.py", line 143, in processFeedback
    context.feedback_cb(feedback)
  File "/home/nel/catkin_ws/src/calibration/atom/atom_calibration/scripts/collect_data", line 31, in menuFeedback
    data_collector.saveCollection()
  File "/home/nel/catkin_ws/src/calibration/atom/atom_calibration/src/atom_calibration/collect/data_collector_and_labeler.py", line 315, in saveCollection
    transforms = self.getTransforms(self.abstract_transforms, average_time)  # use average time of sensor msgs
  File "/home/nel/catkin_ws/src/calibration/atom/atom_calibration/src/atom_calibration/collect/data_collector_and_labeler.py", line 260, in getTransforms
    self.listener.waitForTransform(ab['parent'], ab['child'], time, rospy.Duration(1.0))
  File "/opt/ros/noetic/lib/python3/dist-packages/tf/listener.py", line 76, in waitForTransform
    raise tf2_ros.TransformException(error_msg or "no such transformation: \"{}\" -> \"{}\"".format(source_frame, target_frame))
tf2.TransformException: Lookup would require extrapolation -10.263999999s into the future.  Requested time 822.874999999 but the latest data is at time 812.611000000, when looking up transform from frame [atlascar2/rear_wheel_link] to frame [atlascar2/base_link]

This seems to me as interference between times on the tfs. What is weird is the info message that appears before:

Save collection selected 811.196204   Duration: 29.626204 / 67.853000               
Locked all labelerse:    811.611311   Duration: 30.041311 / 67.853000               
reference_time: 811.611000000612115   Duration: 30.042115 / 67.853000               
max_time: 822.874999999
durations = [11.264, 11.162, 0.06899999999999995]
max_duration = 11.264
Times:
top_left_camera: 800.34700000014308   Duration: 30.044308 / 67.853000               
top_right_camera: 800.449000000
lidar_1: 811.542000000
[INFO] [1650563878.954139, 811.612000]: Max duration between msgs in collection is 11.195

It seems to me that information of the tf on the max_time is trying to be retrieved, while it does not exist due to this time being in the future. This is due to the assumption, in the calculation of the max_time, that the duration is always positive, which is not always the case.

https://github.com/lardemua/atom/blob/11c332d3c8b7a8f961b13e7474e5532a4cd9af24/atom_core/src/atom_core/ros_utils.py#L59-L71

I tried removing the abs from line 61 and the error disappeared, however, another one appeared:

[INFO] [1650565488.949445, 792.607000]: Max duration between msgs in collection is 7.098
Collected transforms for time 792.543000001
Collecting data from top_left_camera: sensor_key
Collecting data from top_right_camera: sensor_key
Collecting data from lidar_1: sensor_key
[ERROR] [1650565489.025599, 792.707000]: bad callback: <bound method InteractiveMarkerServer.processFeedback of <interactive_markers.interactive_marker_server.InteractiveMarkerServer object at 0x7fbfd5861130>>
Traceback (most recent call last):
  File "/opt/ros/noetic/lib/python3/dist-packages/urdf_parser_py/xml_reflection/core.py", line 494, in set_from_xml
    attribute.set_from_string(obj, value)
  File "/opt/ros/noetic/lib/python3/dist-packages/urdf_parser_py/xml_reflection/core.py", line 330, in set_from_string
    setattr(obj, self.var, self.value_type.from_string(value))
  File "/opt/ros/noetic/lib/python3/dist-packages/urdf_parser_py/xml_reflection/core.py", line 185, in from_string
    self.check(raw)
  File "/opt/ros/noetic/lib/python3/dist-packages/urdf_parser_py/xml_reflection/core.py", line 176, in check
    assert len(values) == self.count, "Invalid vector length"
AssertionError: Invalid vector length

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/ros/noetic/lib/python3/dist-packages/rospy/topics.py", line 750, in _invoke_callback
    cb(msg)
  File "/opt/ros/noetic/lib/python3/dist-packages/interactive_markers/interactive_marker_server.py", line 353, in processFeedback
    feedback_cb(feedback)
  File "/opt/ros/noetic/lib/python3/dist-packages/interactive_markers/menu_handler.py", line 143, in processFeedback
    context.feedback_cb(feedback)
  File "/home/nel/catkin_ws/src/calibration/atom/atom_calibration/scripts/collect_data", line 31, in menuFeedback
    data_collector.saveCollection()
  File "/home/nel/catkin_ws/src/calibration/atom/atom_calibration/src/atom_calibration/collect/data_collector_and_labeler.py", line 351, in saveCollection
    description = URDF.from_xml_file(description_file)
  File "/opt/ros/noetic/lib/python3/dist-packages/urdf_parser_py/xml_reflection/core.py", line 621, in from_xml_file
    return cls.from_xml_string(xml_string)
  File "/opt/ros/noetic/lib/python3/dist-packages/urdf_parser_py/xml_reflection/core.py", line 616, in from_xml_string
    return cls.from_xml(node, path)
  File "/opt/ros/noetic/lib/python3/dist-packages/urdf_parser_py/xml_reflection/core.py", line 610, in from_xml
    return cur_type.from_xml(node, path)
  File "/opt/ros/noetic/lib/python3/dist-packages/urdf_parser_py/xml_reflection/core.py", line 232, in from_xml
    obj.read_xml(node, path)
  File "/opt/ros/noetic/lib/python3/dist-packages/urdf_parser_py/xml_reflection/core.py", line 598, in read_xml
    self.XML_REFL.set_from_xml(self, node, path)
  File "/opt/ros/noetic/lib/python3/dist-packages/urdf_parser_py/xml_reflection/core.py", line 513, in set_from_xml
    element.add_from_xml(obj, child, element_path)
  File "/opt/ros/noetic/lib/python3/dist-packages/urdf_parser_py/xml_reflection/core.py", line 390, in add_from_xml
    value = self.value_type.from_xml(node, path)
  File "/opt/ros/noetic/lib/python3/dist-packages/urdf_parser_py/xml_reflection/core.py", line 232, in from_xml
    obj.read_xml(node, path)
  File "/opt/ros/noetic/lib/python3/dist-packages/urdf_parser_py/xml_reflection/core.py", line 598, in read_xml
    self.XML_REFL.set_from_xml(self, node, path)
  File "/opt/ros/noetic/lib/python3/dist-packages/urdf_parser_py/xml_reflection/core.py", line 513, in set_from_xml
    element.add_from_xml(obj, child, element_path)
  File "/opt/ros/noetic/lib/python3/dist-packages/urdf_parser_py/xml_reflection/core.py", line 390, in add_from_xml
    value = self.value_type.from_xml(node, path)
  File "/opt/ros/noetic/lib/python3/dist-packages/urdf_parser_py/xml_reflection/core.py", line 232, in from_xml
    obj.read_xml(node, path)
  File "/opt/ros/noetic/lib/python3/dist-packages/urdf_parser_py/xml_reflection/core.py", line 598, in read_xml
    self.XML_REFL.set_from_xml(self, node, path)
  File "/opt/ros/noetic/lib/python3/dist-packages/urdf_parser_py/xml_reflection/core.py", line 516, in set_from_xml
    element.set_from_xml(obj, child, element_path)
  File "/opt/ros/noetic/lib/python3/dist-packages/urdf_parser_py/xml_reflection/core.py", line 360, in set_from_xml
    value = self.value_type.from_xml(node, path)
  File "/opt/ros/noetic/lib/python3/dist-packages/urdf_parser_py/xml_reflection/core.py", line 232, in from_xml
    obj.read_xml(node, path)
  File "/opt/ros/noetic/lib/python3/dist-packages/urdf_parser_py/xml_reflection/core.py", line 598, in read_xml
    self.XML_REFL.set_from_xml(self, node, path)
  File "/opt/ros/noetic/lib/python3/dist-packages/urdf_parser_py/xml_reflection/core.py", line 501, in set_from_xml
    raise ParseError(e, attr_path)
urdf_parser_py.xml_reflection.core.ParseError: ParseError in /robot[@name='atlascar2']/link[@name='base_link']/visual[1]/origin[@xyz]:
Invalid vector length

This error I have no idea what is causing this.

Can you help me?

miguelriemoliveira commented 2 years ago

Can you please share your bag, or a small 1 min portion of it?

manuelgitgomes commented 2 years ago

Sure! https://uapt33090-my.sharepoint.com/:u:/g/personal/manuelgomes_ua_pt/EXeIt_g78tRKs9b4m-FCzncBQ7nHnvf4KYCrocctxBLmfw?e=4D4oeD

miguelriemoliveira commented 2 years ago

Hi @manuelgitgomes ,

I think this could be derived from the other issue about the configuration of the calibration package (which I cannot find right now).

Let's solve it first then go back to this one ok?

manuelgitgomes commented 2 years ago

Ok sure, it's issue lardemua/atom#425!