Skip to content
Draft
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
21 changes: 21 additions & 0 deletions controller_interface/src/chainable_controller_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,17 @@ ChainableControllerInterface::export_state_interfaces()
// check if the names of the controller state interfaces begin with the controller's name
for (const auto & interface : state_interfaces)
{
if (interface.get_data_type() != hardware_interface::HandleDataType::DOUBLE)
{
const std::string error_msg = fmt::format(
FMT_COMPILE(
"The data type of the interface '{}' ({}) is not of type 'double'. "
"Unfortunately, only 'double' data type is supported for state interfaces. "
"No state interface will be exported. Please correct and recompile the controller "

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

could you please also put some documentation on this onto an issue and reference that in these messages? that way people in the future will be able to follow up on where we stand on it

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I can do that

"with name '{}' and try again."),
interface.get_name(), interface.get_data_type().to_string(), get_node()->get_name());
throw std::runtime_error(error_msg);
}
if (interface.get_prefix_name().find(get_node()->get_name()) != 0)
{
const std::string error_msg = fmt::format(
Expand Down Expand Up @@ -143,6 +154,16 @@ ChainableControllerInterface::export_reference_interfaces()
const auto ref_interface_size = reference_interfaces.size();
for (auto & interface : reference_interfaces)
{
if (interface.get_data_type() != hardware_interface::HandleDataType::DOUBLE)
{
std::string error_msg = fmt::format(
FMT_COMPILE(
"The data type of the interface '{}' ({}) is not of type 'double'. "
"Unfortunately, only 'double' data type is supported for reference interfaces. "
"Please correct and recompile the controller with name '{}' and try again."),
interface.get_name(), interface.get_data_type().to_string(), get_node()->get_name());
throw std::runtime_error(error_msg);
}
if (interface.get_prefix_name().find(get_node()->get_name()) != 0)
{
std::string error_msg = fmt::format(
Expand Down
Loading