Skip to content

Commit

Permalink
fix: small map fix and clean up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bpapaspyros committed Oct 2, 2024
1 parent f3aaae3 commit 769c2dc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ class LifecycleComponent : public rclcpp_lifecycle::LifecycleNode, public Compon
std::map<
std::string,
std::function<std::shared_ptr<modulo_core::communication::PublisherInterface>(const std::string& topic_name)>>
output_configuration_callables_;///< Map of configuration callables
output_configuration_callables_;///< Map of output configuration callables
};

template<typename DataT>
Expand Down
2 changes: 1 addition & 1 deletion source/modulo_components/src/LifecycleComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ bool LifecycleComponent::configure_outputs() {
auto topic_name = this->get_parameter_value<std::string>(name + "_topic");
RCLCPP_DEBUG_STREAM(
this->get_logger(), "Configuring output '" << name << "' with topic name '" << topic_name << "'.");
interface = this->configuration_callables_.at(name)(topic_name);
interface = this->output_configuration_callables_.at(name)(topic_name);
} catch (const modulo_core::exceptions::CoreException& ex) {
success = false;
RCLCPP_ERROR_STREAM(this->get_logger(), "Failed to configure output '" << name << "': " << ex.what());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,7 @@ TYPED_TEST(ComponentInterfaceTest, AddRemoveInput) {
this->component_->remove_input("test_13");
EXPECT_TRUE(this->component_->inputs_.find("test_13") == this->component_->inputs_.end());

auto sensor_msg_data = std::make_shared<sensor_msgs::msg::Image>();
sensor_msg_data->height = 480;
EXPECT_NO_THROW(this->component_->add_input("sensor_msg_data", sensor_msg_data));
EXPECT_NO_THROW(this->component_->add_input("sensor_msg_data", std::make_shared<sensor_msgs::msg::Image>()));
EXPECT_FALSE(this->component_->inputs_.find("sensor_msg_data") == this->component_->inputs_.end());
}

Expand Down

0 comments on commit 769c2dc

Please sign in to comment.