Skip to content

Commit

Permalink
bump tonic dependencies (#67)
Browse files Browse the repository at this point in the history
* bump tonic dependencies
  • Loading branch information
danieleades authored Nov 4, 2023
1 parent 4d19044 commit ac60e02
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
os: windows-latest
rust: stable
steps:
- uses: arduino/setup-protoc@v2
- uses: actions/checkout@v4
with:
submodules: true
Expand All @@ -58,6 +59,7 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: arduino/setup-protoc@v2
- uses: actions/checkout@v4
with:
submodules: true
Expand All @@ -73,6 +75,7 @@ jobs:
name: docs
runs-on: ubuntu-latest
steps:
- uses: arduino/setup-protoc@v2
- uses: actions/checkout@v4
with:
submodules: true
Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ edition = "2021"
rust-version = "1.65.0"

[dependencies]
tonic = "0.6.0"
prost = "0.9.0"
tonic = "0.10.2"
prost = "0.12.1"

thiserror = "1.0.30"
futures-util = { version = "0.3.17", default-features = false }
Expand All @@ -16,4 +16,4 @@ futures-util = { version = "0.3.17", default-features = false }
tokio = { version = "1.12.0", features = ["rt-multi-thread", "macros", "time"] }

[build-dependencies]
tonic-build = "0.6.0"
tonic-build = "0.10.2"
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ $ rustup update

# Build

*note that building mavsdk-rust requires the [protoc](https://grpc.io/docs/protoc-installation/) compiler to be installed.*

```bash
$ cargo build
```
Expand Down
4 changes: 2 additions & 2 deletions src/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ impl FromRpcResponse<pb::GetVersionResponse> for GetVersionResult {
.info_result
.ok_or_else(|| Error::Unknown("InfoResult does not received".into()))?;

let info_result = pb::info_result::Result::from_i32(rpc_info_result.result)
.ok_or_else(|| Error::Unknown("Unsupported InfoResult.result value".into()))?;
let info_result = pb::info_result::Result::try_from(rpc_info_result.result)
.map_err(|_| Error::Unknown("Unsupported InfoResult.result value".into()))?;

match info_result {
pb::info_result::Result::Success => match &get_version_response.version {
Expand Down
4 changes: 2 additions & 2 deletions src/mocap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ impl FromRpcResponse<pb::SetVisionPositionEstimateResponse> for SetVisionPositio
.mocap_result
.ok_or_else(|| Error::Unknown("MocapResult does not received".into()))?;

let mocap_result = pb::mocap_result::Result::from_i32(rpc_mocap_result.result)
.ok_or_else(|| Error::Unknown("Unsupported MocapResult.result value".into()))?;
let mocap_result = pb::mocap_result::Result::try_from(rpc_mocap_result.result)
.map_err(|_| Error::Unknown("Unsupported MocapResult.result value".into()))?;

match mocap_result {
pb::mocap_result::Result::Success => Ok(()),
Expand Down
4 changes: 2 additions & 2 deletions src/telemetry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ impl From<pb::Odometry> for Odometry {
fn from(rpc_odometry: pb::Odometry) -> Self {
Self {
time_usec: 0,
frame_id: MavFrame::from_i32(rpc_odometry.frame_id).unwrap(),
child_frame_id: MavFrame::from_i32(rpc_odometry.child_frame_id).unwrap(),
frame_id: MavFrame::try_from(rpc_odometry.frame_id).unwrap(),
child_frame_id: MavFrame::try_from(rpc_odometry.child_frame_id).unwrap(),
position_body: PositionBody::from(&rpc_odometry.position_body.unwrap()),
q: Quaternion::from(&rpc_odometry.q.unwrap()),
velocity_body: VelocityBody::from(&rpc_odometry.velocity_body.unwrap_or_default()),
Expand Down

0 comments on commit ac60e02

Please sign in to comment.