Working calibration
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
set(DORA_ROOT_DIR "/home/cristhian/workspace/garbage/dora" CACHE FILEPATH "Path to the root of dora")
|
||||
set(DORA_ROOT_DIR "" CACHE FILEPATH "Path to the root of dora")
|
||||
|
||||
set(dora_c_include_dir "${CMAKE_CURRENT_BINARY_DIR}/include/c")
|
||||
|
||||
set(dora_cxx_include_dir "${CMAKE_CURRENT_BINARY_DIR}/include/cxx")
|
||||
set(node_bridge "${CMAKE_CURRENT_BINARY_DIR}/node_bridge.cc")
|
||||
|
||||
if(DORA_ROOT_DIR)
|
||||
if(DORA_ROOT_DIR AND EXISTS "${DORA_ROOT_DIR}/Cargo.toml")
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(Dora
|
||||
SOURCE_DIR ${DORA_ROOT_DIR}
|
||||
@@ -40,10 +40,28 @@ if(DORA_ROOT_DIR)
|
||||
set(dora_link_dirs ${DORA_ROOT_DIR}/target/debug)
|
||||
else()
|
||||
include(ExternalProject)
|
||||
set(DORA_GIT_TAG "main")
|
||||
find_program(DORA_CLI dora)
|
||||
if(DORA_CLI)
|
||||
execute_process(
|
||||
COMMAND ${DORA_CLI} --version
|
||||
RESULT_VARIABLE _dora_version_result
|
||||
OUTPUT_VARIABLE _dora_version_out
|
||||
ERROR_VARIABLE _dora_version_err
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
if(_dora_version_result EQUAL 0)
|
||||
string(REGEX MATCH "([0-9]+\\.[0-9]+\\.[0-9]+)" _dora_version_match "${_dora_version_out}")
|
||||
if(_dora_version_match)
|
||||
set(DORA_GIT_TAG "v${CMAKE_MATCH_1}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(Dora
|
||||
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/dora
|
||||
GIT_REPOSITORY https://github.com/dora-rs/dora.git
|
||||
GIT_TAG main
|
||||
GIT_TAG ${DORA_GIT_TAG}
|
||||
BUILD_IN_SOURCE True
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND
|
||||
|
||||
@@ -189,6 +189,7 @@ int main() {
|
||||
|
||||
auto [fx, fy, cx, cy, distortion] = reload_calibration();
|
||||
|
||||
int64_t frame_id = 0;
|
||||
while (true) {
|
||||
auto event = dora_node.events->next();
|
||||
auto type = event_type(event);
|
||||
@@ -237,6 +238,12 @@ int main() {
|
||||
image_metadata->set_float("cx", cx);
|
||||
image_metadata->set_float("cy", cy);
|
||||
image_metadata->set_list_float("distortion", make_distortion(distortion));
|
||||
image_metadata->set_int("frame_id", frame_id++);
|
||||
image_metadata->set_int("timestamp_ns", static_cast<int64_t>(
|
||||
std::chrono::duration_cast<std::chrono::nanoseconds>(
|
||||
std::chrono::steady_clock::now().time_since_epoch()
|
||||
).count()
|
||||
));
|
||||
|
||||
auto image_result = send_output_with_metadata(
|
||||
dora_node.send_output, "image_bgr", image_slice, std::move(image_metadata));
|
||||
|
||||
Reference in New Issue
Block a user