Skip to content

Commit

Permalink
fix: resolve error in application initialization (#18)
Browse files Browse the repository at this point in the history
Signed-off-by: ktro2828 <[email protected]>
  • Loading branch information
ktro2828 authored Aug 9, 2024
1 parent 231c492 commit 3c6eabe
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
7 changes: 3 additions & 4 deletions awviz/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@

#include <awviz_common/viewer.hpp>

#include <iostream>

int main()
int main(int argc, char ** argv)
{
std::cout << "Hello, awviz!!" << std::endl;
rclcpp::init(argc, argv);
awviz_common::ViewerApp app;
app.run();
}
5 changes: 5 additions & 0 deletions awviz_common/include/awviz_common/viewer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ class ViewerApp
*/
~ViewerApp();

/**
* @brief Start running application.
*/
void run();

private:
rclcpp::Node::SharedPtr node_;
std::shared_ptr<rerun::RecordingStream> stream_;
Expand Down
7 changes: 7 additions & 0 deletions awviz_common/src/viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#include "rclcpp/utilities.hpp"
#include "rerun/recording_stream.hpp"

#include <rclcpp/executors.hpp>

#include <memory>

namespace awviz_common
Expand All @@ -34,4 +36,9 @@ ViewerApp::~ViewerApp()
{
rclcpp::shutdown();
}

void ViewerApp::run()
{
rclcpp::spin(node_);
}
} // namespace awviz_common

0 comments on commit 3c6eabe

Please sign in to comment.