Skip to content
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

Add name cog module #1

Open
wants to merge 3 commits into
base: rolling
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cs4home_simple_project/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ find_package(yolov8_msgs REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(ament_index_cpp REQUIRED)

set (dependencies
set(dependencies
cs4home_core
rclcpp
rclcpp_components
Expand Down Expand Up @@ -64,7 +64,7 @@ target_link_libraries(face_module
face_core
)

target_link_libraries(yolo_module
target_link_libraries(yolo_module
yolo_afferent
yolo_efferent
yolo_core
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ class FaceAfferent : public cs4home_core::Afferent
bool configure() override;

private:

std::vector<std::string> input_topic_names_;

};

} // namespace cs4home_simple_project
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ class FaceEfferent : public cs4home_core::Efferent
void publish_graph(knowledge_graph_msgs::msg::GraphUpdate::UniquePtr msg);

private:

std::vector<std::string> output_topic_names_;

};

} // namespace cs4home_simple_project
Expand Down
2 changes: 1 addition & 1 deletion cs4home_simple_project/src/FaceModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ int main(int argc, char ** argv)
rclcpp::shutdown();

return 0;
}
}
6 changes: 3 additions & 3 deletions cs4home_simple_project/src/YoloModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ int main(int argc, char ** argv)

rclcpp::NodeOptions options;
options.arguments(
{"--ros-args", "-r", "__node:=yolo_module", "--params-file", config_file});
{"--ros-args", "--params-file", config_file});

auto node = cs4home_core::CognitiveModule::make_shared(options);
auto node = cs4home_core::CognitiveModule::make_shared("yolo_module", options);

node->trigger_transition(lifecycle_msgs::msg::Transition::TRANSITION_CONFIGURE);
node->trigger_transition(lifecycle_msgs::msg::Transition::TRANSITION_ACTIVATE);
Expand All @@ -40,4 +40,4 @@ int main(int argc, char ** argv)
rclcpp::shutdown();

return 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,10 @@ bool FaceAfferent::configure()
parent_->get_parameter("face_afferent.topics", input_topic_names_);

// Create the subscription to the input topics
for (const auto & topic_name : input_topic_names_)
{
if(this->create_subscriber(topic_name, "hri_msgs/msg/IdsList"))
{
for (const auto & topic_name : input_topic_names_) {
if(this->create_subscriber(topic_name, "hri_msgs/msg/IdsList")) {
RCLCPP_INFO(parent_->get_logger(), "Subscribed to topic: %s", topic_name.c_str());
}
else
{
} else {
RCLCPP_ERROR(parent_->get_logger(), "Error subscribing to topic: %s", topic_name.c_str());
return false;
}
Expand All @@ -52,4 +48,4 @@ bool FaceAfferent::configure()

CS_REGISTER_COMPONENT(FaceAfferent)

} // namespace cs4home_simple_project
} // namespace cs4home_simple_project