diff --git a/src/motor_node.cc b/src/motor_node.cc index eb63c61..583db6d 100644 --- a/src/motor_node.cc +++ b/src/motor_node.cc @@ -108,7 +108,7 @@ int main(int argc, char* argv[]) { while (ros::ok()) { current_time = ros::Time::now(); - elapsed = last_time - current_time; + elapsed = current_time - last_time; last_time = current_time; robot.readInputs(); cm.update(ros::Time::now(), elapsed);