Skip to content
Snippets Groups Projects
Commit 47c88940 authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Added a new parameter to select the operational mode of the sensor.

parent 089d0fd9
No related branches found
No related tags found
1 merge request!1Kinetic migration
...@@ -38,12 +38,28 @@ from dynamic_reconfigure.parameter_generator_catkin import * ...@@ -38,12 +38,28 @@ from dynamic_reconfigure.parameter_generator_catkin import *
gen = ParameterGenerator() gen = ParameterGenerator()
enum_operation_mode = gen.enum([
gen.const("accel_only", int_t, 1, "Only enable the accelerometer"),
gen.const("mag_only", int_t, 2, "Only enable the magnetometer"),
gen.const("gyro_only", int_t, 3, "Only enable the gyroscope"),
gen.const("accel_mag", int_t, 4, "Enable both accelerometer and magnetometer"),
gen.const("accel_gyro", int_t, 5, "Enable both accelerometer and gyroscope"),
gen.const("mag_gyro", int_t, 6, "Enable both magnetometer and gyroscope"),
gen.const("accel_mag_gyro", int_t, 7, "Enable all sensors"),
gen.const("imu", int_t, 8, "IMU"),
gen.const("compass", int_t, 9, "Compass"),
gen.const("m4g", int_t, 10, "M4G"),
gen.const("ndof_off", int_t, 11, "ndof off"),
gen.const("ndof", int_t, 12, "ndof")
], "Possible operation modes.")
# Name Type Reconfiguration level Description Default Min Max # Name Type Reconfiguration level Description Default Min Max
gen.add("update_rate", double_t, SensorLevels.RECONFIGURE_STOP, "Data update rate in Hz", 20.0, 1.0, 100.0) gen.add("update_rate", double_t, SensorLevels.RECONFIGURE_CLOSE, "Data update rate in Hz", 20.0, 1.0, 100.0)
gen.add("serial_device", str_t, SensorLevels.RECONFIGURE_STOP, "Device serial port", "/dev/ttyUSB0") gen.add("serial_device", str_t, SensorLevels.RECONFIGURE_CLOSE, "Device serial port", "/dev/ttyUSB1")
gen.add("cal_filename", str_t, SensorLevels.RECONFIGURE_STOP, "Sensor calibration data", "") gen.add("cal_filename", str_t, SensorLevels.RECONFIGURE_STOP, "Sensor calibration data", "")
gen.add("tf_prefix", str_t, SensorLevels.RECONFIGURE_STOP, "TF prefix", "") gen.add("tf_prefix", str_t, SensorLevels.RECONFIGURE_STOP, "TF prefix", "")
gen.add("frame_id", str_t, SensorLevels.RECONFIGURE_STOP, "IMU frame_id in the urdf file", "") gen.add("frame_id", str_t, SensorLevels.RECONFIGURE_STOP, "IMU frame_id in the urdf file", "")
gen.add("mode", int_t, SensorLevels.RECONFIGURE_CLOSE, "Operation mode", 12, 1, 12, edit_method=enum_operation_mode)
#gen.add("velocity_scale_factor", double_t, SensorLevels.RECONFIGURE_STOP, "Maximum velocity scale factor", 0.5, 0.0, 1.0) #gen.add("velocity_scale_factor", double_t, SensorLevels.RECONFIGURE_STOP, "Maximum velocity scale factor", 0.5, 0.0, 1.0)
exit(gen.generate(PACKAGE, "Bno055ImuDriver", "Bno055Imu")) exit(gen.generate(PACKAGE, "Bno055ImuDriver", "Bno055Imu"))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment