-
Notifications
You must be signed in to change notification settings - Fork 1
Fix/camera config loading #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,7 @@ | |
| #include <shisen_cpp/node/shisen_cpp_node.hpp> | ||
|
|
||
| #include <memory> | ||
| #include <thread> | ||
|
|
||
| namespace shisen_cpp | ||
| { | ||
|
|
@@ -32,6 +33,17 @@ ShisenCppNode::ShisenCppNode(rclcpp::Node::SharedPtr node, const std::string & p | |
| auto image_provider = std::make_shared<camera::ImageProvider>(options); | ||
| auto camera_config_provider = std::make_shared<camera::CameraConfigProvider>(options); | ||
| camera_node->set_provider(image_provider, camera_config_provider); | ||
|
|
||
| for (int i = 0; i < 10; ++i) { | ||
| try { | ||
| camera_node->update(); | ||
| break; | ||
| } catch (const std::exception & e) { | ||
| RCLCPP_WARN(node->get_logger(), "Waiting for camera to be ready..."); | ||
| std::this_thread::sleep_for(100ms); | ||
| } | ||
| } | ||
|
|
||
| camera_node->load_configuration(path); | ||
|
Comment on lines
+37
to
47
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| node_timer = node->create_wall_timer( | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Big No-No on this change. We can't guard these with
is_empty(). The camera has its own internal value limits and hardware states, so we must always overwrite our local struct with the actual values coming fromvideo_capture->get(). Please put the old logic back.