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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ endif()
if(PJ_INSTALL_SDK)
include(CMakePackageConfigHelpers)

set(PJ_PACKAGE_VERSION "0.6.0")
set(PJ_PACKAGE_VERSION "1.0.0")
set(PJ_PACKAGE_CMAKE_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/plotjuggler_sdk)

install(EXPORT plotjuggler_sdkTargets
Expand Down
4 changes: 2 additions & 2 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
plugin_sdk — umbrella for plugin authors (base + dialog SDK + parser SDK)
plugin_host — umbrella for host loaders (data_source/parser/toolbox/dialog)

A consuming Conan recipe declares e.g. `plotjuggler_sdk/0.6.0` and then:
A consuming Conan recipe declares e.g. `plotjuggler_sdk/1.0.0` and then:

find_package(plotjuggler_sdk REQUIRED COMPONENTS plugin_sdk)
target_link_libraries(my_plugin PRIVATE plotjuggler_sdk::plugin_sdk)
Expand All @@ -30,7 +30,7 @@

class PlotjugglerSdkConan(ConanFile):
name = "plotjuggler_sdk"
version = "0.6.0"
version = "1.0.0"
# Apache-2.0 covers the whole SDK (pj_base + pj_plugins). See LICENSE.
license = "Apache-2.0"
url = "https://github.com/PlotJuggler/plotjuggler_sdk"
Expand Down
1 change: 1 addition & 0 deletions docs/builtin_type.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ messages.
| `anchor` | `BufferAnchor` | Keeps `data` alive when it references shared storage. |
| `compressed_depth_min` | `std::optional<float>` | ROS compressed-depth quantization metadata, when present. |
| `compressed_depth_max` | `std::optional<float>` | ROS compressed-depth quantization metadata, when present. |
| `frame_id` | `std::string` | Source coordinate frame (ROS `sensor_msgs/Image` and `foxglove.CompressedImage` both carry it). Lets a consumer match the image to the `CameraInfo` of the same `frame_id` (calibration / native resolution), e.g. to rectify lens distortion so 2D annotations align with the image. Empty when the producer has no frame information. |

Common raw encodings are `rgb8`, `rgba8`, `bgr8`, `bgra8`, `mono8`, and
`mono16`. Common compressed encodings are `jpeg`, `png`, and `qoi`.
Expand Down
7 changes: 7 additions & 0 deletions pj_base/include/pj_base/builtin/image.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,13 @@ struct Image {
std::optional<float> compressed_depth_max;

Timestamp timestamp_ns = 0;

/// Source coordinate frame (ROS sensor_msgs/Image and foxglove.CompressedImage
/// both carry it). Lets a consumer match the image to the CameraInfo of the same
/// frame_id (calibration / native resolution), e.g. to rectify lens distortion so
/// 2D annotations align with the image. Empty when the producer has no frame
/// information.
std::string frame_id;
};

} // namespace sdk
Expand Down
5 changes: 5 additions & 0 deletions pj_base/proto/pj/Image.proto
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,9 @@ message Image {
// ROS compressedDepth quantization maximum; set together with `compressed_depth_min` when `encoding ==
// "compressedDepth"`.
optional float compressed_depth_max = 9;

// Source coordinate frame (ROS sensor_msgs/Image, foxglove.CompressedImage). Lets a consumer match the image to the
// CameraInfo of the same frame_id (calibration / native resolution), e.g. to rectify lens distortion so 2D
// annotations align with the image. Empty when the producer has no frame information.
string frame_id = 10;
}
3 changes: 3 additions & 0 deletions pj_base/src/builtin/image_codec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ std::vector<uint8_t> serializeImage(const Image& image) {
if (image.compressed_depth_max.has_value()) {
writer.floatField(9, *image.compressed_depth_max);
}
writer.string(10, image.frame_id);

return out;
}
Expand Down Expand Up @@ -139,6 +140,8 @@ Expected<sdk::Image> deserializeImage(const uint8_t* data, size_t size) {
image.compressed_depth_max = v;
return true;
}
case 10:
return tag.type == WireType::kLengthDelimited && r.readString(image.frame_id);
default:
return false;
}
Expand Down
3 changes: 3 additions & 0 deletions pj_base/tests/image_codec_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ TEST(ImageCodecTest, RoundTripRawRGB8) {
in.encoding = "rgb8";
in.row_step = 6; // 2 px * 3 bytes
in.is_bigendian = false;
in.frame_id = "camera_front";
const std::vector<uint8_t> pixels = {255, 0, 0, 0, 255, 0, 0, 0, 255, 128, 128, 128};
in.data = Span<const uint8_t>(pixels.data(), pixels.size());

Expand All @@ -45,6 +46,7 @@ TEST(ImageCodecTest, RoundTripRawRGB8) {
EXPECT_EQ(out->encoding, in.encoding);
EXPECT_EQ(out->row_step, in.row_step);
EXPECT_FALSE(out->is_bigendian);
EXPECT_EQ(out->frame_id, "camera_front");
EXPECT_FALSE(out->compressed_depth_min.has_value());
EXPECT_FALSE(out->compressed_depth_max.has_value());
ASSERT_EQ(out->data.size(), pixels.size());
Expand All @@ -70,6 +72,7 @@ TEST(ImageCodecTest, RoundTripCompressedDepthWithRange) {
ASSERT_TRUE(out->compressed_depth_max.has_value());
EXPECT_FLOAT_EQ(*out->compressed_depth_min, 0.5f);
EXPECT_FLOAT_EQ(*out->compressed_depth_max, 10.0f);
EXPECT_TRUE(out->frame_id.empty()); // unset frame_id round-trips as empty
}

} // namespace
Expand Down
Loading