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

ROS2 Lidar wrong tick source #810

Open
ceccocats opened this issue Dec 23, 2024 · 3 comments
Open

ROS2 Lidar wrong tick source #810

ceccocats opened this issue Dec 23, 2024 · 3 comments
Assignees
Labels
feature/robotics This item is related to robotics. kind/bug Categorizes issue or PR as related to a bug. priority/major Major priority. Work that should be handled after all blocking and critical work is done. sig/simulation Categorizes an issue or PR as relevant to SIG Simulation

Comments

@ceccocats
Copy link

The Ros2 lidar sensor is using TickBasedSource wich is not precise.
Since the lidar only relies on physics it should use PhysicsBasedSource wich permits to publish at a precise frequency.

Results with TickBasedSource

    class ROS2Lidar2DSensorComponent : public ROS2SensorComponentBase<TickBasedSource>
ceccocats@aron:~$ ros2 topic hz /scan -w 10
average rate: 9.123
	min: 0.075s max: 0.121s std dev: 0.01262s window: 10
average rate: 10.161
	min: 0.021s max: 0.116s std dev: 0.02784s window: 10
average rate: 8.629
	min: 0.103s max: 0.130s std dev: 0.00799s window: 10
average rate: 8.747
	min: 0.105s max: 0.128s std dev: 0.00662s window: 10

Results with PhysicsBasedSource

    class ROS2Lidar2DSensorComponent : public ROS2SensorComponentBase<PhysicsBasedSource>
ceccocats@aron:~$ ros2 topic hz /scan -w 10
average rate: 10.000
	min: 0.099s max: 0.101s std dev: 0.00054s window: 10
average rate: 10.009
	min: 0.099s max: 0.100s std dev: 0.00038s window: 10
average rate: 9.999
	min: 0.100s max: 0.100s std dev: 0.00007s window: 10
average rate: 9.999
	min: 0.100s max: 0.100s std dev: 0.00012s window: 10

Im using main branch but i have checked also dev branch and it seems to also use TickBasedSource.

class ROS2Lidar2DSensorComponent : public ROS2SensorComponentBase<TickBasedSource>

@ceccocats ceccocats added kind/bug Categorizes issue or PR as related to a bug. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Dec 23, 2024
@jhanca-robotecai
Copy link
Contributor

Thank you for rising the issue and for checking both branches.

We are aware of some problems with the timing of the sensors, please see this PR: #807
I will assign the author of the PR above to this task as related, so he can joint the conversation

@jhanca-robotecai jhanca-robotecai added sig/simulation Categorizes an issue or PR as relevant to SIG Simulation and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Dec 27, 2024
@michalpelka
Copy link
Contributor

michalpelka commented Dec 30, 2024

Hello @ceccocats , PR #807 will partially resolve this issue.
With physics ticks triggering and physics ticks running clock would be no deviation caused by GPU frame time.
Hover both implementation (RGL and scene queries) uses AZFramework API. This API provides us with data that is updated with GPU.
It can give results that is exactly the same (especially when we require Lidar simulation with high frequency)

I will open PR set @ceccocats as co-athor (it will be one line):

    class ROS2Lidar2DSensorComponent : public ROS2SensorComponentBase<PhysicsBasedSource>

and add all parties (O3DE side and RGL side) to review.

@adamdbrw adamdbrw added priority/major Major priority. Work that should be handled after all blocking and critical work is done. feature/robotics This item is related to robotics. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Dec 30, 2024
@ceccocats
Copy link
Author

ceccocats commented Dec 31, 2024

Lidar2d is not the only that use TickBasedSource, here is a list:

  • ROS2GNSSSensorComponent
  • ROS2LidarSensorComponent
  • ROS2Lidar2DSensorComponent (tested and working)
  • ROS2ContactSensorComponent
  • ROS2CameraSensorComponent (is it possible or it needs to run at rendering frequency?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/robotics This item is related to robotics. kind/bug Categorizes issue or PR as related to a bug. priority/major Major priority. Work that should be handled after all blocking and critical work is done. sig/simulation Categorizes an issue or PR as relevant to SIG Simulation
Projects
None yet
Development

No branches or pull requests

4 participants