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

Incorrect /tf of stationary lidars in synchronous mode #639

Open
u-sj opened this issue Sep 19, 2022 · 6 comments · May be fixed by #571
Open

Incorrect /tf of stationary lidars in synchronous mode #639

u-sj opened this issue Sep 19, 2022 · 6 comments · May be fixed by #571

Comments

@u-sj
Copy link

u-sj commented Sep 19, 2022

Using

  • Carla version 0.9.13.
  • Ros bridge e9063d9
  • Ubuntu 18.04
  • ROS melodic

This issue is similar to issues that claim to be fixed

I am running the bridge in synchronous mode (default settings).
Using carla_spawn_objects with the following .json to spawn in stationary lidars:

{   
    "objects": 
    [
        {
            "type": "sensor.pseudo.objects",
            "id": "objects"
        },
        {
            "type": "sensor.pseudo.actor_list",
            "id": "actor_list"
        },
        {
            "type": "sensor.lidar.ray_cast",
            "id": "lidar0",
            "spawn_point": {"x": 1.0, "y": 2.0, "z": 3.0, "roll": 4.0, "pitch": 5.0, "yaw": 6.0},
            "range": 75,
            "channels": 64,
            "points_per_second": 10000,
            "upper_fov": 22.5,
            "lower_fov": -22.5,
            "rotation_frequency": 10,
            "noise_stddev": 0.1
        },
        {
            "type": "sensor.lidar.ray_cast",
            "id": "lidar1",
            "spawn_point": {"x": -1.0, "y": -2.0, "z": -3.0, "roll": -4.0, "pitch": -5.0, "yaw": -6.0},
            "range": 75,
            "channels": 64,
            "points_per_second": 10000,
            "upper_fov": 22.5,
            "lower_fov": -22.5,
            "rotation_frequency": 10,
            "noise_stddev": 0.1
        }
    ]
}

Expected behaviour

The /tf topic gives the same transforms as defined in the .json

Actual results

Transformations in /tf are all zeros. Sometimes the first lidar is correct. It appears that overall load of the simulation is a factor as high values in points_per_second reduces the amount of correct transforms.

Example output of rostopic echo /tf:

transforms: 
  - 
    header: 
      seq: 0
      stamp: 
        secs: 349
        nsecs: 220444330
      frame_id: "map"
    child_frame_id: "lidar0"
    transform: 
      translation: 
        x: 1.0
        y: 2.0
        z: 3.0
      rotation: 
        x: 0.0325370449297
        y: 0.0453578232483
        z: 0.0507341253023
        w: 0.997150970068
---
transforms: 
  - 
    header: 
      seq: 0
      stamp: 
        secs: 349
        nsecs: 220444330
      frame_id: "map"
    child_frame_id: "lidar1"
    transform: 
      translation: 
        x: 0.0
        y: -0.0
        z: 0.0
      rotation: 
        x: 0.0
        y: -0.0
        z: 0.0
        w: 1.0
---
@u-sj
Copy link
Author

u-sj commented Sep 19, 2022

Currently it appears that there is a race condition somewhere as I have observed cases with 2+ sensors where more than one sensor has the correct transformation.

The incorrect transformation is placed into the ros message at line 114 in sensor.py.
The value of self.relative_spawn_pose appears to be 0 for sensors without parents when it should be relative to the map.

@u-sj u-sj closed this as completed Sep 19, 2022
@u-sj u-sj reopened this Sep 19, 2022
@berndgassmann
Copy link
Contributor

Hi,
I also observe the same issue again with using a larger map. Therefore, I tried with the other proposed solution of the initial problem again. Just updated that branch with the latest master changes:
https://github.com/carla-simulator/ros-bridge/tree/sync_carla_actor_creation

Can you try if this one solves your problem?

Be aware that in the original PR #571 Joel mentioned that in respect to this solution and the leaderboard.
"...For instance, for the integration of the ROS-bridge with the leadeboard this will require doing extra ticks during the initialization of the stack...."

So I don't know if this works in conjunction with leaderboard setup.

@u-sj
Copy link
Author

u-sj commented Dec 19, 2022

Tested with a json that has multiple stationary lidars. On the master branch I observed same broken behavior. Switching to the other branch made the issue disappear.

I don't know anything about the leaderboard, so cannot comment on that.

@berndgassmann
Copy link
Contributor

Ok, thanks. So I just reopened the PR #571.

@berndgassmann berndgassmann linked a pull request Dec 19, 2022 that will close this issue
@qzhq747
Copy link

qzhq747 commented Aug 28, 2024

Hi, I also observe the same issue again with using a larger map. Therefore, I tried with the other proposed solution of the initial problem again. Just updated that branch with the latest master changes: https://github.com/carla-simulator/ros-bridge/tree/sync_carla_actor_creation

Can you try if this one solves your problem?

Be aware that in the original PR #571 Joel mentioned that in respect to this solution and the leaderboard. "...For instance, for the integration of the ROS-bridge with the leadeboard this will require doing extra ticks during the initialization of the stack...."

So I don't know if this works in conjunction with leaderboard setup.

I face the same problem. While switching to the branch https://github.com/carla-simulator/ros-bridge/pull/571, the issue is solved. It solve my questions.

@berndgassmann
Copy link
Contributor

Hi,
in case you still encounter problems with the ROS-bridge, one alternative might be that you could try the native CARLA ROS2 support (in case you are using ROS2 ;-).
Then you might need only the tools of this repo, because the bridge isn't existing anymore see PR #728.
At least all tools that I use within our project are working fine.
Drawback: you have to compile the carla development branch on your own...

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

Successfully merging a pull request may close this issue.

3 participants