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

[Feature] Interfaces remapping for controllers #1667

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
add methods to access the state and command remapping interface map
saikishor committed Oct 17, 2024
commit 8db28a5105287100cd5390d3d0a27418aea3679c
Original file line number Diff line number Diff line change
@@ -314,6 +314,24 @@ class ControllerInterfaceBase : public rclcpp_lifecycle::node_interfaces::Lifecy
CONTROLLER_INTERFACE_PUBLIC
void wait_for_trigger_update_to_finish();

/// Get the remapping of state interfaces defined in the controller namespace
/**
* Get the remapping of state interfaces defined in the controller namespace
*
* \returns map of state interfaces remapping
*/
CONTROLLER_INTERFACE_PUBLIC
const std::map<std::string, std::string> & get_state_interfaces_remap() const;

/// Get the remapping of command interfaces defined in the controller namespace
/**
* Get the remapping of command interfaces defined in the controller namespace
*
* \returns map of command interfaces remapping
*/
CONTROLLER_INTERFACE_PUBLIC
const std::map<std::string, std::string> & get_command_interfaces_remap() const;

protected:
std::vector<hardware_interface::LoanedCommandInterface> command_interfaces_;
std::vector<hardware_interface::LoanedStateInterface> state_interfaces_;
12 changes: 12 additions & 0 deletions controller_interface/src/controller_interface_base.cpp
Original file line number Diff line number Diff line change
@@ -242,4 +242,16 @@ void ControllerInterfaceBase::wait_for_trigger_update_to_finish()
async_handler_->wait_for_trigger_cycle_to_finish();
}
}

const std::map<std::string, std::string> &
controller_interface::ControllerInterfaceBase::get_state_interfaces_remap() const
{
return state_interfaces_remap_;
}

const std::map<std::string, std::string> &
controller_interface::ControllerInterfaceBase::get_command_interfaces_remap() const
{
return command_interfaces_remap_;
}
} // namespace controller_interface