Skip to content
Merged
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
12 changes: 6 additions & 6 deletions hardware_interface/include/hardware_interface/handle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,17 +257,17 @@ class StateInterface : public Handle

void registerIntrospection() const
{
if (std::holds_alternative<double>(value_))
if (value_ptr_ || std::holds_alternative<double>(value_))
{
std::function<double()> f = [this]()
{ return value_ptr_ ? *value_ptr_ : std::numeric_limits<double>::quiet_NaN(); };
{ return value_ptr_ ? *value_ptr_ : std::get<double>(value_); };
DEFAULT_REGISTER_ROS2_CONTROL_INTROSPECTION("state_interface." + get_name(), f);
}
}

void unregisterIntrospection() const
{
if (std::holds_alternative<double>(value_))
if (value_ptr_ || std::holds_alternative<double>(value_))
{
DEFAULT_UNREGISTER_ROS2_CONTROL_INTROSPECTION("state_interface." + get_name());
}
Expand Down Expand Up @@ -302,17 +302,17 @@ class CommandInterface : public Handle

void registerIntrospection() const
{
if (std::holds_alternative<double>(value_))
if (value_ptr_ || std::holds_alternative<double>(value_))
{
std::function<double()> f = [this]()
{ return value_ptr_ ? *value_ptr_ : std::numeric_limits<double>::quiet_NaN(); };
{ return value_ptr_ ? *value_ptr_ : std::get<double>(value_); };
DEFAULT_REGISTER_ROS2_CONTROL_INTROSPECTION("command_interface." + get_name(), f);
}
}

void unregisterIntrospection() const
{
if (std::holds_alternative<double>(value_))
if (value_ptr_ || std::holds_alternative<double>(value_))
{
DEFAULT_UNREGISTER_ROS2_CONTROL_INTROSPECTION("command_interface." + get_name());
}
Expand Down