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

Reduced point cloud frequency with ROS2 driver vs plain C++ client #378

Closed
themightyoarfish opened this issue Oct 2, 2024 · 8 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@themightyoarfish
Copy link

Describe the bug
ROS2 driver does not achieve desired frequency. In lidar mode 1024x20 for instance, I am getting about 15hz, the proportion is similar in other modes (e.g. 7 hz for 1024x10). Setting rx buffer size and kernel buffer sizes appears to have no effect on this.
Neither does changing the point type (e.g. xyz).
Sometimes I see A message was lost!!! in the output of ros2 topic echo.

Meanwhile a custom C++ client based on the ouster-sdk on the same laptop and the same ethernet adapter achieves the desired frame rate with no problem, so it's not a networking issue.

What steps can I take to improve this? Is there documentation?

Platform (please complete the following information):

  • Ouster Sensor? OS1-128 rev7
  • Ouster Firmware Version? v3.0.1
  • ROS version/distro? humble
  • Operating System? ubuntu mate 22.04
  • Machine Architecture? x64
  • git commit hash (if not the latest): 5dd8555
@themightyoarfish themightyoarfish added the bug Something isn't working label Oct 2, 2024
@themightyoarfish
Copy link
Author

I can answer this myself more or less. I read somewhere the suggestion to use the Cyclone middleware, so I ran

sudo apt -y install ros-humble-rmw-cyclonedds-cpp

Then made sure to quit my shell session, and run export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp before opening a new tmux session and sourcing the ROS environment. That made the frequency shoot up to 20hz immediately.

Could some troubleshooting FAQ be added on this?

@Samahu
Copy link
Contributor

Samahu commented Oct 2, 2024

Yeah generally I recommend using CycloneDDS against the ROS2 driver. I want to add a note to our main README.md since this comes very often. At the same time I still have some optimization that I want to implement to improve the performance for FastDDS.

@Samahu
Copy link
Contributor

Samahu commented Oct 3, 2024

added a comment to the ROS2/README.md about CycloneDDS recommendation per #380

@Samahu Samahu closed this as completed Oct 3, 2024
@themightyoarfish
Copy link
Author

I retested right now with the cyclone middleware, and I'm still not getting full frequency, I'm guessing I made other changes to speed it up. That, or my firmware upgrade changed the device's behaviour.
Is there any recommendation on kernel receive buffer sizes or other settings one should apply on a connected system?

@themightyoarfish
Copy link
Author

Can confirm. I made these two changes which bumped the frequency up. Not sure which of these was needed:

# kernel receive buffer size
sudo sysctl -w net.core.rmem_max=16777216
sudo sysctl -w net.core.rmem_default=16777216

# hardware ring buffer size (?)
sudo ethtool -G enx00e04ca0ba32 rx 2048 

@Samahu
Copy link
Contributor

Samahu commented Oct 11, 2024

yeah that's the recommendation per https://community.ouster.com/t/increase-receive-buffer-to-eliminate-packet-drop-problem-on-some-windows-computers/84/3 besides using CycloneDDS for ROS2

@themightyoarfish
Copy link
Author

themightyoarfish commented Oct 11, 2024 via email

@Samahu
Copy link
Contributor

Samahu commented Oct 11, 2024

totally, I actually want to include a bash script as part of the driver that users can invoke to configure the system properly for them, since this is rather a recurring issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants