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

sbgecom: Implement sbgECom INS driver #24137

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
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
1 change: 0 additions & 1 deletion boards/cubepilot/cubeorangeplus/default.px4board
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ CONFIG_DRIVERS_IMU_INVENSENSE_ICM20649=y
CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=y
CONFIG_DRIVERS_IMU_INVENSENSE_ICM42688P=y
CONFIG_DRIVERS_IMU_INVENSENSE_ICM45686=y
CONFIG_COMMON_INS=y
CONFIG_DRIVERS_IRLOCK=y
CONFIG_COMMON_LIGHT=y
CONFIG_COMMON_MAGNETOMETER=y
Expand Down
1 change: 0 additions & 1 deletion boards/px4/fmu-v6c/default.px4board
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ CONFIG_DRIVERS_HEATER=y
CONFIG_DRIVERS_IMU_BOSCH_BMI055=y
CONFIG_DRIVERS_IMU_BOSCH_BMI088=y
CONFIG_DRIVERS_IMU_INVENSENSE_ICM42688P=y
CONFIG_COMMON_INS=y
CONFIG_COMMON_LIGHT=y
CONFIG_COMMON_MAGNETOMETER=y
CONFIG_COMMON_OPTICAL_FLOW=y
Expand Down
2 changes: 2 additions & 0 deletions src/drivers/drv_sensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@
#define DRV_BARO_DEVTYPE_AUAV 0xE7
#define DRV_BARO_DEVTYPE_SPA06 0xE8

#define DRV_INS_DEVTYPE_SBG 0xE9

#define DRV_DEVTYPE_UNUSED 0xff

#endif /* _DRV_SENSOR_H */
1 change: 1 addition & 0 deletions src/drivers/ins/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ menu "Inertial Navigation Systems (INS)"
bool "All INS sensors"
default n
select DRIVERS_INS_VECTORNAV
select DRIVERS_INS_SBGECOM
---help---
Enable default set of INS sensors
rsource "*/Kconfig"
Expand Down
60 changes: 60 additions & 0 deletions src/drivers/ins/sbgecom/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
############################################################################
#
# Copyright (c) 2022 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name PX4 nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################

include(FetchContent)

FetchContent_Declare(
sbgECom
GIT_REPOSITORY https://github.com/SBG-Systems/sbgECom.git
GIT_TAG 5.1.708-stable
GIT_SHALLOW TRUE
PATCH_COMMAND git apply --reverse --check "${CMAKE_CURRENT_LIST_DIR}/sbgecom.patch" || git apply --ignore-whitespace "${CMAKE_CURRENT_LIST_DIR}/sbgecom.patch"
)

FetchContent_MakeAvailable(sbgECom)

px4_add_module(
MODULE drivers__ins__sbgecom
MAIN sbgecom
INCLUDES
${sbgECom_SOURCE_DIR}/common
${sbgECom_SOURCE_DIR}/src
COMPILE_FLAGS
SRCS
sbgecom.cpp
sbgecom.hpp
MODULE_CONFIG
module.yaml
DEPENDS
sbgECom
)
5 changes: 5 additions & 0 deletions src/drivers/ins/sbgecom/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
menuconfig DRIVERS_INS_SBGECOM
bool "sbgecom"
default n
---help---
Enable support for sbgecom
50 changes: 50 additions & 0 deletions src/drivers/ins/sbgecom/module.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
module_name: sbgECom

serial_config:
- command: sbgecom start -d ${SERIAL_DEV}
port_config_param:
name: SENS_SBG_CFG
group: Sensors

parameters:
- group: Sensors
definitions:
SBG_MODE:
description:
short: sbgECom driver mode
long: |
Modes available for sbgECom driver.
In Sensors Only mode, use external IMU and magnetometer.
In GNSS mode, use external GNSS in addition to sensors only mode.
In INS mode, use external Kalman Filter in addition to GNSS mode.

In INS mode, requires EKF2_EN 0. Keeping both enabled
can lead to an unexpected behavior and vehicle instability.
category: System
type: enum
values:
0: Sensors Only (default)
1: GNSS
2: INS
default: 0
SBG_BAUDRATE:
description:
short: sbgECom driver baudrate
long: |
Baudrate used by default for serial communication between PX4
and SBG Systems INS through sbgECom driver.
category: System
type: int32
min: 9600
max: 921600
default: 921600
reboot_required: true
SBG_CONFIGURE_EN:
description:
short: sbgECom driver INS configuration enable
long: |
Enable SBG Systems INS configuration through sbgECom driver
on start.
category: System
type: boolean
default: 0
Loading
Loading