Skip to content

Commit

Permalink
Merge pull request #255 from aabadie/xgo
Browse files Browse the repository at this point in the history
projects/03app_xgo: add application to control XGO
  • Loading branch information
aabadie authored May 2, 2024
2 parents e8d74e2 + 435e39a commit b0172dc
Show file tree
Hide file tree
Showing 11 changed files with 509 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
target: ["dotbot-v1", "dotbot-v2", "nrf52833dk", "nrf52840dk", "nrf5340dk-app", "nrf5340dk-net", "sailbot-v1"]
target: ["dotbot-v1", "dotbot-v2", "nrf52833dk", "nrf52840dk", "nrf5340dk-app", "nrf5340dk-net", "sailbot-v1", "xgo-v1", "xgo-v2"]
config: ["Debug", "Release"]
steps:
- name: Checkout repo
Expand Down
29 changes: 22 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,33 +64,41 @@ else ifeq (nrf5340dk-net,$(BUILD_TARGET))
else ifeq (freebot,$(BUILD_TARGET))
PROJECTS ?= 03app_freebot
ARTIFACT_PROJECTS := 03app_dotbot
else ifneq (,$(filter xgo%,$(BUILD_TARGET)))
PROJECTS ?= \
03app_xgo \
#
ARTIFACT_PROJECTS := 03app_xgo
# Bootloader not supported on xgo
BOOTLOADER :=
else
PROJECTS ?= $(shell find projects/ -maxdepth 1 -mindepth 1 -type d | tr -d "/" | sed -e s/projects// | sort)
endif

OTAP_APPS ?= $(shell find otap/ -maxdepth 1 -mindepth 1 -type d | tr -d "/" | sed -e s/otap// | sort)
OTAP_APPS := $(filter-out bootloader,$(OTAP_APPS))

# remove incompatible apps (nrf5340, sailbot gateway) for dotbot (v1, v2) builds
ifneq (,$(filter dotbot-v1,$(BUILD_TARGET)))
PROJECTS := $(filter-out 01bsp_qdec 01drv_lis3mdl 01drv_move 03app_dotbot_gateway 03app_dotbot_gateway_lr 03app_sailbot 03app_nrf5340_% 03app_freebot,$(PROJECTS))
PROJECTS := $(filter-out 01bsp_qdec 01drv_lis3mdl 01drv_move 03app_dotbot_gateway 03app_dotbot_gateway_lr 03app_sailbot 03app_nrf5340_% 03app_freebot 03app_xgo,$(PROJECTS))
ARTIFACT_PROJECTS := 03app_dotbot
endif

ifneq (,$(filter dotbot-v2,$(BUILD_TARGET)))
PROJECTS := $(filter-out 03app_dotbot_gateway 03app_dotbot_gateway_lr 03app_sailbot 03app_nrf5340_net 03app_freebot,$(PROJECTS))
PROJECTS := $(filter-out 03app_dotbot_gateway 03app_dotbot_gateway_lr 03app_sailbot 03app_xgo 03app_nrf5340_net 03app_freebot,$(PROJECTS))
ARTIFACT_PROJECTS := 03app_dotbot
endif

# remove incompatible apps (nrf5340, dotbot, gateway) for sailbot-v1 build
ifeq (sailbot-v1,$(BUILD_TARGET))
PROJECTS := $(filter-out 01bsp_qdec 01drv_lis3mdl 01drv_move 03app_dotbot_gateway 03app_dotbot_gateway_lr 03app_dotbot 03app_nrf5340_% 03app_freebot,$(PROJECTS))
PROJECTS := $(filter-out 01bsp_qdec 01drv_lis3mdl 01drv_move 03app_dotbot_gateway 03app_dotbot_gateway_lr 03app_dotbot 03app_nrf5340_% 03app_freebot 03app_xgo,$(PROJECTS))
ARTIFACT_PROJECTS := 03app_sailbot
endif

ifneq (,$(filter nrf52833dk,$(BUILD_TARGET)))
PROJECTS := $(filter-out 01crypto_%,$(PROJECTS))
endif

# remove incompatible apps (nrf5340) for nrf52833dk/nrf52840dk build
ifneq (,$(filter nrf52833dk nrf52840dk,$(BUILD_TARGET)))
PROJECTS := $(filter-out 01bsp_qdec 01drv_move 03app_nrf5340_% 03app_freebot,$(PROJECTS))
PROJECTS := $(filter-out 01bsp_qdec 01drv_move 03app_nrf5340_% 03app_freebot 03app_xgo,$(PROJECTS))
ARTIFACT_PROJECTS := 03app_dotbot_gateway 03app_dotbot_gateway_lr
endif

Expand All @@ -102,6 +110,13 @@ ifneq (,$(filter nrf5340dk-net,$(BUILD_TARGET)))
ARTIFACT_PROJECTS := 03app_nrf5340_net
endif

ifneq (,$(filter xgo%,$(BUILD_TARGET)))
OTAP_APPS :=
endif

OTAP_APPS ?= $(shell find otap/ -maxdepth 1 -mindepth 1 -type d | tr -d "/" | sed -e s/otap// | sort)
OTAP_APPS := $(filter-out bootloader,$(OTAP_APPS))

SRCS ?= $(shell find bsp/ -name "*.[c|h]") $(shell find crypto/ -name "*.[c|h]") $(shell find drv/ -name "*.[c|h]") $(shell find projects/ -name "*.[c|h]") $(shell find otap/ -name "*.[c|h]")
CLANG_FORMAT ?= clang-format
CLANG_FORMAT_TYPE ?= file
Expand Down
1 change: 1 addition & 0 deletions doc/sphinx/applications.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ _projects/03app_sailbot
_projects/03app_log_dump
_projects/03app_nrf5340_app
_projects/03app_nrf5340_net
_projects/03app_xgo
```
24 changes: 13 additions & 11 deletions drv/protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,26 @@

/// Command type
typedef enum {
DB_PROTOCOL_CMD_MOVE_RAW = 0, ///< Move raw command type
DB_PROTOCOL_CMD_RGB_LED = 1, ///< RGB LED command type
DB_PROTOCOL_LH2_RAW_DATA = 2, ///< Lighthouse 2 raw data
DB_PROTOCOL_LH2_LOCATION = 3, ///< Lighthouse processed locations
DB_PROTOCOL_ADVERTISEMENT = 4, ///< DotBot advertisements
DB_PROTOCOL_GPS_LOCATION = 5, ///< GPS data from SailBot
DB_PROTOCOL_DOTBOT_DATA = 6, ///< DotBot specific data (for now location and direction)
DB_PROTOCOL_CONTROL_MODE = 7, ///< Robot remote control mode (automatic or manual)
DB_PROTOCOL_LH2_WAYPOINTS = 8, ///< List of LH2 waypoints to follow
DB_PROTOCOL_GPS_WAYPOINTS = 9, ///< List of GPS waypoints to follow
DB_PROTOCOL_SAILBOT_DATA = 10, ///< SailBot specific data (for now GPS and direction)
DB_PROTOCOL_CMD_MOVE_RAW = 0, ///< Move raw command type
DB_PROTOCOL_CMD_RGB_LED = 1, ///< RGB LED command type
DB_PROTOCOL_LH2_RAW_DATA = 2, ///< Lighthouse 2 raw data
DB_PROTOCOL_LH2_LOCATION = 3, ///< Lighthouse processed locations
DB_PROTOCOL_ADVERTISEMENT = 4, ///< DotBot advertisements
DB_PROTOCOL_GPS_LOCATION = 5, ///< GPS data from SailBot
DB_PROTOCOL_DOTBOT_DATA = 6, ///< DotBot specific data (for now location and direction)
DB_PROTOCOL_CONTROL_MODE = 7, ///< Robot remote control mode (automatic or manual)
DB_PROTOCOL_LH2_WAYPOINTS = 8, ///< List of LH2 waypoints to follow
DB_PROTOCOL_GPS_WAYPOINTS = 9, ///< List of GPS waypoints to follow
DB_PROTOCOL_SAILBOT_DATA = 10, ///< SailBot specific data (for now GPS and direction)
DB_PROTOCOL_CMD_XGO_ACTION = 11, ///< XGO action command
} command_type_t;

/// Application type
typedef enum {
DotBot = 0, ///< DotBot application
SailBot = 1, ///< SailBot application
FreeBot = 2, ///< FreeBot application
XGO = 3, ///< XGO application
} application_type_t;

/// Control mode
Expand Down
1 change: 1 addition & 0 deletions nrf52833dk.emProject
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,5 @@
<import file_name="projects/projects-log-dump.emProject" />
<import file_name="projects/projects-sailbot.emProject" />
<import file_name="otap/otap.emProject" />
<import file_name="projects/projects-xgo.emProject" />
</solution>
1 change: 1 addition & 0 deletions nrf52840dk.emProject
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,5 @@
<import file_name="projects/projects-log-dump.emProject" />
<import file_name="projects/projects-sailbot.emProject" />
<import file_name="otap/otap.emProject" />
<import file_name="projects/projects-xgo.emProject" />
</solution>
1 change: 1 addition & 0 deletions projects/03app_xgo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# XGO control application
Loading

0 comments on commit b0172dc

Please sign in to comment.