Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/github_actions/actions/cache-4
Browse files Browse the repository at this point in the history
  • Loading branch information
sbmueller authored Nov 5, 2024
2 parents 252d2ec + c74add6 commit 30b1a1d
Show file tree
Hide file tree
Showing 878 changed files with 4,042 additions and 850 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/c.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
apt-get -qq update
apt-get -qq install libeigen3-dev libserialport-dev git cmake build-essential ${{ matrix.compiler.package }}
- uses: actions/checkout@v4
- uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0
Expand Down
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
# Changelog

## [v6.2.1](https://github.com/swift-nav/libsbp/tree/v6.2.1)

[Full Changelog](https://github.com/swift-nav/libsbp/compare/v6.2.0...v6.2.1)

**Merged pull requests:**

- put the cargo dep in the right place [\#1456](https://github.com/swift-nav/libsbp/pull/1456) ([pcrumley](https://github.com/pcrumley))
- Upgrade Haskel version [\#1454](https://github.com/swift-nav/libsbp/pull/1454) ([RReichert](https://github.com/RReichert))
- cover CI hole which appears to be hiding a proc\_macro bindgen bug [\#1452](https://github.com/swift-nav/libsbp/pull/1452) ([pcrumley](https://github.com/pcrumley))
- bumping to latest version of libswiftnav [\#1451](https://github.com/swift-nav/libsbp/pull/1451) ([pcrumley](https://github.com/pcrumley))


## [v6.2.0](https://github.com/swift-nav/libsbp/tree/v6.2.0)

[Full Changelog](https://github.com/swift-nav/libsbp/compare/v6.1.0...v6.2.0)

**Merged pull requests:**

- Add inertially to the spelling wordlist [\#1450](https://github.com/swift-nav/libsbp/pull/1450) ([Madhunika-atmakuri](https://github.com/Madhunika-atmakuri))
- Add support for 99.73 confidence interval [\#1449](https://github.com/swift-nav/libsbp/pull/1449) ([ismolyakov](https://github.com/ismolyakov))
- get the automated generation of test cases working again (https://github.com/swift-nav/libsbp/pull/1448) ([pcrumley](https://github.com/pcrumley))
- Add compensated IMU message [\#1446](https://github.com/swift-nav/libsbp/pull/1446) ([ismolyakov](https://github.com/ismolyakov))
- Documentation fixes after the removal of the legacy C API [\#1439](https://github.com/swift-nav/libsbp/pull/1439) ([dgburr](https://github.com/dgburr))
- Pcrumley/update actions [\#1435](https://github.com/swift-nav/libsbp/pull/1435) ([pcrumley](https://github.com/pcrumley))
- Pcrumley/update actions [\#1428](https://github.com/swift-nav/libsbp/pull/1428) ([pcrumley](https://github.com/pcrumley))
- Auto submodule update: cmake - Update compiler options to support IAR \(\#175\) [\#1418](https://github.com/swift-nav/libsbp/pull/1418) ([swiftnav-svc-jenkins](https://github.com/swiftnav-svc-jenkins))

## [v6.1.0](https://github.com/swift-nav/libsbp/tree/v6.1.0)

[Full Changelog](https://github.com/swift-nav/libsbp/compare/v6.0.1...v6.1.0)
Expand Down
14 changes: 11 additions & 3 deletions HOWTO.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ python missing.py --host [HOST] --port [PORT]

### New Messages
The `json2test` script can be used to automatically generate tests for newly
defined messages.
defined messages. The json2test script uses [uv](https://docs.astral.sh/uv/) to
manage its dependencies, which can be installed following the instructions on that
website

To use `json2test` a JSON file should be hand written with example contents of a
message. For example, to generate tests for the `MSG_HEARTBEAT` message (which
Expand All @@ -105,13 +107,19 @@ form:
And then generate a test for using `json2test` with:

```shell
PYTHONPATH="python/" python generator/json2test.py --input heartbeat.json --output spec/tests/yaml/swiftnav/sbp/system/test_MsgHeartbeat.yaml
uv -n run json2test.py --input heartbeat.json --output ../spec/tests/yaml/swiftnav/sbp/system/test_MsgHeartbeat.yaml
```

*NOTE* because the json2test file imports the local version of sbp & the build
system of it all is a little slapdash, this command will ONLY work if called from
inside of `libsbp/generator/` directory because the `${PROJECT_ROOT}` in the script
declartion of json2test.py is whatever the PWD is when the command is called, and
caching is turned off.

Usage for `json2test`

```shell
python json2test --input [PATH_TO_JSON_IN] --output [PATH_TO_YAML_OUT]
uv -n run json2test --input [PATH_TO_JSON_IN] --output [PATH_TO_YAML_OUT]
```

* The `msg_type` can also be provided through a CLI parameter, with `--msg-id
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* [Installing development Python versions](#installing-development-python-versions)
* [Adding development version as a pip dependency](#adding-development-version-as-a-pip-dependency)
* [Installing from source](#installing-from-source)
- [SBP Development Procedures](#sbp-development-procedures)
- [SBP Development Procedures](#sbp-development-procedures)
- [SBP Protocol Specification](#sbp-protocol-specification)
- [JSON Schema Definitions](#json-schema-definitions)
- [Kaitai Struct Format Descriptions](#kaitai-struct-format-descriptions)
Expand Down Expand Up @@ -102,7 +102,7 @@ but works on all platforms that Python itself supports.

## Building / installing

Before you start, run
Before you start, run
```
git pull --tags
```
Expand Down Expand Up @@ -151,7 +151,9 @@ You can then make this image operate on your local workspace like this:

#### Using the docker image

Once in the image, simply type `make all` to generate all the libsbp bindings.
Once in the image, to overcome issues with git trying to determine ownership of
the repository, run `git config --global --add safe.directory /mnt/workspace`.
Then, simply type `make all` to generate all the libsbp bindings.
This could take several hours to run. Alternately, the docker image will run
the `make all` command by default, so you can kick off the `make all` process
by simply running the following command:
Expand Down
2 changes: 1 addition & 1 deletion c/cmake/common
33 changes: 33 additions & 0 deletions c/include/libsbp/cpp/message_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -3527,6 +3527,39 @@ struct MessageTraits<sbp_msg_imu_aux_t> {
}
};

template <>
struct MessageTraits<sbp_msg_imu_comp_t> {
static constexpr sbp_msg_type_t id = SbpMsgImuComp;
static constexpr const char *name = "MSG_IMU_COMP";
static const sbp_msg_imu_comp_t &get(const sbp_msg_t &msg) {
return msg.imu_comp;
}
static sbp_msg_imu_comp_t &get(sbp_msg_t &msg) { return msg.imu_comp; }
static void to_sbp_msg(const sbp_msg_imu_comp_t &msg, sbp_msg_t *sbp_msg) {
sbp_msg->imu_comp = msg;
}
static sbp_msg_t to_sbp_msg(const sbp_msg_imu_comp_t &msg) {
sbp_msg_t sbp_msg;
sbp_msg.imu_comp = msg;
return sbp_msg;
}
static s8 send(sbp_state_t *state, u16 sender_id,
const sbp_msg_imu_comp_t &msg, sbp_write_fn_t write) {
return sbp_msg_imu_comp_send(state, sender_id, &msg, write);
}
static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written,
const sbp_msg_imu_comp_t &msg) {
return sbp_msg_imu_comp_encode(buf, len, n_written, &msg);
}
static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read,
sbp_msg_imu_comp_t *msg) {
return sbp_msg_imu_comp_decode(buf, len, n_read, msg);
}
static size_t encoded_len(const sbp_msg_imu_comp_t &msg) {
return sbp_msg_imu_comp_encoded_len(&msg);
}
};

template <>
struct MessageTraits<sbp_msg_imu_raw_t> {
static constexpr sbp_msg_type_t id = SbpMsgImuRaw;
Expand Down
1 change: 1 addition & 0 deletions c/include/libsbp/imu.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#ifndef LIBSBP_IMU_MESSAGES_H
#define LIBSBP_IMU_MESSAGES_H
#include <libsbp/imu/MSG_IMU_AUX.h>
#include <libsbp/imu/MSG_IMU_COMP.h>
#include <libsbp/imu/MSG_IMU_RAW.h>

#endif /* LIBSBP_IMU_MESSAGES_H */
215 changes: 215 additions & 0 deletions c/include/libsbp/imu/MSG_IMU_COMP.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
/*
* Copyright (C) 2015-2021 Swift Navigation Inc.
* Contact: https://support.swiftnav.com
*
* This source is subject to the license found in the file 'LICENSE' which must
* be distributed together with this source. All other rights reserved.
*
* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
* EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
*/

/*****************************************************************************
* Automatically generated from yaml/swiftnav/sbp/imu.yaml
* with generate.py. Please do not hand edit!
*****************************************************************************/

#ifndef LIBSBP_IMU_MSG_IMU_COMP_H
#define LIBSBP_IMU_MSG_IMU_COMP_H

#include <math.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>

#include <libsbp/common.h>
#include <libsbp/imu_macros.h>
#include <libsbp/string/sbp_string.h>

#ifdef __cplusplus
extern "C" {
#endif

/******************************************************************************
*
* SBP_MSG_IMU_COMP
*
*****************************************************************************/
/** Compensated IMU data
*
* Data from the Inertial Measurement Unit, containing accelerometer and
* gyroscope readings compensated for estimated errors and constant physical
* effects. The output is valid for inertially referenced center of navigation
* (IMU body frame) represented in vehicle body frame.
*/
typedef struct {
/**
* Microseconds since reference epoch [microseconds]
*/
u64 time;

/**
* Contains the applied compensation parameters and time synchronization mode
*/
u16 flags;

/**
* Compensated acceleration X axis [1e-6 m/s^2]
*/
s32 acc_comp_x;

/**
* Compensated acceleration Y axis [1e-6 m/s^2]
*/
s32 acc_comp_y;

/**
* Compensated acceleration Z axis [1e-6 m/s^2]
*/
s32 acc_comp_z;

/**
* Compensated angular rate X axis [1e-6 deg/s]
*/
s32 gyr_comp_x;

/**
* Compensated angular rate Y axis [1e-6 deg/s]
*/
s32 gyr_comp_y;

/**
* Compensated angular rate Z axis [1e-6 deg/s]
*/
s32 gyr_comp_z;
} sbp_msg_imu_comp_t;

/**
* Get encoded size of an instance of sbp_msg_imu_comp_t
*
* @param msg sbp_msg_imu_comp_t instance
* @return Length of on-wire representation
*/
static inline size_t sbp_msg_imu_comp_encoded_len(
const sbp_msg_imu_comp_t *msg) {
(void)msg;
return SBP_MSG_IMU_COMP_ENCODED_LEN;
}

/**
* Encode an instance of sbp_msg_imu_comp_t to wire representation
*
* This function encodes the given instance in to the user provided buffer. The
* buffer provided to this function must be large enough to store the encoded
* message otherwise it will return SBP_ENCODE_ERROR without writing anything to
* the buffer.
*
* Specify the length of the destination buffer in the \p len parameter. If
* non-null the number of bytes written to the buffer will be returned in \p
* n_written.
*
* @param buf Destination buffer
* @param len Length of \p buf
* @param n_written If not null, on success will be set to the number of bytes
* written to \p buf
* @param msg Instance of sbp_msg_imu_comp_t to encode
* @return SBP_OK on success, or other libsbp error code
*/
SBP_EXPORT s8 sbp_msg_imu_comp_encode(uint8_t *buf, uint8_t len,
uint8_t *n_written,
const sbp_msg_imu_comp_t *msg);

/**
* Decode an instance of sbp_msg_imu_comp_t from wire representation
*
* This function decodes the wire representation of a sbp_msg_imu_comp_t message
* to the given instance. The caller must specify the length of the buffer in
* the \p len parameter. If non-null the number of bytes read from the buffer
* will be returned in \p n_read.
*
* @param buf Wire representation of the sbp_msg_imu_comp_t instance
* @param len Length of \p buf
* @param n_read If not null, on success will be set to the number of bytes read
* from \p buf
* @param msg Destination
* @return SBP_OK on success, or other libsbp error code
*/
SBP_EXPORT s8 sbp_msg_imu_comp_decode(const uint8_t *buf, uint8_t len,
uint8_t *n_read, sbp_msg_imu_comp_t *msg);
/**
* Send an instance of sbp_msg_imu_comp_t with the given write function
*
* An equivalent of #sbp_message_send which operates specifically on
* sbp_msg_imu_comp_t
*
* The given message will be encoded to wire representation and passed in to the
* given write function callback. The write callback will be called several
* times for each invocation of this function.
*
* @param s SBP state
* @param sender_id SBP sender id
* @param msg Message to send
* @param write Write function
* @return SBP_OK on success, or other libsbp error code
*/
SBP_EXPORT s8 sbp_msg_imu_comp_send(sbp_state_t *s, u16 sender_id,
const sbp_msg_imu_comp_t *msg,
sbp_write_fn_t write);

/**
* Compare two instances of sbp_msg_imu_comp_t
*
* The two instances will be compared and a value returned consistent with the
* return codes of comparison functions from the C standard library
*
* 0 will be returned if \p a and \p b are considered equal
* A value less than 0 will be returned if \p a is considered to be less than \p
* b A value greater than 0 will be returned if \p b is considered to be greater
* than \p b
*
* @param a sbp_msg_imu_comp_t instance
* @param b sbp_msg_imu_comp_t instance
* @return 0, <0, >0
*/
SBP_EXPORT int sbp_msg_imu_comp_cmp(const sbp_msg_imu_comp_t *a,
const sbp_msg_imu_comp_t *b);

#ifdef __cplusplus
}

static inline bool operator==(const sbp_msg_imu_comp_t &lhs,
const sbp_msg_imu_comp_t &rhs) {
return sbp_msg_imu_comp_cmp(&lhs, &rhs) == 0;
}

static inline bool operator!=(const sbp_msg_imu_comp_t &lhs,
const sbp_msg_imu_comp_t &rhs) {
return sbp_msg_imu_comp_cmp(&lhs, &rhs) != 0;
}

static inline bool operator<(const sbp_msg_imu_comp_t &lhs,
const sbp_msg_imu_comp_t &rhs) {
return sbp_msg_imu_comp_cmp(&lhs, &rhs) < 0;
}

static inline bool operator<=(const sbp_msg_imu_comp_t &lhs,
const sbp_msg_imu_comp_t &rhs) {
return sbp_msg_imu_comp_cmp(&lhs, &rhs) <= 0;
}

static inline bool operator>(const sbp_msg_imu_comp_t &lhs,
const sbp_msg_imu_comp_t &rhs) {
return sbp_msg_imu_comp_cmp(&lhs, &rhs) > 0;
}

static inline bool operator>=(const sbp_msg_imu_comp_t &lhs,
const sbp_msg_imu_comp_t &rhs) {
return sbp_msg_imu_comp_cmp(&lhs, &rhs) >= 0;
}

#endif // ifdef __cplusplus

#endif /* LIBSBP_IMU_MSG_IMU_COMP_H */
Loading

0 comments on commit 30b1a1d

Please sign in to comment.