File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
hardware_interface/src/hardware_interface/distributed_control_interface Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -136,8 +136,12 @@ void CommandForwarder::publish_value_on_timer()
136136
137137void CommandForwarder::forward_command (const controller_manager_msgs::msg::InterfaceData & msg)
138138{
139+ auto receive_time = evaluation_node_->now ();
140+ // set value before publishing
141+ loaned_command_interface_ptr_->set_value (msg.data );
142+
139143 auto evaluation_msg = std::make_unique<controller_manager_msgs::msg::Evaluation>();
140- evaluation_msg->receive_stamp = evaluation_node_-> now () ;
144+ evaluation_msg->receive_stamp = receive_time ;
141145 evaluation_msg->receive_time =
142146 static_cast <uint64_t >(evaluation_msg->receive_stamp .sec ) * 1'000'000'000ULL +
143147 evaluation_msg->receive_stamp .nanosec ;
@@ -146,8 +150,6 @@ void CommandForwarder::forward_command(const controller_manager_msgs::msg::Inter
146150 evaluation_msg->seq = msg.header .seq ;
147151 // todo check for QoS to publish immediately and never block to be fast as possible
148152 evaluation_pub_->publish (std::move (evaluation_msg));
149-
150- loaned_command_interface_ptr_->set_value (msg.data );
151153}
152154
153155} // namespace distributed_control
You can’t perform that action at this time.
0 commit comments