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

AMRNAV-6169 Extend use of composition: ros2 control #1

Merged
merged 6 commits into from
Jan 23, 2024

Conversation

@HovorunB HovorunB self-assigned this Jan 17, 2024
controller_name, namespace_, node_options, false); // disable LifecycleNode service interfaces
controller_name, namespace_, rclcpp::NodeOptions().enable_logger_service(true).arguments({
"--ros-args",
"--remap", ("__node:=" + controller_name).c_str()}), false); // disable LifecycleNode service interfaces
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remapping with the same name, otherwise the name is overriden from the composable node container (amr_container)

Comment on lines 293 to 299
init_timer_ = this->create_wall_timer(
1s,
[this]() -> void {
init_timer_->cancel();
update_loop();
});
};
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Workaround to execute the update_loop thread from outside the constructor

@@ -465,6 +511,52 @@ void ControllerManager::init_resource_manager(const std::string & robot_descript
}
}


void ControllerManager::update_loop(){
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For normal launch this same code is ran from ros2_control_node. But for launching controller_manager as a composed node we have to run it from inside controller manager

@@ -41,6 +41,7 @@ target_compile_definitions(hardware_interface PRIVATE "HARDWARE_INTERFACE_BUILDI

add_library(mock_components SHARED
src/mock_components/generic_system.cpp
src/lexical_casts.cpp
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷‍♂️

@HovorunB HovorunB requested a review from jplapp January 17, 2024 12:42
Copy link

@jplapp jplapp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

Copy link

@maksymdidukh maksymdidukh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@HovorunB HovorunB merged commit 8c2be5a into iron Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants