Skip to content

Commit

Permalink
Update to Rerun 0.12
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Feb 8, 2024
1 parent 8ef26dc commit 6117bab
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 32 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ endif()

# Rerun:
include(FetchContent)
FetchContent_Declare(rerun_sdk URL https://github.com/rerun-io/rerun/releases/download/0.11.0/rerun_cpp_sdk.zip)
FetchContent_Declare(rerun_sdk URL https://github.com/rerun-io/rerun/releases/download/0.12.0/rerun_cpp_sdk.zip)
FetchContent_MakeAvailable(rerun_sdk)

# VRS:
Expand All @@ -22,6 +22,6 @@ FetchContent_MakeAvailable(vrslib)

find_package(fmt REQUIRED)

add_executable(rerun_vrs_example src/main.cpp src/FramePlayer.cpp src/IMUPlayer.cpp src/utils.cpp)
add_executable(rerun_vrs_example src/main.cpp src/FramePlayer.cpp src/IMUPlayer.cpp)
target_link_libraries(rerun_vrs_example rerun_sdk vrslib vrs_utils fmt)
target_include_directories(rerun_vrs_example PRIVATE src)
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ If you choose not to use pixi, you will need to install a few things yourself be
The Rerun C++ SDK works by connecting to an awaiting Rerun Viewer over TCP.

If you need to install the viewer, follow the [installation guide](https://www.rerun.io/docs/getting-started/installing-viewer). Two of the more common ways to install the Rerun Viewer are:
* Via cargo: `cargo install rerun-cli`
* Via pip: `pip install rerun-sdk`
* Via cargo: `cargo install rerun-cli@0.12.0`
* Via pip: `pip install rerun-sdk==0.12.0`

After you have installed it, you should be able to type `rerun` in your terminal to start the viewer.

Expand Down
3 changes: 1 addition & 2 deletions src/FramePlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <vrs/utils/PixelFrame.h>

#include "FramePlayer.h"
#include "utils.h"

namespace rerun_vrs {

Expand All @@ -33,7 +32,7 @@ namespace rerun_vrs {
};

FramePlayer::FramePlayer(vrs::StreamId id, std::shared_ptr<const rerun::RecordingStream> rec)
: id_{id}, rec_{rec}, entityPath_{add_quotes(id.getName())} {}
: id_{id}, rec_{rec}, entityPath_{rerun::new_entity_path({id.getName()})} {}

bool FramePlayer::onDataLayoutRead(
const vrs::CurrentRecord& record, size_t blockIndex, vrs::DataLayout& layout
Expand Down
8 changes: 2 additions & 6 deletions src/IMUPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <vrs/utils/PixelFrame.h>

#include "IMUPlayer.h"
#include "utils.h"

namespace rerun_vrs {

Expand All @@ -45,7 +44,7 @@ namespace rerun_vrs {
};

IMUPlayer::IMUPlayer(vrs::StreamId id, std::shared_ptr<const rerun::RecordingStream> rec)
: id_{id}, rec_{rec}, entityPath_{add_quotes(id.getName())} {}
: id_{id}, rec_{rec}, entityPath_{rerun::new_entity_path({id.getName()})} {}

bool IMUPlayer::onDataLayoutRead(
const vrs::CurrentRecord& record, size_t blockIndex, vrs::DataLayout& layout
Expand Down Expand Up @@ -99,10 +98,7 @@ namespace rerun_vrs {
}

void IMUPlayer::logAccelerometer(const std::array<float, 3>& accelMSec2) {
rec_->log(
entityPath_ + "/accelerometer",
rerun::Arrows3D::from_vectors({accelMSec2})
);
rec_->log(entityPath_ + "/accelerometer", rerun::Arrows3D::from_vectors({accelMSec2}));
rec_->log(entityPath_ + "/accelerometer/x", rerun::TimeSeriesScalar(accelMSec2[0]));
rec_->log(entityPath_ + "/accelerometer/y", rerun::TimeSeriesScalar(accelMSec2[1]));
rec_->log(entityPath_ + "/accelerometer/z", rerun::TimeSeriesScalar(accelMSec2[2]));
Expand Down
2 changes: 2 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#include "IMUPlayer.h"

int main(int argc, const char* argv[]) {
std::cout << "Rerun SDK Version:" << rerun::version_string() << std::endl;

auto rec = std::make_shared<const rerun::RecordingStream>("rerun_example_vrs");
rec->spawn().exit_on_failure();

Expand Down
9 changes: 0 additions & 9 deletions src/utils.cpp

This file was deleted.

11 changes: 0 additions & 11 deletions src/utils.h

This file was deleted.

0 comments on commit 6117bab

Please sign in to comment.