File tree Expand file tree Collapse file tree 3 files changed +15
-7
lines changed Expand file tree Collapse file tree 3 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -12,5 +12,4 @@ DerivePointerAlignment: false
1212PointerAlignment : Middle
1313ReflowComments : true
1414IncludeBlocks : Preserve
15- InsertBraces : true
1615...
Original file line number Diff line number Diff line change 1717#ifndef MOCK_COMPONENTS__GENERIC_SYSTEM_HPP_
1818#define MOCK_COMPONENTS__GENERIC_SYSTEM_HPP_
1919
20+ #include < limits>
2021#include < memory>
2122#include < string>
2223#include < vector>
@@ -105,13 +106,11 @@ class HARDWARE_INTERFACE_PUBLIC GenericSystem : public hardware_interface::Syste
105106 // And StateInterface(joint_interface.state_)
106107 struct InterfaceData
107108 {
108- // TODO(Manuel) set initial to NaN and on_init initialize to given value in info or 0.0
109109 explicit InterfaceData (const std::string & name)
110110 : name_(name),
111- command_(0.0 ), // command_(std::numeric_limits<double>::quiet_NaN()),
112- state_(0.0 ), // state_(std::numeric_limits<double>::quiet_NaN()),
113- transmission_passthrough_(
114- 0.0 ) // transmission_passthrough_(std::numeric_limits<double>::quiet_NaN())
111+ command_(std::numeric_limits<double >::quiet_NaN()),
112+ state_(std::numeric_limits<double >::quiet_NaN()),
113+ transmission_passthrough_(std::numeric_limits<double >::quiet_NaN())
115114 {
116115 }
117116
Original file line number Diff line number Diff line change @@ -309,7 +309,17 @@ CallbackReturn GenericSystem::on_init(const hardware_interface::HardwareInfo & i
309309 actuator_handles.push_back (actuator_handle);
310310 }
311311
312- // TODO(Manuel) set initial to NaN and on_init initialize to given value in info or 0.0
312+ for (auto & joint_interface : joint_interfaces_)
313+ {
314+ joint_interface.state_ = 0.0 ;
315+ joint_interface.command_ = 0.0 ;
316+ }
317+
318+ for (auto & actuator_interface : actuator_interfaces_)
319+ {
320+ actuator_interface.state_ = 0.0 ;
321+ actuator_interface.command_ = 0.0 ;
322+ }
313323
314324 // / @note no need to store the joint and actuator handles, the transmission
315325 // / will keep whatever info it needs after is done with them
You can’t perform that action at this time.
0 commit comments