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

multianalogsensorserver segsfault if subdevice is set to realsense2withIMU #35

Open
GiulioRomualdi opened this issue Jan 23, 2023 · 1 comment

Comments

@GiulioRomualdi
Copy link
Member

I tried to run the realsense2withIMU by means of the multianalogsensorserver this should allow me to read the gyro and the accelerometer provided by the realsense D435i.

I have the following configuration file stored in sensors/RealSense_conf.ini

device       multipleanalogsensorsserver
subdevice    realsense2withIMU
name         /depthCamera
period       10

[SETTINGS]
depthResolution (640 480)
rgbResolution   (640 480)
framerate       30
enableEmitter   true
alignmentFrame  RGB

[HW_DESCRIPTION]
clipPlanes (0.2 10.0)

Then I run the device as

yarpdev --from sensors/RealSense_conf.ini

I got the following

arpdev --from sensors/RealSense_conf.ini
[DEBUG] |yarp.dev.PolyDriver|multipleanalogsensorsserver| Parameters are (HW_DESCRIPTION (clipPlanes (0.200000000000000011102 10.0))) (SETTINGS (depthResolution (640 480)) (rgbResolution (640 480)) (framerate 30) (enableEmitter true) (alignmentFrame RGB)) (device multipleanalogsensorsserver) (from "sensors/RealSense_conf.ini") (name "/depthCamera") (period 10) (single_threaded 1) (subdevice realsense2withIMU)
[DEBUG] |yarp.dev.PolyDriver|realsense2withIMU| Parameters are (HW_DESCRIPTION (clipPlanes (0.200000000000000011102 10.0))) (SETTINGS (depthResolution (640 480)) (rgbResolution (640 480)) (framerate 30) (enableEmitter true) (alignmentFrame RGB)) (device realsense2withIMU) (from "sensors/RealSense_conf.ini") (name "/depthCamera") (period 10) (single_threaded 1) (subdevice realsense2withIMU)
[WARNING] |yarp.device.realsense2withIMU| This software module is experimental.
[WARNING] |yarp.device.realsense2withIMU| It is provided with uncomplete documentation and it may be modified/renamed/removed without any notice.
[INFO] |yarp.device.realsense2| Sensor warm-up...
[INFO] |yarp.device.realsense2| Device ready!
[INFO] |yarp.device.realsense2| Device consists of 3 sensors. More infos using --verbose option
[INFO] |yarp.dev.PolyDriver|realsense2withIMU| Created device <realsense2withIMU>. See C++ class realsense2withIMUDriver for documentation.
[INFO] |yarp.os.Port|/depthCamera/measures:o| Port /depthCamera/measures:o active at tcp://10.240.9.195:10009/
[INFO] |yarp.os.Port|/depthCamera/rpc:o| Port /depthCamera/rpc:o active at tcp://10.240.9.195:10010/
[INFO] |yarp.device.multipleanalogsensorsserver| Subdevice "realsense2withIMU" successfully configured and attached.
[INFO] |yarp.dev.PolyDriver|multipleanalogsensorsserver| Created wrapper <multipleanalogsensorsserver>. See C++ class MultipleAnalogSensorsServer for documentation.
[DEBUG] |yarp.dev.Drivers|multipleanalogsensorsserver| ===============================================================
[DEBUG] |yarp.dev.Drivers|multipleanalogsensorsserver| == Options checked by device:
[DEBUG] |yarp.dev.Drivers|multipleanalogsensorsserver| ==
[DEBUG] |yarp.dev.Drivers|multipleanalogsensorsserver| device=multipleanalogsensorsserver
[DEBUG] |yarp.dev.Drivers|multipleanalogsensorsserver| id [multipleanalogsensorsserver]
[DEBUG] |yarp.dev.Drivers|multipleanalogsensorsserver|     Id assigned to this device
[DEBUG] |yarp.dev.Drivers|multipleanalogsensorsserver| ==
[DEBUG] |yarp.dev.Drivers|multipleanalogsensorsserver| ===============================================================
[INFO] |yarp.os.Port|/depthCamera/quit| Port /depthCamera/quit active at tcp://10.240.9.195:10008/
[INFO] |yarp.dev.Drivers|multipleanalogsensorsserver| device active in background...
Segmentation fault (core dumped)

I debug the code using gdb and I notice that the code crashes at this line

float3 theta = m_rotation_estimator->get_theta();

Indeed the pointer is not allocated

realsense2withIMUDriver::realsense2withIMUDriver() :
realsense2Driver()
{
m_rotation_estimator=nullptr;
}

I will provide a PR to fixes the issue cc @traversaro

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