Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Other issue]: Invalid Data in /fleet_states Topic for Real Robot with use_sim_time Set to False #551

Open
1 task done
osama-z-salah opened this issue Oct 28, 2024 · 3 comments

Comments

@osama-z-salah
Copy link

osama-z-salah commented Oct 28, 2024

Before proceeding, is there an existing issue or discussion for this?

Description

I am using a real robot (nano500xw02) with use_sim_time set to false, and I am experiencing an issue with the values published in the /fleet_states topic. When I monitor the topic using ros2 topic echo /fleet_states, the values appear unrealistic, specifically:

Battery Percentage: 1.401298464324817e-45
Location (x, y, yaw):
x: 7.507128761641381e+23
y: 0.00036577426362782717
yaw: 7.976202964782715
Here is a sample output from the /fleet_states topic:

nanofleet@nanofleet:~/nrmf_ws$ ros2 topic echo /fleet_states 
name: Robot500xw
robots:
- name: nano500xw02
  model: Robot500xw
  task_id: compose.dispatch-106
  seq: 0
  mode:
    mode: 0
    mode_request_id: 0
  battery_percent: 1.401298464324817e-45
  location:
    t:
      sec: 0
      nanosec: 1105939276
    x: 7.507128761641381e+23
    y: 0.00036577426362782717
    yaw: 7.976202964782715
    obey_approach_speed_limit: true
    approach_speed_limit: -1.5556764602661133
    level_name: ''
    index: 54202487275523
  path: []

API Endpoint Data: Interestingly, when I query the data using the RMF API fleet endpoint, I receive correct and realistic values for the same robot:

[
  {
    "name": "Robot500xw",
    "robots": {
      "nano500xw02": {
        "name": "nano500xw02",
        "status": "working",
        "task_id": "Chargeb459d6",
        "unix_millis_time": 1730083331990,
        "location": {
          "map": "L1",
          "x": 9.743598937988281,
          "y": -5.146598815917969,
          "yaw": 1.56088125705719
        },
        "battery": 0.2906574462890625,
        "issues": [],
        "commission": {
          "dispatch_tasks": true,
          "direct_tasks": true,
          "idle_behavior": true
        },
        "mutex_groups": {
          "locked": [],
          "requesting": []
        }
      }
    }
  }
]
@luca-della-vedova
Copy link
Member

If you run an instance of rviz do the robots show in the correct location?

It might be a long shot but from personal experience I had such issues when the terminal / machine where the fleet adapter is running and the machine where I'm running ros2 topic echo have different version of the message files.
This can cause ABI incompatibility (basically misaligned data) that causes the ros2 topic echo machine to receive corrupted data.

Can you confirm that :

  • Both commands are being ran on the same machine and / or
  • They are using the same Open-RMF version, ROS 2 version

@osama-z-salah
Copy link
Author

Yes, they are running on the same machine. In RViz, the robots appear in the correct locations. However, the version of RMF I built is different from my ROS 2 version. I built the jazzy version of RMF from source, but my installed ROS 2 version is Humble, since the RMF in Humble is missing a lot of features.

@luca-della-vedova
Copy link
Member

What I would recommend here is to make sure that you do not have any RMF related Humble packages installed, as well as making sure you source the same setup.bash files in both the terminal that you use to run RMF and the one you use to echo the topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants