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

Add bhy2 #23

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
[submodule "ros_lib"]
path = lib/ros_lib
url = https://github.com/byq77/rosserial-mbed.git
branch = master
[submodule "encoder-mbed"]
path = lib/encoder-mbed
url = https://github.com/byq77/encoder-mbed.git
Expand All @@ -10,11 +6,10 @@
path = lib/motor-driver-mbed
url = https://github.com/byq77/drv88xx-driver-mbed.git
branch = master
[submodule "imu-driver"]
path = lib/imu-driver
url = https://github.com/byq77/core2-imu-driver.git
branch = master
[submodule "vl53l0x-mbed"]
path = lib/vl53l0x-mbed
url = https://github.com/byq77/vl53l0x-mbed.git
branch = master
[submodule "lib/imu-driver"]
path = lib/imu-driver
url = https://github.com/delihus/core2-imu-driver-mbed
2 changes: 1 addition & 1 deletion lib/imu-driver
Submodule imu-driver updated 38 files
+140 −54 ImuDriver.cpp
+27 −8 ImuDriver.h
+661 −0 internal/bhy2-mbed/LICENSE.txt
+5 −0 internal/bhy2-mbed/README.md
+635 −0 internal/bhy2-mbed/docs/Arduino_BHY2.UML.drawio.svg
+46 −0 internal/bhy2-mbed/docs/readme.md
+10 −0 internal/bhy2-mbed/library.properties
+128 −0 internal/bhy2-mbed/src/BHY2.cpp
+161 −0 internal/bhy2-mbed/src/BHY2.h
+224 −0 internal/bhy2-mbed/src/BoschParser.cpp
+71 −0 internal/bhy2-mbed/src/BoschParser.h
+244 −0 internal/bhy2-mbed/src/BoschSensortec.cpp
+154 −0 internal/bhy2-mbed/src/BoschSensortec.h
+9,710 −0 internal/bhy2-mbed/src/bosch/BHI260AP-flash.fw.h
+1,538 −0 internal/bhy2-mbed/src/bosch/bhy2.c
+584 −0 internal/bhy2-mbed/src/bosch/bhy2.h
+734 −0 internal/bhy2-mbed/src/bosch/bhy2_defs.h
+1,731 −0 internal/bhy2-mbed/src/bosch/bhy2_hif.c
+552 −0 internal/bhy2-mbed/src/bosch/bhy2_hif.h
+91 −0 internal/bhy2-mbed/src/bosch/bhy2_parse.c
+100 −0 internal/bhy2-mbed/src/bosch/bhy2_parse.h
+667 −0 internal/bhy2-mbed/src/bosch/common/common.cpp
+66 −0 internal/bhy2-mbed/src/bosch/common/common.h
+90 −0 internal/bhy2-mbed/src/sensors/DataParser.cpp
+87 −0 internal/bhy2-mbed/src/sensors/DataParser.h
+64 −0 internal/bhy2-mbed/src/sensors/Sensor.h
+69 −0 internal/bhy2-mbed/src/sensors/SensorActivity.h
+53 −0 internal/bhy2-mbed/src/sensors/SensorBSEC.h
+69 −0 internal/bhy2-mbed/src/sensors/SensorClass.cpp
+39 −0 internal/bhy2-mbed/src/sensors/SensorClass.h
+203 −0 internal/bhy2-mbed/src/sensors/SensorID.h
+45 −0 internal/bhy2-mbed/src/sensors/SensorManager.cpp
+22 −0 internal/bhy2-mbed/src/sensors/SensorManager.h
+57 −0 internal/bhy2-mbed/src/sensors/SensorOrientation.h
+54 −0 internal/bhy2-mbed/src/sensors/SensorQuaternion.h
+198 −0 internal/bhy2-mbed/src/sensors/SensorTypes.h
+41 −0 internal/bhy2-mbed/src/sensors/SensorXYZ.h
+9 −0 library.json
5 changes: 3 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@
#define IMU_I2C_SCL SENS2_PIN3
#define IMU_I2C_SDA SENS2_PIN4

extern Mail<ImuDriver::ImuMesurement, 10> imu_sensor_mail_box;
extern Mail<ImuDriver::ImuMeasurement, 10> imu_sensor_mail_box;

const char *imu_sensor_type_string[] = {
"BNO055_ADDR_A",
"BNO055_ADDR_B",
"MPU9250",
"MPU9255",
"BHI260",
"UNKNOWN"};
char imu_description_string[64] = "";

Expand Down Expand Up @@ -91,7 +92,7 @@ void imu_msg_handler() {
osEvent evt2 = imu_sensor_mail_box.get(0);

if (evt2.status == osEventMail) {
ImuDriver::ImuMesurement *message = (ImuDriver::ImuMesurement *)evt2.value.p;
ImuDriver::ImuMeasurement *message = (ImuDriver::ImuMeasurement *)evt2.value.p;
fill_imu_msg(&imu_msg);
imu_msg.orientation.y = message->orientation[1];
imu_msg.orientation.z = message->orientation[2];
Expand Down