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

std::bad_alloc when running multiple cloud nodelets under a single nodelet manager #155

Closed
stephen-derosa opened this issue Jun 27, 2023 · 1 comment · Fixed by #170
Closed
Assignees
Labels
bug Something isn't working

Comments

@stephen-derosa
Copy link

Describe the bug
When attempting to run multiple cloud nodelets under a single nodelet manager std::bad_alloc is thrown.

To Reproduce
Steps to reproduce the behavior (steps below are just an example):

  1. Do not run a nodelet manager inside the ouster-ros/launch/common.launch or ouster-ros/launch/sensor.launch. Instead, run it a level above in say my_ouster_sensor.launch
  2. Pass in the nodelet manager name to both ouster-ros/launch/common.launch and ouster-ros/launch/sensor.launch (or hard code it). NOTE: the nodelet manager name must be in the root NS, i.e. /od_nodelet_mgr
  3. compile the project workspace
  4. source the project workspace
  5. roslaunch ouster_ros my_ouster_sensor.launch
  6. It may not happen immediately but after a few seconds. observe the issue ...
    NOTE: this was only seen when more than 2 lidars were running under the same nodelet manager. 2 lidars worked fine.

Platform (please complete the following information):
Sensor:

  • 3 OS0 128 beams
  • 3 OS1 128 beams
  • Ouster Firmware Version? [e.g. 2.3, 2.4, ..]
  • ROS noetic
  • Operating System: Linux
  • Machine Architecture: x64
  • git commit hash: latest

Potential Cause
I believe that the issue here is the use of static in the clouds nodelet code where each instance will step on each other. I have modified the code here to remove static as well as modified line 302 to be:

        if (frame_ts.isZero())
        {
            frame_ts = extrapolate_frame_ts(packet_buf, packet_receive_time);  // first point cloud time
        }

where frame_ts is a member variable defined as ros::Time frame_ts;. These changes have resolved the issue I was seeing.

@stephen-derosa stephen-derosa added the bug Something isn't working label Jun 27, 2023
@Samahu Samahu self-assigned this Jun 28, 2023
@Samahu
Copy link
Contributor

Samahu commented Jun 28, 2023

@stephen-derosa thanks for reaching to us. This is the same issue reported in #104 which was addressed for ROS2. Your analysis is right it is the due to use of static variable which makes it not possible to run nodelets of the same type under the same nodelet manager. I have an upcoming PR for ROS1 that should address the problem soon. I will keep you updated.

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
2 participants