Skip to content
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

Sensing Subsystem Upstream PR1 #55389

Merged
merged 8 commits into from Jun 17, 2023

Conversation

ghu0510
Copy link
Contributor

@ghu0510 ghu0510 commented Mar 3, 2023

  1. sensor: Adding Sensor Subsystem API
  2. doc: Add documents for sensor subsystem (sensing)
  3. sensing: add sensor subsystem skeleton
  4. sensing: phy_3d_sensor: add phy_3d_sensor skeleton
  5. sensing: initial sensor list and enumerate each sensor
  6. samples: senss: add a simple sensor subsystem app
  7. MAINTAINERS: Add maintainer and collaborator for Sensing Subsystem
  8. CODEOWNERS: Add code owners for Sensing Subsystem

Copy link
Collaborator

@yperess yperess left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying to keep the review focused, only reviewed "senss.h" for now

include/zephyr/senss/senss.h Outdated Show resolved Hide resolved
include/zephyr/senss/senss.h Outdated Show resolved Hide resolved
include/zephyr/senss/senss.h Outdated Show resolved Hide resolved
include/zephyr/senss/senss.h Outdated Show resolved Hide resolved
include/zephyr/senss/senss.h Outdated Show resolved Hide resolved
include/zephyr/senss/senss.h Outdated Show resolved Hide resolved
include/zephyr/senss/senss.h Outdated Show resolved Hide resolved
include/zephyr/senss/senss.h Outdated Show resolved Hide resolved
include/zephyr/senss/senss.h Outdated Show resolved Hide resolved
include/zephyr/senss/senss.h Outdated Show resolved Hide resolved
@ghu0510 ghu0510 force-pushed the ghu_senss_upstream_pr1 branch 2 times, most recently from b5aae17 to af51800 Compare March 7, 2023 01:21
@ghu0510 ghu0510 force-pushed the ghu_senss_upstream_pr1 branch 2 times, most recently from c09dbea to 8fbdfaa Compare March 8, 2023 03:25
@MaureenHelm
Copy link
Member

Please fix the failed doc check:

Warning, treated as error:
/home/runner/work/zephyr/zephyr/include/zephyr/senss/senss_sensor.h:101: unable to resolve reference to 'struct' for \ref command

@ghu0510
Copy link
Contributor Author

ghu0510 commented Mar 10, 2023

Please fix the failed doc check:

Warning, treated as error:
/home/runner/work/zephyr/zephyr/include/zephyr/senss/senss_sensor.h:101: unable to resolve reference to 'struct' for \ref command

Actually, I have modified it in last commit. Anyway, update to latest main branch, and run CI again.
68955eb (ghu0510/main, ghu0510_main) logging: Increase package size limit to 2047

@ghu0510 ghu0510 force-pushed the ghu_senss_upstream_pr1 branch 10 times, most recently from e18e506 to 6fa62b5 Compare March 16, 2023 01:36
@yperess yperess dismissed their stale review June 7, 2023 03:59

Agreed to file concerns as a separate issue, see #58925

@ghu0510 ghu0510 force-pushed the ghu_senss_upstream_pr1 branch 2 times, most recently from a7d74b0 to 1198dd5 Compare June 7, 2023 08:06
subsys/sensing/sensor_mgmt.c Outdated Show resolved Hide resolved
subsys/sensing/sensor_mgmt.c Outdated Show resolved Hide resolved
keith-zephyr
keith-zephyr previously approved these changes Jun 8, 2023
teburd
teburd previously approved these changes Jun 8, 2023
@teburd
Copy link
Collaborator

teburd commented Jun 8, 2023

@huhebo @ghu0510 please fix the doc build

@ghu0510 ghu0510 dismissed stale reviews from teburd and keith-zephyr via 189d771 June 9, 2023 01:25
huhebo and others added 8 commits June 9, 2023 09:37
This API introduced a new sensing subsystem, which is a high level
sensor framework inside the OS user space service layer.
It's a framework focus on sensor fusion, clients arbitration, sampling,
timing, scheduling and sensor based power management.

It's key concepts including physical sensor and virtual sensor objects,
and a scheduling framework reflects sensor objects' reporting relationship.
Physical sensors not depends on any other sensor objects for input, and
will directly interact with existing zephyr sensor device drivers.
Virtual sensors rely on other sensor objects (physical or virtual) as
report inputs.

The sensing subsystem relies on existing zephyr sensor device APIs or V2
zephyr sensor device APIs (zephyrproject-rtos#44098).

So it can leverage current existing zephyr sensor device drivers (100+).
And it's configurable, so, for some low cost IoT devices, may not need an
advanced sensor framework, but just need access some simple sensor
devices,can not configure and build this sensor subsystem, but just use
the exiting zephyr sensor device APIs to save memory resources.

Since the sensing subsystem is separated from device driver layer or
kernel space and could support various customizations and sensor
algorithms in user space with virtual sensor concepts. The existing
sensor device driver can focus on low layer device side works, can keep
simple as much as possible, just provide device HW abstraction and
operations etc. This is very good for system stability.

The sensing subsystem is decoupled with any sensor expose/transfer
protocols, the target is to support various up-layer frameworks and
Applications with different sensor expose/transfer protocols,
such as CHRE, HID sensors Applications, MQTT sensor Applications
according different products requirements. Or even support multiple
Applications with different up-layer sensor protocols at the same time
with it's multiple clients support design. For example can support CHRE
and other normal zephyr sensor application (can use HID etc) at
the same time.

Signed-off-by: Hebo Hu <hebo.hu@intel.com>
Signed-off-by: Guangfu Hu <guangfu.hu@intel.com>
Add documents for sensing subsystem.

Signed-off-by: Hebo Hu <hebo.hu@intel.com>
Add Sensing Subsystem skeleton.

Signed-off-by: Guangfu Hu <guangfu.hu@intel.com>
Signed-off-by: Zhang Lixu <lixu.zhang@intel.com>
Add the sensor phy_3d_sensor skeleton in Sensing Subsystem.

Signed-off-by: Zhang Lixu <lixu.zhang@intel.com>
Implement sensing_init():
	1) create sensors from device tree
	2) sequence sensors following node dependency ordering rule generated by
	   Zephyr DTS
	3) initial each sensor, includes:
		a) creating sensor connection between reporter and client,
		b) calling sensor init callback,
		c) setting sensor state
Implement sensing_open_sensor():
	1) malloc connection from reporter to application
	2) bind connection
Implement sensing_close_sensr():
	1) unbind connection
	2) free connection from reporter to application
Implement sensing_set_config():
	1) call set_interval
	2) cann set_sensitivity
Implement sensing_get_config():
	1) call get_interval
	2) call get_sensitivity

Signed-off-by: Guangfu Hu <guangfu.hu@intel.com>
Add a simple sensing subsystem application.

Signed-off-by: Guangfu Hu <guangfu.hu@intel.com>
Add lixuzha, ghu0510, qianruh as maintainer and collaborators for
the Sensing Subsystem.

Signed-off-by: Zhang Lixu <lixu.zhang@intel.com>
Add lixuzha, ghu0510, qianruh for the Sensor Subsystem.

Signed-off-by: Zhang Lixu <lixu.zhang@intel.com>
@ghu0510
Copy link
Contributor Author

ghu0510 commented Jun 14, 2023

@huhebo @ghu0510 please fix the doc build

doc build error already fixed, thanks.

@nashif nashif merged commit 2378d45 into zephyrproject-rtos:main Jun 17, 2023
17 of 18 checks passed
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ghu0510!
Congratulations on getting your very first Zephyr pull request merged 🎉🥳. This is a fantastic achievement, and we're thrilled to have you as part of our community!

To celebrate this milestone and showcase your contribution, we'd love to award you the Zephyr Technical Contributor badge. If you're interested, please claim your badge by filling out this form: Claim Your Zephyr Badge.

Thank you for your valuable input, and we look forward to seeing more of your contributions in the future! 🪁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: v3.5
Development

Successfully merging this pull request may close these issues.

None yet