Skip to content

Conversation

@Donny9
Copy link
Contributor

@Donny9 Donny9 commented Jul 21, 2022

Summary

update sensortest tool:

1.update prefix of sensor event structure to sensor_xxx.
2.remove activate cmd because of open will auto activate sensor.

Signed-off-by: Jiuzhu Dong dongjiuzhu1@xiaomi.com

Impact

N/A

Testing

Vela CI

@Donny9
Copy link
Contributor Author

Donny9 commented Jul 21, 2022

uorb_listener

ap> uorb_listener -r 25 -n 10 sensor_baro
[07/21 10:29:25.711242] [1471] [ap] 
Mointor objects num:1
[07/21 10:29:25.711914] [1471] [ap] object_name:sensor_baro, object_instance:0
[07/21 10:29:25.776794] [1471] [ap] sensor_baro:        timestamp: 108973761230 (22156 us ago) temperature: 27.20 pressure: 994.26
[07/21 10:29:25.817199] [1471] [ap] sensor_baro:        timestamp: 108973801635 (22095 us ago) temperature: 27.20 pressure: 994.25
[07/21 10:29:25.857421] [1471] [ap] sensor_baro:        timestamp: 108973842041 (21911 us ago) temperature: 27.21 pressure: 994.26
[07/21 10:29:25.898376] [1471] [ap] sensor_baro:        timestamp: 108973882507 (22400 us ago) temperature: 27.21 pressure: 994.24
[07/21 10:29:25.938354] [1471] [ap] sensor_baro:        timestamp: 108973922912 (22034 us ago) temperature: 27.22 pressure: 994.27
[07/21 10:29:25.978515] [1471] [ap] sensor_baro:        timestamp: 108973963317 (21729 us ago) temperature: 27.22 pressure: 994.26
[07/21 10:29:26.019409] [1471] [ap] sensor_baro:        timestamp: 108974003784 (22155 us ago) temperature: 27.22 pressure: 994.26
[07/21 10:29:26.059814] [1471] [ap] sensor_baro:        timestamp: 108974044250 (22095 us ago) temperature: 27.22 pressure: 994.26
[07/21 10:29:26.101806] [1471] [ap] sensor_baro:        timestamp: 108974084716 (23682 us ago) temperature: 27.22 pressure: 994.26
[07/21 10:29:26.140869] [1471] [ap] sensor_baro:        timestamp: 108974125305 (22094 us ago) temperature: 27.22 pressure: 994.27
[07/21 10:29:26.142333] [1471] [ap] Object name:sensor_baro0, recieved:10
[07/21 10:29:26.143066] [1471] [ap] Total number of received Message:10/10

ap> uorb_listener -r 25 -n 20 sensor_baro,sensor_gyro
[07/21 10:31:49.680480] [1502] [ap] 
Mointor objects num:2
[07/21 10:31:49.681213] [1502] [ap] object_name:sensor_baro, object_instance:0
[07/21 10:31:49.682006] [1502] [ap] object_name:sensor_gyro, object_instance:0
[07/21 10:31:49.746765] [1502] [ap] sensor_baro:        timestamp: 109117730895 (22461 us ago) temperature: 27.20 pressure: 994.35
[07/21 10:31:49.748229] [1502] [ap] sensor_gyro:        timestamp: 109117737487 (17334 us ago) temperature: 27.96 x: 0.01 y: -0.00 z: 0.00
[07/21 10:31:49.787170] [1502] [ap] sensor_baro:        timestamp: 109117771362 (22400 us ago) temperature: 27.21 pressure: 994.35
[07/21 10:31:49.788513] [1502] [ap] sensor_gyro:        timestamp: 109117778198 (16906 us ago) temperature: 27.96 x: 0.01 y: 0.01 z: -0.00
[07/21 10:31:49.828186] [1502] [ap] sensor_baro:        timestamp: 109117811828 (22888 us ago) temperature: 27.21 pressure: 994.35
[07/21 10:31:49.829528] [1502] [ap] sensor_gyro:        timestamp: 109117818908 (17151 us ago) temperature: 27.96 x: 0.01 y: 0.00 z: 0.00
[07/21 10:31:49.868164] [1502] [ap] sensor_baro:        timestamp: 109117852233 (22522 us ago) temperature: 27.22 pressure: 994.35
[07/21 10:31:49.869506] [1502] [ap] sensor_gyro:        timestamp: 109117859558 (16540 us ago) temperature: 27.96 x: 0.00 y: 0.01 z: 0.00
[07/21 10:31:49.908569] [1502] [ap] sensor_baro:        timestamp: 109117892639 (22461 us ago) temperature: 27.22 pressure: 994.35
[07/21 10:31:49.909912] [1502] [ap] sensor_gyro:        timestamp: 109117900268 (16235 us ago) temperature: 27.96 x: 0.00 y: 0.00 z: 0.00
[07/21 10:31:49.949096] [1502] [ap] sensor_baro:        timestamp: 109117933166 (22461 us ago) temperature: 27.23 pressure: 994.34
[07/21 10:31:49.950439] [1502] [ap] sensor_gyro:        timestamp: 109117940979 (15991 us ago) temperature: 27.96 x: 0.00 y: 0.01 z: 0.00
[07/21 10:31:49.989196] [1502] [ap] sensor_baro:        timestamp: 109117973632 (22156 us ago) temperature: 27.22 pressure: 994.36
[07/21 10:31:49.990661] [1502] [ap] sensor_gyro:        timestamp: 109117981689 (15503 us ago) temperature: 27.96 x: 0.01 y: 0.00 z: -0.00
[07/21 10:31:50.030029] [1502] [ap] sensor_baro:        timestamp: 109118014038 (22583 us ago) temperature: 27.23 pressure: 994.36
[07/21 10:31:50.031372] [1502] [ap] sensor_gyro:        timestamp: 109118022338 (15625 us ago) temperature: 27.96 x: 0.00 y: 0.01 z: 0.01
[07/21 10:31:50.070373] [1502] [ap] sensor_baro:        timestamp: 109118054443 (22522 us ago) temperature: 27.22 pressure: 994.35
[07/21 10:31:50.071716] [1502] [ap] sensor_gyro:        timestamp: 109118062927 (15381 us ago) temperature: 27.96 x: 0.00 y: -0.00 z: 0.00
[07/21 10:31:50.111022] [1502] [ap] sensor_baro:        timestamp: 109118095275 (22339 us ago) temperature: 27.23 pressure: 994.34
[07/21 10:31:50.112365] [1502] [ap] sensor_gyro:        timestamp: 109118103576 (15381 us ago) temperature: 27.96 x: 0.00 y: 0.01 z: 0.00
[07/21 10:31:50.113952] [1502] [ap] Object name:sensor_baro0, recieved:10
[07/21 10:31:50.114807] [1502] [ap] Object name:sensor_gyro0, recieved:10
[07/21 10:31:50.115539] [1502] [ap] Total number of received Message:20/20

@acassis
Copy link
Contributor

acassis commented Jul 21, 2022

@Donny9 why not keep both? sensortest seems smaller and simple to use. The uorb is have more features to use and share data, but sometimes we don't need or want to use it. Please consider keeping it!

@xiaoxiang781216
Copy link
Contributor

xiaoxiang781216 commented Jul 21, 2022

@Donny9 why not keep both? sensortest seems smaller and simple to use. The uorb is have more features to use and share data, but sometimes we don't need or want to use it. Please consider keeping it!

Since core uorb functionality will be part of new sensor driver framework, all orb functions will become a simple ioctl wrapper. Basically, sensortest and uorb_listener is same(direct ioctl v.s. uorb wrapper), that's why we remove sensortest, but integrate uorb_listener in the next PR.

@acassis
Copy link
Contributor

acassis commented Jul 21, 2022

@Donny9 why not keep both? sensortest seems smaller and simple to use. The uorb is have more features to use and share data, but sometimes we don't need or want to use it. Please consider keeping it!

Since core uorb functionality will be part of new sensor driver framework, all orb functions will become a simple ioctl wrapper. Basically, sensortest and uorb_listener is same(direct ioctl v.s. uorb wrapper), that's why we remove sensortest, but integrate uorb_listener in the next PR.

Thank you @xiaoxiang781216, but I suppose uorb could use more flash and RAM memory right? That is the impact in this case? What are the uorb dependence features from NuttX side?

@xiaoxiang781216
Copy link
Contributor

xiaoxiang781216 commented Jul 21, 2022

@Donny9 why not keep both? sensortest seems smaller and simple to use. The uorb is have more features to use and share data, but sometimes we don't need or want to use it. Please consider keeping it!

Since core uorb functionality will be part of new sensor driver framework, all orb functions will become a simple ioctl wrapper. Basically, sensortest and uorb_listener is same(direct ioctl v.s. uorb wrapper), that's why we remove sensortest, but integrate uorb_listener in the next PR.

Thank you @xiaoxiang781216, but I suppose uorb could use more flash and RAM memory right? That is the impact in this case? What are the uorb dependence features from NuttX side?

The major change is to enable sensor driver supporting multiple readers. Many nuttx drivers support multiple users, but the old sensor driver just support one, because we utilize PX4 uorb framework to support the multiple users.

We found many problem with the pure userspace solution in the recent one year use, and then decide to integrate the core functionality into drivers side:

  1. Support multiple readers
  2. Support down sample

The code increase is around 500~ line, but the benefit is:

  1. Doesn't depend on the external library and c++(around 10000~ line)
  2. Reduce many intermediate threads
  3. Fast execution speed(less the context switch)

@Donny9
Copy link
Contributor Author

Donny9 commented Jul 22, 2022

@acassis #1230 you can try this tool uorb_listener, i will push a new config for sensor and uorb.

@xiaoxiang781216
Copy link
Contributor

@acassis how about we merge this pr and focus on orb interface?

@acassis
Copy link
Contributor

acassis commented Jul 23, 2022

Thank you @xiaoxiang781216! I understood the previous issues. Maybe a new testsensor using uorb should be created to make it clear to users that that all is used to test sensors.

@xiaoxiang781216
Copy link
Contributor

Ok, let's keep it.

…iver

1.update prefix of sensor event structure to sensor_xxx.
2.remove activate cmd because of open will auto activate sensor.

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
@Donny9 Donny9 changed the title testing/sensortest: remove this project and using uorb_listener test testing/sensortest: update sensortest according enhance sensor driver Jul 25, 2022
@Donny9
Copy link
Contributor Author

Donny9 commented Jul 25, 2022

Thank you @xiaoxiang781216! I understood the previous issues. Maybe a new testsensor using uorb should be created to make it clear to users that that all is used to test sensors.

Ok, let's keep it.

Okay. Update done according apache/nuttx#6653.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants