mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 11:59:17 +08:00
cm8jl65: use paramter to set sensor orientation
This commit is contained in:
committed by
Beat Küng
parent
6a0ed6af93
commit
d216b45202
@@ -42,6 +42,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
|
#include <px4_cli.h>
|
||||||
#include <px4_config.h>
|
#include <px4_config.h>
|
||||||
#include <px4_getopt.h>
|
#include <px4_getopt.h>
|
||||||
#include <px4_work_queue/ScheduledWorkItem.hpp>
|
#include <px4_work_queue/ScheduledWorkItem.hpp>
|
||||||
@@ -685,9 +686,17 @@ extern "C" __EXPORT int cm8jl65_main(int argc, char *argv[])
|
|||||||
|
|
||||||
while ((ch = px4_getopt(argc, argv, "R:d:", &myoptind, &myoptarg)) != EOF) {
|
while ((ch = px4_getopt(argc, argv, "R:d:", &myoptind, &myoptarg)) != EOF) {
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case 'R':
|
case 'R': {
|
||||||
rotation = (uint8_t)atoi(myoptarg);
|
int rot = -1;
|
||||||
|
|
||||||
|
if (px4_get_parameter_value(myoptarg, rot) != 0) {
|
||||||
|
PX4_ERR("rotation parsing failed");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
rotation = (uint8_t)rot;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case 'd':
|
case 'd':
|
||||||
device_path = myoptarg;
|
device_path = myoptarg;
|
||||||
|
|||||||
@@ -1,6 +1,27 @@
|
|||||||
module_name: Lanbao PSK-CM8JL65-CC5
|
module_name: Lanbao PSK-CM8JL65-CC5
|
||||||
serial_config:
|
serial_config:
|
||||||
- command: cm8jl65 start -d ${SERIAL_DEV}
|
- command: cm8jl65 start -d ${SERIAL_DEV} -R p:SENS_CM8JL65_R_0
|
||||||
port_config_param:
|
port_config_param:
|
||||||
name: SENS_CM8JL65_CFG
|
name: SENS_CM8JL65_CFG
|
||||||
group: Sensors
|
group: Sensors
|
||||||
|
|
||||||
|
parameters:
|
||||||
|
- group: Sensors
|
||||||
|
definitions:
|
||||||
|
SENS_CM8JL65_R_0:
|
||||||
|
description:
|
||||||
|
short: Distance Sensor Rotation
|
||||||
|
long: |
|
||||||
|
Distance Sensor Rotation as MAV_SENSOR_ORIENTATION enum
|
||||||
|
|
||||||
|
type: enum
|
||||||
|
values:
|
||||||
|
25: ROTATION_DOWNWARD_FACING
|
||||||
|
24: ROTATION_UPWARD_FACING
|
||||||
|
12: ROTATION_BACKWARD_FACING
|
||||||
|
0: ROTATION_FORWARD_FACING
|
||||||
|
6: ROTATION_LEFT_FACING
|
||||||
|
2: ROTATION_RIGHT_FACING
|
||||||
|
100: ROTATION_CUSTOM
|
||||||
|
reboot_required: true
|
||||||
|
default: 25
|
||||||
|
|||||||
Reference in New Issue
Block a user