Skip to content

Fix Time Delay in wf_sim

takamasa horibe requested to merge TakaHoribe/simulation:fix/wf_sim into master

Fixed bug

following bugs are fixed

  • typo in launch file (invalid arg)
  • time delay model (the actual delay time was 1/4 of the desired given delay parameter)

Description of the bug

The time delay was simulatied using input_buffer, and it was updated when calcModel() was called. The calcModel() function is called 4 times for each simulator calculation (because of the Runge kutta algorithm), then actual time delay was 1/4 of the desired delay.

The buffer update was moved out of the calcModel(), and add update() function to update the input_buffer.

Steps to reproduce the bug

  1. run wf_simulator from runtime_manager with vehicle_model_type = DELAY_STEER, and steering time delay is a positive value.
  2. open rqt_plot, plot vehicle_cmd/ctrl_cmd/steering and /vehicle_status/angle .
  3. stop the plot, and measure the delay of the two plots, which is 1/4 of the desired delay.
Edited by Joshua Whitley

Merge request reports