File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
joint_trajectory_controller/src Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -147,7 +147,15 @@ void CartesianTrajectoryGenerator::reference_callback(
147147 params_.joints .size (), std::numeric_limits<double >::quiet_NaN ());
148148 new_traj_msg->points [0 ].velocities .resize (
149149 params_.joints .size (), std::numeric_limits<double >::quiet_NaN ());
150- new_traj_msg->points [0 ].time_from_start = rclcpp::Duration::from_seconds (0.01 );
150+ if (msg->time_from_start .nanosec == 0 )
151+ {
152+ new_traj_msg->points [0 ].time_from_start = rclcpp::Duration::from_seconds (0.01 );
153+ }
154+ else
155+ {
156+ new_traj_msg->points [0 ].time_from_start = rclcpp::Duration::from_nanoseconds (
157+ static_cast <rcl_duration_value_t >(msg->time_from_start .nanosec ));
158+ }
151159
152160 // just pass input into trajectory message
153161 auto assign_value_from_input = [&](
You can’t perform that action at this time.
0 commit comments