-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
How to find devices with motion sensors (IMU)? #2899
Comments
Each RealSense model has a PID identification code. D435i's is RS435I_PID librealsense/src/ds5/ds5-private.h Line 33 in 79dda7f
|
Yes, It will be able to identify RealSense D435i. However, It is hard coding. // The example that I showed was misleading. This is what I want to do.
rs2::context;
const rs2::device_list device_list = context.query_devices( RS2_PRODUCT_LINE_ANY_INTEL | RS2_HAVE_IMU ); // return devices with imu |
This is what I want to do. However, I want to write it more easily. void query_motion_devices( std::vector<rs2::device>& motion_devices )
{
rs2::context context;
const rs2::device_list device_list = context.query_devices( RS2_PRODUCT_LINE_ANY_INTEL );
for( const rs2::device& device : device_list ){
const std::vector<rs2::sensor> sensors = device.query_sensors();
for( const rs2::sensor& sensor : sensors ){
const std::vector<rs2::stream_profile> profiles = sensor.get_stream_profiles();
for( const rs2::stream_profile& profile : profiles ){
if( profile.is<rs2::motion_stream_profile>() ){
motion_devices.push_back( device );
}
}
}
}
} |
I would imagine that the IMU component has some kind of individual recognition code so that a program can detect whether the sensor is present (like with the 'sensor-control' sample program that lists the sensor details). sensor-control iterates through the available sensors on a camera using a command called get_sensor_name. You could probably modify the terms of the search to only react positively to the name of the IMU sensor component (which would presumably be the same between different cameras using the same IMU component) and not allow the program to run if the search condition does not detect the sensor name. You could likely find out what the name of the IMU component is by running sensor-control- since it is apparently not hard-wired to look for specific pre-programmed sensor names. |
Hi @UnaNancyOwen |
This comment has been minimized.
This comment has been minimized.
@RealSense-Customer-Engineering let's not close issues market |
The capability to query the motion sensor has been addressed with #5468 |
Issue Description
Do you know how to find devices with motion sensors (IMU)?
For example case, I want to query only D435i devices.
I think it is able to do that, but it require to write a many lines code (about 10-15 lines). I want more easy way.
If there is no easy way to do that, I suggest adding a mask to
rs2::context::query_devices()
.The text was updated successfully, but these errors were encountered: