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

New dataman #577

Merged
merged 32 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f6a2a41
Navigator: move disable camera trigger on mission inactivation to sep…
sfuhrer Jun 8, 2023
fa1c886
Mission: reset mission on landing only if last item was reached
sfuhrer Jun 8, 2023
85000da
Navigator: Mission: improve survey mission resume
sfuhrer Jun 8, 2023
8b48b5d
simulator_sih: increase stack size by 310 bytes
Igor-Misic May 11, 2023
8cdd7ef
dataman: refactoring _file_initialize
Igor-Misic May 11, 2023
4ba99d6
dataman: add DatamanClient with sync functions
Igor-Misic May 9, 2023
3797eee
datamanClient: add async functions
Igor-Misic May 9, 2023
79489e4
datamanClient: add DatamanCache class
Igor-Misic May 4, 2023
330f6cd
datamanClient: add Doxygen documentation for the API.
Igor-Misic May 4, 2023
039c46a
mission: integrate dataman cache
Igor-Misic May 10, 2023
44796e9
dataman_client: prevent loading duplicates in the cache
Igor-Misic May 3, 2023
32dc203
geofence: integrate dataman cache
Igor-Misic May 10, 2023
b5394f0
rtl: integrate dataman cache
Igor-Misic May 9, 2023
af208f9
dataman_client: increase px4_poll timeout to 100_ms
Igor-Misic May 8, 2023
ebeda35
mavlink_mission: remove locking mechanism
Igor-Misic May 10, 2023
ca6602a
mavlink_mission & mission: move dataman update to mission
Igor-Misic May 10, 2023
e5cbd05
dataman: remove locking mechanism
Igor-Misic May 19, 2023
e153e11
dataman: add perf_counter
Igor-Misic May 12, 2023
ac4a13d
GeofenceBreachAvoidanceTest: bug fix
Igor-Misic May 16, 2023
2ce6d0c
dataman: update compat version
Igor-Misic May 17, 2023
465a155
boards: remove camera capture and trigger from test builds
Igor-Misic May 17, 2023
574e693
dataman: add guards for max item value
Igor-Misic May 19, 2023
03991b0
ci: allow tests dataman to pass
Igor-Misic May 22, 2023
e4f06bb
navigator: use mission topic to notify about geofence & safe point ch…
bkueng Jun 15, 2023
53af10a
navigator: defer saving mission until disarmed
bkueng Jun 15, 2023
9099352
boards/diatone/mamba-f405-mk2: disable modules to reduce flash
bkueng Jun 16, 2023
68ab1d3
boards/px4/fmu-v5/test: disable modules to reduce flash
bkueng Jun 16, 2023
b2f7ef5
HIL: add --ignore-stdout-errors to run_nsh_cmd.py and use for 'tests …
bkueng Jun 19, 2023
f702d48
fix dataman: treat 0 as valid return for read & ensure to init buffer
bkueng Jun 19, 2023
ac8324f
mision: only run mission feasibility checks when mission updated
bkueng Jun 22, 2023
64762fe
px4/fmu-v6x: disable batt_smbus for now to reduce flash
bkueng Jul 24, 2023
bd6ac83
lib/dataman: Port dataman/datamanclient to new uORB
pussuw Dec 7, 2023
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
4 changes: 2 additions & 2 deletions .ci/Jenkinsfile-hardware
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ pipeline {
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "sd_stress"'

// test dataman
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "tests dataman"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "tests dataman" --ignore-stdout-errors'

sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "tests file" || true'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "uorb_tests"'
Expand Down Expand Up @@ -449,7 +449,7 @@ pipeline {
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "uorb_tests latency_test" || true'

// test dataman
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "tests dataman"'
sh './Tools/HIL/run_nsh_cmd.py --device `find /dev/serial -name *usb-*` --cmd "tests dataman" --ignore-stdout-errors'
}
}
stage("status") {
Expand Down
1 change: 1 addition & 0 deletions ROMFS/px4fmu_common/init.d/airframes/2106_albatross
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# @maintainer Andreas Antener <[email protected]>
#
# @board bitcraze_crazyflie exclude
# @board diatone_mamba-f405-mk2 exclude
#

. ${R}etc/init.d/rc.fw_defaults
Expand Down
1 change: 1 addition & 0 deletions ROMFS/px4fmu_common/init.d/airframes/4900_crazyflie
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# @board px4_fmu-v4pro exclude
# @board px4_fmu-v5 exclude
# @board px4_fmu-v5x exclude
# @board diatone_mamba-f405-mk2 exclude
#
. ${R}etc/init.d/rc.mc_defaults

Expand Down
1 change: 1 addition & 0 deletions ROMFS/px4fmu_common/init.d/airframes/4901_crazyflie21
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# @board px4_fmu-v4pro exclude
# @board px4_fmu-v5 exclude
# @board px4_fmu-v5x exclude
# @board diatone_mamba-f405-mk2 exclude
#
. ${R}etc/init.d/rc.mc_defaults

Expand Down
8 changes: 5 additions & 3 deletions Tools/HIL/run_nsh_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def print_line(line):
print('{0}'.format(line), end='')


def do_nsh_cmd(port_url, baudrate, cmd):
def do_nsh_cmd(port_url, baudrate, cmd, ignore_stdout_errors=False):
ser = serial.serial_for_url(url=port_url, baudrate=baudrate, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, timeout=1, xonxoff=False, rtscts=False, dsrdtr=False, inter_byte_timeout=1)

timeout_start = time.monotonic()
Expand Down Expand Up @@ -106,7 +106,7 @@ def do_nsh_cmd(port_url, baudrate, cmd):
if success_cmd in serial_line:
sys.exit(return_code)
else:
if "ERROR " in serial_line:
if "ERROR " in serial_line and not ignore_stdout_errors:
return_code = -1

print_line(serial_line)
Expand Down Expand Up @@ -148,14 +148,16 @@ def main():
parser.add_argument('--device', "-d", nargs='?', default=default_device, help='', required=device_required)
parser.add_argument("--baudrate", "-b", dest="baudrate", type=int, help="serial port baud rate (default=57600)", default=57600)
parser.add_argument("--cmd", "-c", dest="cmd", help="Command to run")
parser.add_argument('--ignore-stdout-errors', action='store_true',
help='Ignore errors printed to stdout')
args = parser.parse_args()

tmp_file = "{0}/pyserial_spy_file.txt".format(tempfile.gettempdir())
port_url = "spy://{0}?file={1}".format(args.device, tmp_file)

print("pyserial url: {0}".format(port_url))

do_nsh_cmd(port_url, args.baudrate, args.cmd)
do_nsh_cmd(port_url, args.baudrate, args.cmd, args.ignore_stdout_errors)

if __name__ == "__main__":
main()
1 change: 0 additions & 1 deletion boards/diatone/mamba-f405-mk2/default.px4board
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ CONFIG_MODULES_NAVIGATOR=y
CONFIG_MODULES_RC_UPDATE=y
CONFIG_MODULES_SENSORS=y
CONFIG_SYSTEMCMDS_DMESG=y
CONFIG_SYSTEMCMDS_MFT=y
CONFIG_SYSTEMCMDS_MTD=y
CONFIG_SYSTEMCMDS_NSHTERM=y
CONFIG_SYSTEMCMDS_PARAM=y
Expand Down
2 changes: 2 additions & 0 deletions boards/px4/fmu-v4/test.px4board
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
CONFIG_DRIVERS_ADC_ADS1115=n
CONFIG_DRIVERS_CAMERA_CAPTURE=n
CONFIG_DRIVERS_CAMERA_TRIGGER=n
CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=n
CONFIG_DRIVERS_IRLOCK=n
CONFIG_DRIVERS_PCA9685_PWM_OUT=n
Expand Down
5 changes: 5 additions & 0 deletions boards/px4/fmu-v5/test.px4board
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
CONFIG_DRIVERS_ADC_ADS1115=n
CONFIG_DRIVERS_BATT_SMBUS=n
CONFIG_DRIVERS_CAMERA_CAPTURE=n
CONFIG_DRIVERS_CAMERA_TRIGGER=n
CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=n
CONFIG_DRIVERS_IRLOCK=n
CONFIG_DRIVERS_PCA9685_PWM_OUT=n
Expand All @@ -14,3 +17,5 @@ CONFIG_MODULES_FW_ATT_CONTROL=n
CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=n
CONFIG_MODULES_FW_POS_CONTROL=n
CONFIG_MODULES_FW_RATE_CONTROL=n
CONFIG_DRIVERS_UAVCAN=n

2 changes: 2 additions & 0 deletions boards/px4/fmu-v5x/test.px4board
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ CONFIG_COMMON_DISTANCE_SENSOR=n
CONFIG_COMMON_INS=n
CONFIG_COMMON_TELEMETRY=n
CONFIG_DRIVERS_ADC_ADS1115=n
CONFIG_DRIVERS_CAMERA_CAPTURE=n
CONFIG_DRIVERS_CAMERA_TRIGGER=n
CONFIG_DRIVERS_IMU_ANALOG_DEVICES_ADIS16448=n
CONFIG_DRIVERS_IRLOCK=n
CONFIG_MODULES_FW_AUTOTUNE_ATTITUDE_CONTROL=n
Expand Down
1 change: 0 additions & 1 deletion boards/px4/fmu-v6x/default.px4board
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ CONFIG_DRIVERS_ADC_BOARD_ADC=y
CONFIG_DRIVERS_BAROMETER_BMP388=y
CONFIG_DRIVERS_BAROMETER_INVENSENSE_ICP201XX=y
CONFIG_DRIVERS_BAROMETER_MS5611=y
CONFIG_DRIVERS_BATT_SMBUS=y
CONFIG_DRIVERS_CAMERA_CAPTURE=y
CONFIG_DRIVERS_CAMERA_TRIGGER=y
CONFIG_COMMON_DIFFERENTIAL_PRESSURE=y
Expand Down
2 changes: 2 additions & 0 deletions msg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ set(msg_files
CollisionReport.msg
ControlAllocatorStatus.msg
Cpuload.msg
DatamanRequest.msg
DatamanResponse.msg
DebugArray.msg
DebugKeyValue.msg
DebugValue.msg
Expand Down
8 changes: 8 additions & 0 deletions msg/DatamanRequest.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
uint64 timestamp # time since system start (microseconds)

uint8 client_id
uint8 request_type # id/read/write/clear
uint8 item # dm_item_t
uint32 index
uint8[56] data
uint32 data_length
15 changes: 15 additions & 0 deletions msg/DatamanResponse.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
uint64 timestamp # time since system start (microseconds)

uint8 client_id
uint8 request_type # id/read/write/clear
uint8 item # dm_item_t
uint32 index
uint8[56] data

uint8 STATUS_SUCCESS = 0
uint8 STATUS_FAILURE_ID_ERR = 1
uint8 STATUS_FAILURE_NO_DATA = 2
uint8 STATUS_FAILURE_READ_FAILED = 3
uint8 STATUS_FAILURE_WRITE_FAILED = 4
uint8 STATUS_FAILURE_CLEAR_FAILED = 5
uint8 status
4 changes: 4 additions & 0 deletions msg/Mission.msg
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ uint8 dataman_id # default 0, there are two offboard storage places in the datam

uint16 count # count of the missions stored in the dataman
int32 current_seq # default -1, start at the one changed latest

int16 mission_update_counter # indicates updates to the mission, reload from dataman if increased
int16 geofence_update_counter # indicates updates to the geofence, reload from dataman if increased
int16 safe_points_update_counter # indicates updates to the safe points, reload from dataman if increased
1 change: 1 addition & 0 deletions src/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ add_subdirectory(controllib EXCLUDE_FROM_ALL)
add_subdirectory(conversion EXCLUDE_FROM_ALL)
add_subdirectory(crc EXCLUDE_FROM_ALL)
add_subdirectory(crypto EXCLUDE_FROM_ALL)
add_subdirectory(dataman_client EXCLUDE_FROM_ALL)
add_subdirectory(drivers EXCLUDE_FROM_ALL)
add_subdirectory(field_sensor_bias_estimator EXCLUDE_FROM_ALL)
add_subdirectory(geo EXCLUDE_FROM_ALL)
Expand Down
34 changes: 34 additions & 0 deletions src/lib/dataman_client/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
############################################################################
#
# Copyright (c) 2023 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.
#
############################################################################

px4_add_library(dataman_client DatamanClient.cpp)
Loading