You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2024/10/09 12:17:34 UTC

(nuttx-apps) branch releases/12.7 updated (f86baa76f -> 729e1cad6)

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a change to branch releases/12.7
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


    from f86baa76f net: Remove IFF_DOWN flag to compatible with Linux/*BSD
     new 9ca75e297 uORB: Add topic information acquisition and setting interface.
     new 729e1cad6 uorb:Added 6dof motion and gesture related types. For details,see: https://developer.android.com/reference/android/hardware/SensorEvent#values

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 system/uorb/sensor/accel.c                    |  3 +++
 system/uorb/sensor/accel.h                    |  2 ++
 system/uorb/sensor/{gas.c => angle.c}         |  9 ++++----
 system/uorb/sensor/{co2.h => angle.h}         |  8 +++----
 system/uorb/sensor/gesture.c                  | 24 +++++++++++++++----
 system/uorb/sensor/gesture.h                  |  8 +++++++
 system/uorb/sensor/{gesture.c => motion.c}    | 17 ++++++++------
 system/uorb/sensor/{cap.h => motion.h}        | 12 ++++++----
 system/uorb/sensor/{cap.c => pose_6dof.c}     | 13 ++++++-----
 system/uorb/sensor/{co2.h => pose_6dof.h}     |  8 +++----
 system/uorb/sensor/{accel.c => rotation.c}    | 18 +++++++++------
 system/uorb/sensor/{accel.h => rotation.h}    | 11 +++++----
 system/uorb/sensor/{hall.c => step_counter.c} | 11 +++++----
 system/uorb/sensor/{co2.h => step_counter.h}  |  8 +++----
 system/uorb/sensor/topics.c                   | 26 +++++++++++++++++++++
 system/uorb/uORB/uORB.c                       | 12 +++++++++-
 system/uorb/uORB/uORB.h                       | 33 +++++++++++++++++++++++++++
 17 files changed, 166 insertions(+), 57 deletions(-)
 copy system/uorb/sensor/{gas.c => angle.c} (87%)
 copy system/uorb/sensor/{co2.h => angle.h} (90%)
 copy system/uorb/sensor/{gesture.c => motion.c} (75%)
 copy system/uorb/sensor/{cap.h => motion.h} (81%)
 copy system/uorb/sensor/{cap.c => pose_6dof.c} (81%)
 copy system/uorb/sensor/{co2.h => pose_6dof.h} (89%)
 copy system/uorb/sensor/{accel.c => rotation.c} (74%)
 copy system/uorb/sensor/{accel.h => rotation.h} (85%)
 copy system/uorb/sensor/{hall.c => step_counter.c} (84%)
 copy system/uorb/sensor/{co2.h => step_counter.h} (88%)


(nuttx-apps) 02/02: uorb:Added 6dof motion and gesture related types. For details,see: https://developer.android.com/reference/android/hardware/SensorEvent#values

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch releases/12.7
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit 729e1cad6e853d5103b33d352ec555ea2875ad21
Author: likun17 <li...@xiaomi.com>
AuthorDate: Mon Aug 5 11:51:53 2024 +0800

    uorb:Added 6dof motion and gesture related types. For details,see: https://developer.android.com/reference/android/hardware/SensorEvent#values
    
    Signed-off-by: likun17 <li...@xiaomi.com>
---
 system/uorb/sensor/accel.c                     |  3 +++
 system/uorb/sensor/accel.h                     |  2 ++
 system/uorb/sensor/{accel.c => angle.c}        | 11 ++++-------
 system/uorb/sensor/{accel.h => angle.h}        |  9 ++++-----
 system/uorb/sensor/gesture.c                   | 24 +++++++++++++++++++-----
 system/uorb/sensor/gesture.h                   |  8 ++++++++
 system/uorb/sensor/{gesture.c => motion.c}     | 17 ++++++++++-------
 system/uorb/sensor/{accel.h => motion.h}       | 13 ++++++++-----
 system/uorb/sensor/{accel.c => pose_6dof.c}    | 14 +++++++-------
 system/uorb/sensor/{accel.h => pose_6dof.h}    |  9 ++++-----
 system/uorb/sensor/{accel.c => rotation.c}     | 18 +++++++++++-------
 system/uorb/sensor/{accel.h => rotation.h}     | 11 ++++++-----
 system/uorb/sensor/{accel.c => step_counter.c} | 13 ++++++-------
 system/uorb/sensor/{accel.h => step_counter.h} |  9 ++++-----
 system/uorb/sensor/topics.c                    | 26 ++++++++++++++++++++++++++
 15 files changed, 122 insertions(+), 65 deletions(-)

diff --git a/system/uorb/sensor/accel.c b/system/uorb/sensor/accel.c
index be39b55af..6e3d31391 100644
--- a/system/uorb/sensor/accel.c
+++ b/system/uorb/sensor/accel.c
@@ -40,3 +40,6 @@ static const char sensor_accel_format[] =
 
 ORB_DEFINE(sensor_accel, struct sensor_accel, sensor_accel_format);
 ORB_DEFINE(sensor_accel_uncal, struct sensor_accel, sensor_accel_format);
+ORB_DEFINE(sensor_linear_accel, struct sensor_accel, sensor_accel_format);
+ORB_DEFINE(sensor_linear_accel_uncal, struct sensor_accel,
+           sensor_accel_format);
diff --git a/system/uorb/sensor/accel.h b/system/uorb/sensor/accel.h
index 43d22af48..d4ac1c4bb 100644
--- a/system/uorb/sensor/accel.h
+++ b/system/uorb/sensor/accel.h
@@ -35,5 +35,7 @@
 
 ORB_DECLARE(sensor_accel);
 ORB_DECLARE(sensor_accel_uncal);
+ORB_DECLARE(sensor_linear_accel);
+ORB_DECLARE(sensor_linear_accel_uncal);
 
 #endif
diff --git a/system/uorb/sensor/accel.c b/system/uorb/sensor/angle.c
similarity index 83%
copy from system/uorb/sensor/accel.c
copy to system/uorb/sensor/angle.c
index be39b55af..03cd5aff6 100644
--- a/system/uorb/sensor/accel.c
+++ b/system/uorb/sensor/angle.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * apps/system/uorb/sensor/accel.c
+ * apps/system/uorb/sensor/angle.c
  *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -22,21 +22,18 @@
  * Included Files
  ****************************************************************************/
 
-#include <sensor/accel.h>
+#include <sensor/angle.h>
 
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
 
 #ifdef CONFIG_DEBUG_UORB
-static const char sensor_accel_format[] =
-  "timestamp:%" PRIu64 ",x:%hf,y:%hf,z:%hf,temperature:%hf";
-
+static const char sensor_angle_format[] = "timestamp:%" PRIu64 ",angle:%hf";
 #endif
 
 /****************************************************************************
  * Public Data
  ****************************************************************************/
 
-ORB_DEFINE(sensor_accel, struct sensor_accel, sensor_accel_format);
-ORB_DEFINE(sensor_accel_uncal, struct sensor_accel, sensor_accel_format);
+ORB_DEFINE(sensor_hinge_angle, struct sensor_angle, sensor_angle_format);
diff --git a/system/uorb/sensor/accel.h b/system/uorb/sensor/angle.h
similarity index 88%
copy from system/uorb/sensor/accel.h
copy to system/uorb/sensor/angle.h
index 43d22af48..cc7fd65fb 100644
--- a/system/uorb/sensor/accel.h
+++ b/system/uorb/sensor/angle.h
@@ -1,5 +1,5 @@
 /****************************************************************************
- * apps/system/uorb/sensor/accel.h
+ * apps/system/uorb/sensor/angle.h
  *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -18,8 +18,8 @@
  *
  ****************************************************************************/
 
-#ifndef __APPS_SYSTEM_UORB_SENSOR_ACCEL_H
-#define __APPS_SYSTEM_UORB_SENSOR_ACCEL_H
+#ifndef __APPS_SYSTEM_UORB_SENSOR_ANGLE_H
+#define __APPS_SYSTEM_UORB_SENSOR_ANGLE_H
 
 /****************************************************************************
  * Included Files
@@ -33,7 +33,6 @@
 
 /* register this as object request broker structure */
 
-ORB_DECLARE(sensor_accel);
-ORB_DECLARE(sensor_accel_uncal);
+ORB_DECLARE(sensor_hinge_angle);
 
 #endif
diff --git a/system/uorb/sensor/gesture.c b/system/uorb/sensor/gesture.c
index f19a40a4b..5d50d42e1 100644
--- a/system/uorb/sensor/gesture.c
+++ b/system/uorb/sensor/gesture.c
@@ -29,7 +29,7 @@
  ****************************************************************************/
 
 #ifdef CONFIG_DEBUG_UORB
-static const char sensor_wake_gesture_format[] =
+static const char sensor_gesture_format[] =
   "timestamp:%" PRIu64 ",event:%" PRIu32 "";
 #endif
 
@@ -37,7 +37,21 @@ static const char sensor_wake_gesture_format[] =
  * Public Data
  ****************************************************************************/
 
-ORB_DEFINE(sensor_wake_gesture, struct sensor_wake_gesture,
-           sensor_wake_gesture_format);
-ORB_DEFINE(sensor_wake_gesture_uncal, struct sensor_wake_gesture,
-           sensor_wake_gesture_format);
+ORB_DEFINE(sensor_glance_gesture, struct sensor_event,
+           sensor_gesture_format);
+ORB_DEFINE(sensor_glance_gesture_uncal, struct sensor_event,
+           sensor_gesture_format);
+ORB_DEFINE(sensor_offbody_detector, struct sensor_event,
+           sensor_gesture_format);
+ORB_DEFINE(sensor_offbody_detector_uncal, struct sensor_event,
+           sensor_gesture_format);
+ORB_DEFINE(sensor_pickup_gesture, struct sensor_event,
+           sensor_gesture_format);
+ORB_DEFINE(sensor_pickup_gesture_uncal, struct sensor_event,
+           sensor_gesture_format);
+ORB_DEFINE(sensor_wrist_tilt, struct sensor_event, sensor_gesture_format);
+ORB_DEFINE(sensor_wrist_tilt_uncal, struct sensor_event,
+           sensor_gesture_format);
+ORB_DEFINE(sensor_wake_gesture, struct sensor_event, sensor_gesture_format);
+ORB_DEFINE(sensor_wake_gesture_uncal, struct sensor_event,
+           sensor_gesture_format);
diff --git a/system/uorb/sensor/gesture.h b/system/uorb/sensor/gesture.h
index 521f7d8b3..8ea556885 100644
--- a/system/uorb/sensor/gesture.h
+++ b/system/uorb/sensor/gesture.h
@@ -33,6 +33,14 @@
 
 /* register this as object request broker structure */
 
+ORB_DECLARE(sensor_glance_gesture);
+ORB_DECLARE(sensor_glance_gesture_uncal);
+ORB_DECLARE(sensor_offbody_detector);
+ORB_DECLARE(sensor_offbody_detector_uncal);
+ORB_DECLARE(sensor_pickup_gesture);
+ORB_DECLARE(sensor_pickup_gesture_uncal);
+ORB_DECLARE(sensor_wrist_tilt);
+ORB_DECLARE(sensor_wrist_tilt_uncal);
 ORB_DECLARE(sensor_wake_gesture);
 ORB_DECLARE(sensor_wake_gesture_uncal);
 
diff --git a/system/uorb/sensor/gesture.c b/system/uorb/sensor/motion.c
similarity index 75%
copy from system/uorb/sensor/gesture.c
copy to system/uorb/sensor/motion.c
index f19a40a4b..fedaca04c 100644
--- a/system/uorb/sensor/gesture.c
+++ b/system/uorb/sensor/motion.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * apps/system/uorb/sensor/gesture.c
+ * apps/system/uorb/sensor/motion.c
  *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -22,14 +22,14 @@
  * Included Files
  ****************************************************************************/
 
-#include <sensor/gesture.h>
+#include <sensor/motion.h>
 
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
 
 #ifdef CONFIG_DEBUG_UORB
-static const char sensor_wake_gesture_format[] =
+static const char sensor_event_format[] =
   "timestamp:%" PRIu64 ",event:%" PRIu32 "";
 #endif
 
@@ -37,7 +37,10 @@ static const char sensor_wake_gesture_format[] =
  * Public Data
  ****************************************************************************/
 
-ORB_DEFINE(sensor_wake_gesture, struct sensor_wake_gesture,
-           sensor_wake_gesture_format);
-ORB_DEFINE(sensor_wake_gesture_uncal, struct sensor_wake_gesture,
-           sensor_wake_gesture_format);
+ORB_DEFINE(sensor_motion_detect, struct sensor_event, sensor_event_format);
+ORB_DEFINE(sensor_significant_motion, struct sensor_event,
+           sensor_event_format);
+ORB_DEFINE(sensor_step_detector, struct sensor_event, sensor_event_format);
+ORB_DEFINE(sensor_tilt_detector, struct sensor_event, sensor_event_format);
+ORB_DEFINE(sensor_tilt_detector_uncal, struct sensor_event,
+           sensor_event_format);
diff --git a/system/uorb/sensor/accel.h b/system/uorb/sensor/motion.h
similarity index 81%
copy from system/uorb/sensor/accel.h
copy to system/uorb/sensor/motion.h
index 43d22af48..313e9f578 100644
--- a/system/uorb/sensor/accel.h
+++ b/system/uorb/sensor/motion.h
@@ -1,5 +1,5 @@
 /****************************************************************************
- * apps/system/uorb/sensor/accel.h
+ * apps/system/uorb/sensor/motion.h
  *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -18,8 +18,8 @@
  *
  ****************************************************************************/
 
-#ifndef __APPS_SYSTEM_UORB_SENSOR_ACCEL_H
-#define __APPS_SYSTEM_UORB_SENSOR_ACCEL_H
+#ifndef __APPS_SYSTEM_UORB_SENSOR_MOTION_H
+#define __APPS_SYSTEM_UORB_SENSOR_MOTION_H
 
 /****************************************************************************
  * Included Files
@@ -33,7 +33,10 @@
 
 /* register this as object request broker structure */
 
-ORB_DECLARE(sensor_accel);
-ORB_DECLARE(sensor_accel_uncal);
+ORB_DECLARE(sensor_motion_detect);
+ORB_DECLARE(sensor_significant_motion);
+ORB_DECLARE(sensor_step_detector);
+ORB_DECLARE(sensor_tilt_detector);
+ORB_DECLARE(sensor_tilt_detector_uncal);
 
 #endif
diff --git a/system/uorb/sensor/accel.c b/system/uorb/sensor/pose_6dof.c
similarity index 81%
copy from system/uorb/sensor/accel.c
copy to system/uorb/sensor/pose_6dof.c
index be39b55af..2e1741f12 100644
--- a/system/uorb/sensor/accel.c
+++ b/system/uorb/sensor/pose_6dof.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * apps/system/uorb/sensor/accel.c
+ * apps/system/uorb/sensor/pose_6dof.c
  *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -22,21 +22,21 @@
  * Included Files
  ****************************************************************************/
 
-#include <sensor/accel.h>
+#include <sensor/pose_6dof.h>
 
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
 
 #ifdef CONFIG_DEBUG_UORB
-static const char sensor_accel_format[] =
-  "timestamp:%" PRIu64 ",x:%hf,y:%hf,z:%hf,temperature:%hf";
-
+static const char sensor_pose_6dof_format[] =
+  "timestamp:%" PRIu64 ",x:%hf,y:%hf,z:%hf,w:%hf,tx:%hf,ty:%hf,tz:%hf,"
+  "dx:%hf,dy:%hf,dz:%hf,dw:%hf,dtx:%hf,dty:%hf,dtz:%hf,number:%" PRIu64 "";
 #endif
 
 /****************************************************************************
  * Public Data
  ****************************************************************************/
 
-ORB_DEFINE(sensor_accel, struct sensor_accel, sensor_accel_format);
-ORB_DEFINE(sensor_accel_uncal, struct sensor_accel, sensor_accel_format);
+ORB_DEFINE(sensor_pose_6dof, struct sensor_pose_6dof,
+           sensor_pose_6dof_format);
diff --git a/system/uorb/sensor/accel.h b/system/uorb/sensor/pose_6dof.h
similarity index 88%
copy from system/uorb/sensor/accel.h
copy to system/uorb/sensor/pose_6dof.h
index 43d22af48..4601b927e 100644
--- a/system/uorb/sensor/accel.h
+++ b/system/uorb/sensor/pose_6dof.h
@@ -1,5 +1,5 @@
 /****************************************************************************
- * apps/system/uorb/sensor/accel.h
+ * apps/system/uorb/sensor/pose_6dof.h
  *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -18,8 +18,8 @@
  *
  ****************************************************************************/
 
-#ifndef __APPS_SYSTEM_UORB_SENSOR_ACCEL_H
-#define __APPS_SYSTEM_UORB_SENSOR_ACCEL_H
+#ifndef __APPS_SYSTEM_UORB_SENSOR_POSE_6DOF_H
+#define __APPS_SYSTEM_UORB_SENSOR_POSE_6DOF_H
 
 /****************************************************************************
  * Included Files
@@ -33,7 +33,6 @@
 
 /* register this as object request broker structure */
 
-ORB_DECLARE(sensor_accel);
-ORB_DECLARE(sensor_accel_uncal);
+ORB_DECLARE(sensor_pose_6dof);
 
 #endif
diff --git a/system/uorb/sensor/accel.c b/system/uorb/sensor/rotation.c
similarity index 74%
copy from system/uorb/sensor/accel.c
copy to system/uorb/sensor/rotation.c
index be39b55af..05777b8f1 100644
--- a/system/uorb/sensor/accel.c
+++ b/system/uorb/sensor/rotation.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * apps/system/uorb/sensor/accel.c
+ * apps/system/uorb/sensor/rotation.c
  *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -22,21 +22,25 @@
  * Included Files
  ****************************************************************************/
 
-#include <sensor/accel.h>
+#include <sensor/rotation.h>
 
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
 
 #ifdef CONFIG_DEBUG_UORB
-static const char sensor_accel_format[] =
-  "timestamp:%" PRIu64 ",x:%hf,y:%hf,z:%hf,temperature:%hf";
-
+static const char sensor_rotation_format[] =
+  "timestamp:%" PRIu64 ",x:%hf,y:%hf,z:%hf";
+static const char sensor_orientation_format[] =
+  "timestamp:%" PRIu64 ",x:%hf,y:%hf,z:%hf,w:%hf";
 #endif
 
 /****************************************************************************
  * Public Data
  ****************************************************************************/
 
-ORB_DEFINE(sensor_accel, struct sensor_accel, sensor_accel_format);
-ORB_DEFINE(sensor_accel_uncal, struct sensor_accel, sensor_accel_format);
+ORB_DEFINE(sensor_rotation, struct sensor_rotation, sensor_rotation_format);
+ORB_DEFINE(sensor_orientation, struct sensor_orientation,
+           sensor_orientation_format);
+ORB_DEFINE(sensor_device_orientation, struct sensor_orientation,
+           sensor_orientation_format);
diff --git a/system/uorb/sensor/accel.h b/system/uorb/sensor/rotation.h
similarity index 85%
copy from system/uorb/sensor/accel.h
copy to system/uorb/sensor/rotation.h
index 43d22af48..e660beb60 100644
--- a/system/uorb/sensor/accel.h
+++ b/system/uorb/sensor/rotation.h
@@ -1,5 +1,5 @@
 /****************************************************************************
- * apps/system/uorb/sensor/accel.h
+ * apps/system/uorb/sensor/rotation.h
  *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -18,8 +18,8 @@
  *
  ****************************************************************************/
 
-#ifndef __APPS_SYSTEM_UORB_SENSOR_ACCEL_H
-#define __APPS_SYSTEM_UORB_SENSOR_ACCEL_H
+#ifndef __APPS_SYSTEM_UORB_SENSOR_ROTATION_H
+#define __APPS_SYSTEM_UORB_SENSOR_ROTATION_H
 
 /****************************************************************************
  * Included Files
@@ -33,7 +33,8 @@
 
 /* register this as object request broker structure */
 
-ORB_DECLARE(sensor_accel);
-ORB_DECLARE(sensor_accel_uncal);
+ORB_DECLARE(sensor_rotation);
+ORB_DECLARE(sensor_orientation);
+ORB_DECLARE(sensor_device_orientation);
 
 #endif
diff --git a/system/uorb/sensor/accel.c b/system/uorb/sensor/step_counter.c
similarity index 83%
copy from system/uorb/sensor/accel.c
copy to system/uorb/sensor/step_counter.c
index be39b55af..360922547 100644
--- a/system/uorb/sensor/accel.c
+++ b/system/uorb/sensor/step_counter.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * apps/system/uorb/sensor/accel.c
+ * apps/system/uorb/sensor/step_counter.c
  *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -22,21 +22,20 @@
  * Included Files
  ****************************************************************************/
 
-#include <sensor/accel.h>
+#include <sensor/step_counter.h>
 
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
 
 #ifdef CONFIG_DEBUG_UORB
-static const char sensor_accel_format[] =
-  "timestamp:%" PRIu64 ",x:%hf,y:%hf,z:%hf,temperature:%hf";
-
+static const char sensor_step_counter_format[] =
+  "timestamp:%" PRIu64 ",event:%" PRIu32 ",cadence:%" PRIu32 "";
 #endif
 
 /****************************************************************************
  * Public Data
  ****************************************************************************/
 
-ORB_DEFINE(sensor_accel, struct sensor_accel, sensor_accel_format);
-ORB_DEFINE(sensor_accel_uncal, struct sensor_accel, sensor_accel_format);
+ORB_DEFINE(sensor_step_counter, struct sensor_step_counter,
+           sensor_step_counter_format);
diff --git a/system/uorb/sensor/accel.h b/system/uorb/sensor/step_counter.h
similarity index 88%
copy from system/uorb/sensor/accel.h
copy to system/uorb/sensor/step_counter.h
index 43d22af48..2e14a48ef 100644
--- a/system/uorb/sensor/accel.h
+++ b/system/uorb/sensor/step_counter.h
@@ -1,5 +1,5 @@
 /****************************************************************************
- * apps/system/uorb/sensor/accel.h
+ * apps/system/uorb/sensor/step_counter.h
  *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -18,8 +18,8 @@
  *
  ****************************************************************************/
 
-#ifndef __APPS_SYSTEM_UORB_SENSOR_ACCEL_H
-#define __APPS_SYSTEM_UORB_SENSOR_ACCEL_H
+#ifndef __APPS_SYSTEM_UORB_SENSOR_STEP_COUNTER_H
+#define __APPS_SYSTEM_UORB_SENSOR_STEP_COUNTER_H
 
 /****************************************************************************
  * Included Files
@@ -33,7 +33,6 @@
 
 /* register this as object request broker structure */
 
-ORB_DECLARE(sensor_accel);
-ORB_DECLARE(sensor_accel_uncal);
+ORB_DECLARE(sensor_step_counter);
 
 #endif
diff --git a/system/uorb/sensor/topics.c b/system/uorb/sensor/topics.c
index d7e5523f4..7c66569ae 100644
--- a/system/uorb/sensor/topics.c
+++ b/system/uorb/sensor/topics.c
@@ -32,6 +32,7 @@
 #include <unistd.h>
 
 #include <sensor/accel.h>
+#include <sensor/angle.h>
 #include <sensor/baro.h>
 #include <sensor/cap.h>
 #include <sensor/co2.h>
@@ -51,16 +52,20 @@
 #include <sensor/ir.h>
 #include <sensor/light.h>
 #include <sensor/mag.h>
+#include <sensor/motion.h>
 #include <sensor/noise.h>
 #include <sensor/ots.h>
 #include <sensor/ph.h>
 #include <sensor/pm25.h>
 #include <sensor/pm1p0.h>
 #include <sensor/pm10.h>
+#include <sensor/pose_6dof.h>
 #include <sensor/ppgd.h>
 #include <sensor/ppgq.h>
 #include <sensor/prox.h>
 #include <sensor/rgb.h>
+#include <sensor/rotation.h>
+#include <sensor/step_counter.h>
 #include <sensor/temp.h>
 #include <sensor/tvoc.h>
 #include <sensor/uv.h>
@@ -75,13 +80,17 @@ static FAR const struct orb_metadata *g_sensor_list[] =
 {
   ORB_ID(sensor_accel),
   ORB_ID(sensor_accel_uncal),
+  ORB_ID(sensor_hinge_angle),
   ORB_ID(sensor_baro),
   ORB_ID(sensor_cap),
   ORB_ID(sensor_co2),
+  ORB_ID(sensor_device_orientation),
   ORB_ID(sensor_dust),
   ORB_ID(sensor_ecg),
   ORB_ID(sensor_force),
   ORB_ID(sensor_gas),
+  ORB_ID(sensor_glance_gesture),
+  ORB_ID(sensor_glance_gesture_uncal),
   ORB_ID(sensor_gnss),
   ORB_ID(sensor_gnss_clock),
   ORB_ID(sensor_gnss_geofence_event),
@@ -98,23 +107,40 @@ static FAR const struct orb_metadata *g_sensor_list[] =
   ORB_ID(sensor_ir),
   ORB_ID(sensor_light),
   ORB_ID(sensor_light_uncal),
+  ORB_ID(sensor_linear_accel),
+  ORB_ID(sensor_linear_accel_uncal),
   ORB_ID(sensor_mag),
   ORB_ID(sensor_mag_uncal),
+  ORB_ID(sensor_motion_detect),
   ORB_ID(sensor_noise),
+  ORB_ID(sensor_offbody_detector),
+  ORB_ID(sensor_offbody_detector_uncal),
+  ORB_ID(sensor_orientation),
   ORB_ID(sensor_ots),
   ORB_ID(sensor_ph),
+  ORB_ID(sensor_pickup_gesture),
+  ORB_ID(sensor_pickup_gesture_uncal),
   ORB_ID(sensor_pm10),
   ORB_ID(sensor_pm1p0),
   ORB_ID(sensor_pm25),
+  ORB_ID(sensor_pose_6dof),
   ORB_ID(sensor_ppgd),
   ORB_ID(sensor_ppgq),
   ORB_ID(sensor_prox),
   ORB_ID(sensor_rgb),
+  ORB_ID(sensor_rotation),
+  ORB_ID(sensor_significant_motion),
+  ORB_ID(sensor_step_counter),
+  ORB_ID(sensor_step_detector),
   ORB_ID(sensor_temp),
+  ORB_ID(sensor_tilt_detector),
+  ORB_ID(sensor_tilt_detector_uncal),
   ORB_ID(sensor_tvoc),
   ORB_ID(sensor_uv),
   ORB_ID(sensor_wake_gesture),
   ORB_ID(sensor_wake_gesture_uncal),
+  ORB_ID(sensor_wrist_tilt),
+  ORB_ID(sensor_wrist_tilt_uncal),
   NULL,
 };
 


(nuttx-apps) 01/02: uORB: Add topic information acquisition and setting interface.

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch releases/12.7
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit 9ca75e29776d74756ddbd668556aa92c74194604
Author: likun17 <li...@xiaomi.com>
AuthorDate: Mon Apr 1 19:21:58 2024 +0800

    uORB: Add topic information acquisition and setting interface.
    
    Signed-off-by: likun17 <li...@xiaomi.com>
---
 system/uorb/uORB/uORB.c | 12 +++++++++++-
 system/uorb/uORB/uORB.h | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 44 insertions(+), 1 deletion(-)

diff --git a/system/uorb/uORB/uORB.c b/system/uorb/uORB/uORB.c
index 20d6e1157..cf3f70cb8 100644
--- a/system/uorb/uORB/uORB.c
+++ b/system/uorb/uORB/uORB.c
@@ -257,6 +257,16 @@ int orb_get_interval(int fd, FAR unsigned *interval)
   return ret;
 }
 
+int orb_set_info(int fd, FAR const orb_info_t *info)
+{
+  return ioctl(fd, SNIOC_SET_INFO, (unsigned long)(uintptr_t)info);
+}
+
+int orb_get_info(int fd, FAR orb_info_t *info)
+{
+  return ioctl(fd, SNIOC_GET_INFO, (unsigned long)(uintptr_t)info);
+}
+
 int orb_set_batch_interval(int fd, unsigned batch_interval)
 {
   return ioctl(fd, SNIOC_BATCH, (unsigned long)batch_interval);
@@ -340,7 +350,7 @@ void orb_info(FAR const char *format, FAR const char *name,
 
   vaf.fmt = format;
   vaf.va  = (va_list *)data;
-  uorbinfo_raw("%s(now:%" PRIu64 "):%pB", name, orb_absolute_time(), &vaf);
+  uorbinfo_raw("%s(now:%" PRIu64 "):%pB\n", name, orb_absolute_time(), &vaf);
 }
 
 int orb_fprintf(FAR FILE *stream, FAR const char *format,
diff --git a/system/uorb/uORB/uORB.h b/system/uorb/uORB/uORB.h
index 0655a1a86..84774d2af 100644
--- a/system/uorb/uORB/uORB.h
+++ b/system/uorb/uORB/uORB.h
@@ -69,6 +69,7 @@ struct orb_object
 };
 
 typedef uint64_t orb_abstime;
+typedef struct sensor_device_info_s orb_info_t;
 
 /****************************************************************************
  * Pre-processor Definitions
@@ -590,6 +591,38 @@ int orb_set_interval(int fd, unsigned interval);
 
 int orb_get_interval(int fd, FAR unsigned *interval);
 
+/****************************************************************************
+ * Name: orb_set_info
+ *
+ * Description:
+ *   Set topic information.
+ *
+ * Input Parameters:
+ *   fd     A fd returned from orb_subscribe.
+ *   info   Data to be transmitted.
+ *
+ * Returned Value:
+ *   0 on success, -1 otherwise with ERRNO set accordingly.
+ ****************************************************************************/
+
+int orb_set_info(int fd, FAR const orb_info_t *info);
+
+/****************************************************************************
+ * Name: orb_get_info
+ *
+ * Description:
+ *   Get topic information.
+ *
+ * Input Parameters:
+ *   fd     A fd returned from orb_subscribe.
+ *   info   The returned topic info.
+ *
+ * Returned Value:
+ *   0 on success, -1 otherwise with ERRNO set accordingly.
+ ****************************************************************************/
+
+int orb_get_info(int fd, FAR orb_info_t *info);
+
 /****************************************************************************
  * Name:
  *   orb_set_frequency