Skip to content

Commit 30b1a1d

Browse files
authored
Merge branch 'master' into dependabot/github_actions/actions/cache-4
2 parents 252d2ec + c74add6 commit 30b1a1d

File tree

878 files changed

+4042
-850
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

878 files changed

+4042
-850
lines changed

.github/workflows/c.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
apt-get -qq update
4848
apt-get -qq install libeigen3-dev libserialport-dev git cmake build-essential ${{ matrix.compiler.package }}
4949
50-
- uses: actions/checkout@v4
50+
- uses: actions/checkout@v2
5151
with:
5252
submodules: recursive
5353
fetch-depth: 0

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
11
# Changelog
22

3+
## [v6.2.1](https://github.com/swift-nav/libsbp/tree/v6.2.1)
4+
5+
[Full Changelog](https://github.com/swift-nav/libsbp/compare/v6.2.0...v6.2.1)
6+
7+
**Merged pull requests:**
8+
9+
- put the cargo dep in the right place [\#1456](https://github.com/swift-nav/libsbp/pull/1456) ([pcrumley](https://github.com/pcrumley))
10+
- Upgrade Haskel version [\#1454](https://github.com/swift-nav/libsbp/pull/1454) ([RReichert](https://github.com/RReichert))
11+
- 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))
12+
- bumping to latest version of libswiftnav [\#1451](https://github.com/swift-nav/libsbp/pull/1451) ([pcrumley](https://github.com/pcrumley))
13+
14+
15+
## [v6.2.0](https://github.com/swift-nav/libsbp/tree/v6.2.0)
16+
17+
[Full Changelog](https://github.com/swift-nav/libsbp/compare/v6.1.0...v6.2.0)
18+
19+
**Merged pull requests:**
20+
21+
- Add inertially to the spelling wordlist [\#1450](https://github.com/swift-nav/libsbp/pull/1450) ([Madhunika-atmakuri](https://github.com/Madhunika-atmakuri))
22+
- Add support for 99.73 confidence interval [\#1449](https://github.com/swift-nav/libsbp/pull/1449) ([ismolyakov](https://github.com/ismolyakov))
23+
- get the automated generation of test cases working again (https://github.com/swift-nav/libsbp/pull/1448) ([pcrumley](https://github.com/pcrumley))
24+
- Add compensated IMU message [\#1446](https://github.com/swift-nav/libsbp/pull/1446) ([ismolyakov](https://github.com/ismolyakov))
25+
- Documentation fixes after the removal of the legacy C API [\#1439](https://github.com/swift-nav/libsbp/pull/1439) ([dgburr](https://github.com/dgburr))
26+
- Pcrumley/update actions [\#1435](https://github.com/swift-nav/libsbp/pull/1435) ([pcrumley](https://github.com/pcrumley))
27+
- Pcrumley/update actions [\#1428](https://github.com/swift-nav/libsbp/pull/1428) ([pcrumley](https://github.com/pcrumley))
28+
- 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))
29+
330
## [v6.1.0](https://github.com/swift-nav/libsbp/tree/v6.1.0)
431

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

HOWTO.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ python missing.py --host [HOST] --port [PORT]
8787

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

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

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

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

113121
```shell
114-
python json2test --input [PATH_TO_JSON_IN] --output [PATH_TO_YAML_OUT]
122+
uv -n run json2test --input [PATH_TO_JSON_IN] --output [PATH_TO_YAML_OUT]
115123
```
116124

117125
* The `msg_type` can also be provided through a CLI parameter, with `--msg-id

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* [Installing development Python versions](#installing-development-python-versions)
1313
* [Adding development version as a pip dependency](#adding-development-version-as-a-pip-dependency)
1414
* [Installing from source](#installing-from-source)
15-
- [SBP Development Procedures](#sbp-development-procedures)
15+
- [SBP Development Procedures](#sbp-development-procedures)
1616
- [SBP Protocol Specification](#sbp-protocol-specification)
1717
- [JSON Schema Definitions](#json-schema-definitions)
1818
- [Kaitai Struct Format Descriptions](#kaitai-struct-format-descriptions)
@@ -102,7 +102,7 @@ but works on all platforms that Python itself supports.
102102

103103
## Building / installing
104104

105-
Before you start, run
105+
Before you start, run
106106
```
107107
git pull --tags
108108
```
@@ -151,7 +151,9 @@ You can then make this image operate on your local workspace like this:
151151

152152
#### Using the docker image
153153

154-
Once in the image, simply type `make all` to generate all the libsbp bindings.
154+
Once in the image, to overcome issues with git trying to determine ownership of
155+
the repository, run `git config --global --add safe.directory /mnt/workspace`.
156+
Then, simply type `make all` to generate all the libsbp bindings.
155157
This could take several hours to run. Alternately, the docker image will run
156158
the `make all` command by default, so you can kick off the `make all` process
157159
by simply running the following command:

c/include/libsbp/cpp/message_traits.h

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3527,6 +3527,39 @@ struct MessageTraits<sbp_msg_imu_aux_t> {
35273527
}
35283528
};
35293529

3530+
template <>
3531+
struct MessageTraits<sbp_msg_imu_comp_t> {
3532+
static constexpr sbp_msg_type_t id = SbpMsgImuComp;
3533+
static constexpr const char *name = "MSG_IMU_COMP";
3534+
static const sbp_msg_imu_comp_t &get(const sbp_msg_t &msg) {
3535+
return msg.imu_comp;
3536+
}
3537+
static sbp_msg_imu_comp_t &get(sbp_msg_t &msg) { return msg.imu_comp; }
3538+
static void to_sbp_msg(const sbp_msg_imu_comp_t &msg, sbp_msg_t *sbp_msg) {
3539+
sbp_msg->imu_comp = msg;
3540+
}
3541+
static sbp_msg_t to_sbp_msg(const sbp_msg_imu_comp_t &msg) {
3542+
sbp_msg_t sbp_msg;
3543+
sbp_msg.imu_comp = msg;
3544+
return sbp_msg;
3545+
}
3546+
static s8 send(sbp_state_t *state, u16 sender_id,
3547+
const sbp_msg_imu_comp_t &msg, sbp_write_fn_t write) {
3548+
return sbp_msg_imu_comp_send(state, sender_id, &msg, write);
3549+
}
3550+
static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written,
3551+
const sbp_msg_imu_comp_t &msg) {
3552+
return sbp_msg_imu_comp_encode(buf, len, n_written, &msg);
3553+
}
3554+
static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read,
3555+
sbp_msg_imu_comp_t *msg) {
3556+
return sbp_msg_imu_comp_decode(buf, len, n_read, msg);
3557+
}
3558+
static size_t encoded_len(const sbp_msg_imu_comp_t &msg) {
3559+
return sbp_msg_imu_comp_encoded_len(&msg);
3560+
}
3561+
};
3562+
35303563
template <>
35313564
struct MessageTraits<sbp_msg_imu_raw_t> {
35323565
static constexpr sbp_msg_type_t id = SbpMsgImuRaw;

c/include/libsbp/imu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#ifndef LIBSBP_IMU_MESSAGES_H
1919
#define LIBSBP_IMU_MESSAGES_H
2020
#include <libsbp/imu/MSG_IMU_AUX.h>
21+
#include <libsbp/imu/MSG_IMU_COMP.h>
2122
#include <libsbp/imu/MSG_IMU_RAW.h>
2223

2324
#endif /* LIBSBP_IMU_MESSAGES_H */
Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
1+
/*
2+
* Copyright (C) 2015-2021 Swift Navigation Inc.
3+
* Contact: https://support.swiftnav.com
4+
*
5+
* This source is subject to the license found in the file 'LICENSE' which must
6+
* be distributed together with this source. All other rights reserved.
7+
*
8+
* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
9+
* EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
10+
* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
11+
*/
12+
13+
/*****************************************************************************
14+
* Automatically generated from yaml/swiftnav/sbp/imu.yaml
15+
* with generate.py. Please do not hand edit!
16+
*****************************************************************************/
17+
18+
#ifndef LIBSBP_IMU_MSG_IMU_COMP_H
19+
#define LIBSBP_IMU_MSG_IMU_COMP_H
20+
21+
#include <math.h>
22+
#include <stdarg.h>
23+
#include <stdbool.h>
24+
#include <stddef.h>
25+
#include <stdint.h>
26+
#include <string.h>
27+
28+
#include <libsbp/common.h>
29+
#include <libsbp/imu_macros.h>
30+
#include <libsbp/string/sbp_string.h>
31+
32+
#ifdef __cplusplus
33+
extern "C" {
34+
#endif
35+
36+
/******************************************************************************
37+
*
38+
* SBP_MSG_IMU_COMP
39+
*
40+
*****************************************************************************/
41+
/** Compensated IMU data
42+
*
43+
* Data from the Inertial Measurement Unit, containing accelerometer and
44+
* gyroscope readings compensated for estimated errors and constant physical
45+
* effects. The output is valid for inertially referenced center of navigation
46+
* (IMU body frame) represented in vehicle body frame.
47+
*/
48+
typedef struct {
49+
/**
50+
* Microseconds since reference epoch [microseconds]
51+
*/
52+
u64 time;
53+
54+
/**
55+
* Contains the applied compensation parameters and time synchronization mode
56+
*/
57+
u16 flags;
58+
59+
/**
60+
* Compensated acceleration X axis [1e-6 m/s^2]
61+
*/
62+
s32 acc_comp_x;
63+
64+
/**
65+
* Compensated acceleration Y axis [1e-6 m/s^2]
66+
*/
67+
s32 acc_comp_y;
68+
69+
/**
70+
* Compensated acceleration Z axis [1e-6 m/s^2]
71+
*/
72+
s32 acc_comp_z;
73+
74+
/**
75+
* Compensated angular rate X axis [1e-6 deg/s]
76+
*/
77+
s32 gyr_comp_x;
78+
79+
/**
80+
* Compensated angular rate Y axis [1e-6 deg/s]
81+
*/
82+
s32 gyr_comp_y;
83+
84+
/**
85+
* Compensated angular rate Z axis [1e-6 deg/s]
86+
*/
87+
s32 gyr_comp_z;
88+
} sbp_msg_imu_comp_t;
89+
90+
/**
91+
* Get encoded size of an instance of sbp_msg_imu_comp_t
92+
*
93+
* @param msg sbp_msg_imu_comp_t instance
94+
* @return Length of on-wire representation
95+
*/
96+
static inline size_t sbp_msg_imu_comp_encoded_len(
97+
const sbp_msg_imu_comp_t *msg) {
98+
(void)msg;
99+
return SBP_MSG_IMU_COMP_ENCODED_LEN;
100+
}
101+
102+
/**
103+
* Encode an instance of sbp_msg_imu_comp_t to wire representation
104+
*
105+
* This function encodes the given instance in to the user provided buffer. The
106+
* buffer provided to this function must be large enough to store the encoded
107+
* message otherwise it will return SBP_ENCODE_ERROR without writing anything to
108+
* the buffer.
109+
*
110+
* Specify the length of the destination buffer in the \p len parameter. If
111+
* non-null the number of bytes written to the buffer will be returned in \p
112+
* n_written.
113+
*
114+
* @param buf Destination buffer
115+
* @param len Length of \p buf
116+
* @param n_written If not null, on success will be set to the number of bytes
117+
* written to \p buf
118+
* @param msg Instance of sbp_msg_imu_comp_t to encode
119+
* @return SBP_OK on success, or other libsbp error code
120+
*/
121+
SBP_EXPORT s8 sbp_msg_imu_comp_encode(uint8_t *buf, uint8_t len,
122+
uint8_t *n_written,
123+
const sbp_msg_imu_comp_t *msg);
124+
125+
/**
126+
* Decode an instance of sbp_msg_imu_comp_t from wire representation
127+
*
128+
* This function decodes the wire representation of a sbp_msg_imu_comp_t message
129+
* to the given instance. The caller must specify the length of the buffer in
130+
* the \p len parameter. If non-null the number of bytes read from the buffer
131+
* will be returned in \p n_read.
132+
*
133+
* @param buf Wire representation of the sbp_msg_imu_comp_t instance
134+
* @param len Length of \p buf
135+
* @param n_read If not null, on success will be set to the number of bytes read
136+
* from \p buf
137+
* @param msg Destination
138+
* @return SBP_OK on success, or other libsbp error code
139+
*/
140+
SBP_EXPORT s8 sbp_msg_imu_comp_decode(const uint8_t *buf, uint8_t len,
141+
uint8_t *n_read, sbp_msg_imu_comp_t *msg);
142+
/**
143+
* Send an instance of sbp_msg_imu_comp_t with the given write function
144+
*
145+
* An equivalent of #sbp_message_send which operates specifically on
146+
* sbp_msg_imu_comp_t
147+
*
148+
* The given message will be encoded to wire representation and passed in to the
149+
* given write function callback. The write callback will be called several
150+
* times for each invocation of this function.
151+
*
152+
* @param s SBP state
153+
* @param sender_id SBP sender id
154+
* @param msg Message to send
155+
* @param write Write function
156+
* @return SBP_OK on success, or other libsbp error code
157+
*/
158+
SBP_EXPORT s8 sbp_msg_imu_comp_send(sbp_state_t *s, u16 sender_id,
159+
const sbp_msg_imu_comp_t *msg,
160+
sbp_write_fn_t write);
161+
162+
/**
163+
* Compare two instances of sbp_msg_imu_comp_t
164+
*
165+
* The two instances will be compared and a value returned consistent with the
166+
* return codes of comparison functions from the C standard library
167+
*
168+
* 0 will be returned if \p a and \p b are considered equal
169+
* A value less than 0 will be returned if \p a is considered to be less than \p
170+
* b A value greater than 0 will be returned if \p b is considered to be greater
171+
* than \p b
172+
*
173+
* @param a sbp_msg_imu_comp_t instance
174+
* @param b sbp_msg_imu_comp_t instance
175+
* @return 0, <0, >0
176+
*/
177+
SBP_EXPORT int sbp_msg_imu_comp_cmp(const sbp_msg_imu_comp_t *a,
178+
const sbp_msg_imu_comp_t *b);
179+
180+
#ifdef __cplusplus
181+
}
182+
183+
static inline bool operator==(const sbp_msg_imu_comp_t &lhs,
184+
const sbp_msg_imu_comp_t &rhs) {
185+
return sbp_msg_imu_comp_cmp(&lhs, &rhs) == 0;
186+
}
187+
188+
static inline bool operator!=(const sbp_msg_imu_comp_t &lhs,
189+
const sbp_msg_imu_comp_t &rhs) {
190+
return sbp_msg_imu_comp_cmp(&lhs, &rhs) != 0;
191+
}
192+
193+
static inline bool operator<(const sbp_msg_imu_comp_t &lhs,
194+
const sbp_msg_imu_comp_t &rhs) {
195+
return sbp_msg_imu_comp_cmp(&lhs, &rhs) < 0;
196+
}
197+
198+
static inline bool operator<=(const sbp_msg_imu_comp_t &lhs,
199+
const sbp_msg_imu_comp_t &rhs) {
200+
return sbp_msg_imu_comp_cmp(&lhs, &rhs) <= 0;
201+
}
202+
203+
static inline bool operator>(const sbp_msg_imu_comp_t &lhs,
204+
const sbp_msg_imu_comp_t &rhs) {
205+
return sbp_msg_imu_comp_cmp(&lhs, &rhs) > 0;
206+
}
207+
208+
static inline bool operator>=(const sbp_msg_imu_comp_t &lhs,
209+
const sbp_msg_imu_comp_t &rhs) {
210+
return sbp_msg_imu_comp_cmp(&lhs, &rhs) >= 0;
211+
}
212+
213+
#endif // ifdef __cplusplus
214+
215+
#endif /* LIBSBP_IMU_MSG_IMU_COMP_H */

0 commit comments

Comments
 (0)