Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ serde = { version = "1.0.228", features = ["derive"] }
tokio = { version = "1", features = ["macros", "rt", "rt-multi-thread", "time", "signal", "sync", "fs"] }
tracing = "0.1.44"
urdf-rs = "0.9.0"
phoxal = { version = "0.6.0" }
phoxal = { version = "0.9.0" }

[workspace.lints.rust]
unused = "warn"
Expand Down
25 changes: 14 additions & 11 deletions src/assets.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
use std::collections::{BTreeSet, HashMap};

use anyhow::{Result, anyhow};
use phoxal::api::v1::{
asset::{GetRequest as AssetRequest, GetResponse as AssetResponse},
topic,
};
use phoxal::api::asset::v1 as asset_v1;
use phoxal::api::asset::{GetRequest as AssetRequest, GetResponse as AssetResponse};
use phoxal::api::topic;
use phoxal::bus::Bus;
use phoxal::bus::query::Retry;
use phoxal::model::structure::Structure;
Expand All @@ -15,21 +14,25 @@ use urdf_rs::Geometry;
pub(crate) async fn fetch_asset(bus: &Bus, path: &str, retry: &Retry) -> Result<Vec<u8>> {
match bus
.request(
&topic::new().v1().asset().get(),
&AssetRequest::new(path),
&topic::new().asset().get(),
&AssetRequest::V1(asset_v1::GetRequest::new(path)),
retry,
)
.await?
{
Some(AssetResponse::Ok { bytes }) => Ok(bytes),
Some(AssetResponse::NotFound) => Err(anyhow!("asset '{path}' was not found")),
Some(AssetResponse::InvalidPath(reason)) => {
Some(AssetResponse::V1(asset_v1::GetResponse::Ok { bytes })) => Ok(bytes),
Some(AssetResponse::V1(asset_v1::GetResponse::NotFound)) => {
Err(anyhow!("asset '{path}' was not found"))
}
Some(AssetResponse::V1(asset_v1::GetResponse::InvalidPath(reason))) => {
Err(anyhow!("asset '{path}' has invalid path: {reason:?}"))
}
Some(AssetResponse::Unavailable(reason)) => {
Some(AssetResponse::V1(asset_v1::GetResponse::Unavailable(reason))) => {
Err(anyhow!("asset '{path}' is unavailable: {reason:?}"))
}
Some(AssetResponse::Busy) => Err(anyhow!("asset '{path}' provider is busy")),
Some(AssetResponse::V1(asset_v1::GetResponse::Busy)) => {
Err(anyhow!("asset '{path}' provider is busy"))
}
None => Err(anyhow!("asset query '{path}' returned no response")),
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/capability/accelerometer.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::Result;
use phoxal::api::v1::component::capability::accelerometer::Sample;
use phoxal::api::component::capability::accelerometer::v1::Sample;
use phoxal::bus::typed::Received;
use rerun::{Arrows3D, RecordingStream};

Expand Down
2 changes: 1 addition & 1 deletion src/capability/battery.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::Result;
use phoxal::api::v1::component::capability::battery::State;
use phoxal::api::component::capability::battery::v1::State;
use phoxal::bus::typed::Received;
use rerun::{RecordingStream, Scalars};

Expand Down
2 changes: 1 addition & 1 deletion src/capability/camera.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::{Result, anyhow, ensure};
use phoxal::api::v1::component::capability::camera::{Encoding, Frame};
use phoxal::api::component::capability::camera::v1::{Encoding, Frame};
use phoxal::bus::typed::Received;
use phoxal::model::component::v1::capability::Capability;
use rerun::{Image, RecordingStream};
Expand Down
4 changes: 2 additions & 2 deletions src/capability/depth.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use anyhow::{Result, anyhow};
use image::{ExtendedColorType, ImageEncoder, codecs::png::PngEncoder};
use phoxal::api::v1::component::capability::depth::{Depth, MILLIMETERS_PER_METER};
use phoxal::api::component::capability::depth::v1::{Depth, MILLIMETERS_PER_METER};
use phoxal::bus::typed::Received;
use phoxal::model::component::v1::capability::Capability;
use rerun::{EncodedDepthImage, RecordingStream, components::MediaType};
Expand Down Expand Up @@ -80,7 +80,7 @@ fn samples_to_native_bytes(samples: &[u16]) -> Vec<u8> {
#[cfg(test)]
mod tests {
use image::ImageReader;
use phoxal::api::v1::component::capability::depth::Depth;
use phoxal::api::component::capability::depth::v1::Depth;

use super::{payload_resolution, samples_to_png};

Expand Down
2 changes: 1 addition & 1 deletion src/capability/encoder.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::Result;
use phoxal::api::v1::component::capability::encoder::Sample;
use phoxal::api::component::capability::encoder::v1::Sample;
use phoxal::bus::typed::Received;
use rerun::{RecordingStream, Scalars};

Expand Down
2 changes: 1 addition & 1 deletion src/capability/gnss.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::Result;
use phoxal::api::v1::component::capability::gnss::Sample;
use phoxal::api::component::capability::gnss::v1::Sample;
use phoxal::bus::typed::Received;
use rerun::{RecordingStream, Scalars};

Expand Down
2 changes: 1 addition & 1 deletion src/capability/gyroscope.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::Result;
use phoxal::api::v1::component::capability::gyroscope::Sample;
use phoxal::api::component::capability::gyroscope::v1::Sample;
use phoxal::bus::typed::Received;
use rerun::{Arrows3D, RecordingStream};

Expand Down
2 changes: 1 addition & 1 deletion src/capability/imu.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::Result;
use phoxal::api::v1::component::capability::imu::Sample;
use phoxal::api::component::capability::imu::v1::Sample;
use phoxal::bus::typed::Received;
use rerun::{Quaternion, RecordingStream, Transform3D};

Expand Down
2 changes: 1 addition & 1 deletion src/capability/lidar.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::{Result, anyhow};
use phoxal::api::v1::component::capability::lidar::Scan;
use phoxal::api::component::capability::lidar::v1::Scan;
use phoxal::bus::typed::Received;
use phoxal::model::component::v1::CapabilityRef;
use phoxal::model::component::v1::capability::{Capability, LidarOutput};
Expand Down
2 changes: 1 addition & 1 deletion src/capability/magnetometer.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::Result;
use phoxal::api::v1::component::capability::magnetometer::Sample;
use phoxal::api::component::capability::magnetometer::v1::Sample;
use phoxal::bus::typed::Received;
use rerun::{Arrows3D, RecordingStream};

Expand Down
2 changes: 1 addition & 1 deletion src/capability/microphone.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::Result;
use phoxal::api::v1::component::capability::microphone::Frame;
use phoxal::api::component::capability::microphone::v1::Frame;
use phoxal::bus::typed::Received;
use rerun::{RecordingStream, Scalars};

Expand Down
2 changes: 1 addition & 1 deletion src/capability/mmwave.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::Result;
use phoxal::api::v1::component::capability::mmwave::Scan;
use phoxal::api::component::capability::mmwave::v1::Scan;
use phoxal::bus::typed::Received;
use rerun::{Arrows3D, Clear, Points3D, RecordingStream, Scalars};

Expand Down
28 changes: 14 additions & 14 deletions src/capability/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ mod speaker;

use crate::scene::SceneModel;
use anyhow::Result;
use phoxal::api::v1::component::capability::accelerometer::Sample as AccelerometerSample;
use phoxal::api::v1::component::capability::battery::State as BatteryState;
use phoxal::api::v1::component::capability::camera::Frame as CameraFrame;
use phoxal::api::v1::component::capability::depth::Depth;
use phoxal::api::v1::component::capability::encoder::Sample as EncoderSample;
use phoxal::api::v1::component::capability::gnss::Sample as GnssSample;
use phoxal::api::v1::component::capability::gyroscope::Sample as GyroscopeSample;
use phoxal::api::v1::component::capability::imu::Sample as ImuSample;
use phoxal::api::v1::component::capability::lidar::Scan as LidarScan;
use phoxal::api::v1::component::capability::magnetometer::Sample as MagnetometerSample;
use phoxal::api::v1::component::capability::microphone::Frame as MicrophoneFrame;
use phoxal::api::v1::component::capability::mmwave::Scan as MmwaveScan;
use phoxal::api::v1::component::capability::range::Sample as RangeSample;
use phoxal::api::v1::component::capability::speaker::audio::Audio;
use phoxal::api::component::capability::accelerometer::v1::Sample as AccelerometerSample;
use phoxal::api::component::capability::battery::v1::State as BatteryState;
use phoxal::api::component::capability::camera::v1::Frame as CameraFrame;
use phoxal::api::component::capability::depth::v1::Depth;
use phoxal::api::component::capability::encoder::v1::Sample as EncoderSample;
use phoxal::api::component::capability::gnss::v1::Sample as GnssSample;
use phoxal::api::component::capability::gyroscope::v1::Sample as GyroscopeSample;
use phoxal::api::component::capability::imu::v1::Sample as ImuSample;
use phoxal::api::component::capability::lidar::v1::Scan as LidarScan;
use phoxal::api::component::capability::magnetometer::v1::Sample as MagnetometerSample;
use phoxal::api::component::capability::microphone::v1::Frame as MicrophoneFrame;
use phoxal::api::component::capability::mmwave::v1::Scan as MmwaveScan;
use phoxal::api::component::capability::range::v1::Sample as RangeSample;
use phoxal::api::component::capability::speaker::audio::v1::Audio;
use phoxal::bus::typed::Received;
use rerun::RecordingStream;

Expand Down
2 changes: 1 addition & 1 deletion src/capability/range.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::Result;
use phoxal::api::v1::component::capability::range::Sample;
use phoxal::api::component::capability::range::v1::Sample;
use phoxal::bus::typed::Received;
use rerun::{Color, LineStrips3D, Points3D, RecordingStream, TextLog, TextLogLevel};

Expand Down
2 changes: 1 addition & 1 deletion src/capability/speaker.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::Result;
use phoxal::api::v1::component::capability::speaker::audio::Audio;
use phoxal::api::component::capability::speaker::audio::v1::Audio;
use phoxal::bus::typed::Received;
use rerun::{RecordingStream, Scalars};

Expand Down
38 changes: 19 additions & 19 deletions src/event.rs
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
use phoxal::api::v1::component::capability::accelerometer::Sample as AccelerometerSample;
use phoxal::api::v1::component::capability::battery::State as BatteryState;
use phoxal::api::v1::component::capability::camera::Frame as CameraFrame;
use phoxal::api::v1::component::capability::depth::Depth;
use phoxal::api::v1::component::capability::encoder::Sample as EncoderSample;
use phoxal::api::v1::component::capability::gnss::Sample as GnssSample;
use phoxal::api::v1::component::capability::gyroscope::Sample as GyroscopeSample;
use phoxal::api::v1::component::capability::imu::Sample as ImuSample;
use phoxal::api::v1::component::capability::lidar::Scan as LidarScan;
use phoxal::api::v1::component::capability::magnetometer::Sample as MagnetometerSample;
use phoxal::api::v1::component::capability::microphone::Frame as MicrophoneFrame;
use phoxal::api::v1::component::capability::mmwave::Scan as MmwaveScan;
use phoxal::api::v1::component::capability::range::Sample as RangeSample;
use phoxal::api::v1::component::capability::speaker::audio::Audio;
use phoxal::api::v1::drive::State as DriveState;
use phoxal::api::v1::frame::FrameTransform;
use phoxal::api::v1::joint::JointState;
use phoxal::api::v1::odometry::OdometryEstimate;
use phoxal::api::v1::presence::Heartbeat;
use phoxal::api::component::capability::accelerometer::v1::Sample as AccelerometerSample;
use phoxal::api::component::capability::battery::v1::State as BatteryState;
use phoxal::api::component::capability::camera::v1::Frame as CameraFrame;
use phoxal::api::component::capability::depth::v1::Depth;
use phoxal::api::component::capability::encoder::v1::Sample as EncoderSample;
use phoxal::api::component::capability::gnss::v1::Sample as GnssSample;
use phoxal::api::component::capability::gyroscope::v1::Sample as GyroscopeSample;
use phoxal::api::component::capability::imu::v1::Sample as ImuSample;
use phoxal::api::component::capability::lidar::v1::Scan as LidarScan;
use phoxal::api::component::capability::magnetometer::v1::Sample as MagnetometerSample;
use phoxal::api::component::capability::microphone::v1::Frame as MicrophoneFrame;
use phoxal::api::component::capability::mmwave::v1::Scan as MmwaveScan;
use phoxal::api::component::capability::range::v1::Sample as RangeSample;
use phoxal::api::component::capability::speaker::audio::v1::Audio;
use phoxal::api::drive::v1::State as DriveState;
use phoxal::api::frame::v1::FrameTransform;
use phoxal::api::joint::v1::JointState;
use phoxal::api::odometry::v1::OdometryEstimate;
use phoxal::api::presence::v1::Heartbeat;
use phoxal::bus::typed::Received;

macro_rules! define_event_enum {
Expand Down
8 changes: 4 additions & 4 deletions src/frame_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use std::collections::{HashMap, HashSet};

use anyhow::{Result, anyhow};
use nalgebra::{Isometry3, Quaternion as NaQuaternion, Translation3, UnitQuaternion};
use phoxal::api::v1::frame::FrameTransform;
use phoxal::api::v1::odometry::OdometryEstimate;
use phoxal::api::frame::v1::FrameTransform;
use phoxal::api::odometry::v1::OdometryEstimate;
use rerun::{Quaternion, Transform3D};

#[derive(Debug, Clone)]
Expand Down Expand Up @@ -124,8 +124,8 @@ mod tests {
use std::collections::HashMap;

use anyhow::Result;
use phoxal::api::v1::frame::{FrameId, FrameTransform, Source};
use phoxal::api::v1::odometry::{
use phoxal::api::frame::v1::{FrameId, FrameTransform, Source};
use phoxal::api::odometry::v1::{
Covariance, OdometryEstimate, PoseEstimate, Status, StatusMode, VelocityEstimate,
};

Expand Down
4 changes: 2 additions & 2 deletions src/logging/drive.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::Result;
use phoxal::api::v1::drive::State;
use phoxal::api::drive::v1::State;
use phoxal::bus::typed::Received;
use rerun::{RecordingStream, Scalars};

Expand Down Expand Up @@ -28,7 +28,7 @@ pub(crate) fn log_drive_state_update(
fn log_target(
rec: &RecordingStream,
path_root: &str,
target: phoxal::api::v1::drive::Target,
target: phoxal::api::drive::v1::Target,
) -> Result<()> {
rec.log(
format!("{path_root}/linear_x_mps"),
Expand Down
2 changes: 1 addition & 1 deletion src/logging/joint.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::Result;
use phoxal::api::v1::joint::JointState as JointData;
use phoxal::api::joint::v1::JointState as JointData;
use phoxal::bus::typed::Received;
use rerun::{RecordingStream, Scalars};

Expand Down
2 changes: 1 addition & 1 deletion src/logging/odometry.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::Result;
use phoxal::api::v1::odometry::OdometryEstimate as OdometryData;
use phoxal::api::odometry::v1::OdometryEstimate as OdometryData;
use phoxal::bus::typed::Received;
use rerun::{RecordingStream, Scalars};

Expand Down
4 changes: 2 additions & 2 deletions src/scene.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::collections::HashMap;

use anyhow::{Context, Result, anyhow};
use phoxal::api::v1::frame::{FrameId, FrameTransform as FrameData, Source};
use phoxal::api::v1::joint::JointId;
use phoxal::api::frame::v1::{FrameId, FrameTransform as FrameData, Source};
use phoxal::api::joint::v1::JointId;
use phoxal::bus::Bus;
use phoxal::bus::query::Retry;
use phoxal::model::component::v1::capability::{CameraMode, Capability, StructuralTarget};
Expand Down
Loading
Loading