Simulators
The Ros Simulator is only used in simulation and, as the name already describes, is used to simulate the model dynamics for certain inputs and publishes measurements.
state_type: <pacejka_car|kinematic_car>
input_type: <pacejka_car|kinematic_car>
[process_noise]:
<Noise Model>
sensors:
sensor_names: List[<mocap|imu>] # <-- Must match provided sensor models
<sensor model>
[<sensor model>]
[...]
initial_state: List[double] # 6 entries for pacejka, 4 for kinematic
initial_input: [double, double] # [steer_input, torque_input]
frequency: double # Hz, speed of simulator
input_delay: <double> # input delay in seconds
do_collision_checks: <true|false> # check if car drives out of bounds, if yes slows down velocity
Example
state_type: pacejka_car
input_type: pacejka_car
process_noise: # This can be uncommented to not have any process noise
type: multivariate_gaussian
seed: 42
mean:
value: [[0], [0], [0], [0], [0], [0]]
sensors:
sensor_names: ["mocap"]
mocap:
R:
value: [[0.001], [0.001], [0.001]]
is_diag: true
frequency: 200 # Hz
key: mocap # optional, if not set us e name of sensor
measurement_noise:
type: multivariate_gaussian
delay: 0.0
# e.g. for IMU config
# imu:
# R:
# value: [[0.001], [0.001], [0.001]]
# is_diag: true
# frequency: 50 #Hz
# key: imu # optional, if not set us e name of sensor
# measurement_noise:
# type: multivariate_gaussian
# seed: 1
# mean:
# value: [[0], [0], [0]]
# delay: 0.0
initial_state: [0.15, -1.05, 0, 0.5, 0, 0]
initial_input: [0.0, 0.2]
frequency: 50 #Hz, speed of simulator
input_delay: 0.01 # input delay in seconds
do_collision_checks: true
ROS Information
| Node Names | Description |
|---|---|
| ros_simulator | Runs the simulator |
Launch File Arguments
| Argument | Default | Description |
|---|---|---|
| simulator_config | $(find ros_simulator)/config/pacejka_car_simulator.yaml | Config to load for the Simulator. |
| control_input | control_input | Topic where the control input will be received. |
| mocap_topic | mocap | Topic where the motion capture measurements will be published. |
| imu_topic | imu | Topic where the imu measurements will be published. |
| imu_yaw_rate_topic | imu_yaw_rate | Topic where the imu yaw rate measurements will be published. |
| wheel_encoder_topic | wheel_encoders | Topic where the wheel encoder measurements will be published. |
| lighthouse_topic | lighthouse | Topic where the lighthouse measurement will be published. |
| gt_state_topic | gt_state | Topic where the ground truth state is published. |
| Subscribed Topics | Description |
|---|---|
| ros_simulator/control_input | Control input |
| Published Topics | Description |
|---|---|
| ros_simulator/gt_state | Ground truth state |
| ros_simulator/mocap | Motion capture measurements |
| ros_simulator/imu | Imu measurements |
| ros_simulator/wheel_encoders | Wheel encoder measurements |
| ros_simulator/lighthouse | Lighthouse measurements |
| Parameters | Description |
|---|---|
| /model/Q/is_diag | If True, the process noise covariance matrix of is given as its diagonal entries |
| /model/Q/value | Value of the process noise covariance matrix |
| /model/model_params/Bf | Front tire stiffness factor |
| /model/model_params/Br | Rear tire stiffness factor |
| /model/model_params/Cd0 | Friction expansion 0th order coefficient |
| /model/model_params/Cd1 | Friction expansion 1st order coefficient |
| /model/model_params/Cd2 | Friction expansion 2nd order coefficient |
| /model/model_params/Cf | Front tire shape factor that controls the ‘stretching’ in the x direction |
| /model/model_params/Cm1 | Model parameter |
| /model/model_params/Cm2 | Model parameter |
| /model/model_params/Cr | Rear tire shape factor that controls the ‘stretching’ in the x direction |
| /model/model_params/Df | Peak value for front tire. |
| /model/model_params/Dr | Peak value for rear tire. |
| /model/model_params/I | Inertia |
| /model/model_params/lf | Length from center to front wheel |
| /model/model_params/lr | Length from center to rear wheel |
| /model/model_params/m | Mass of car |
| /model/model_params/gamma | Torque split between front and rear axle |
| /model/model_params/eps | Velocity at which the approximated slip angles are used to avoid singularities at zero velocity |
| /model/type | Model (e.g Pacejak) |
| /ros_simulator/do_collision_checks | If true, the simulator checks for track collision and sets the car velocity to a small, negative value. |
| /ros_simulator/frequency | Frequency at which the simulator runs |
| /ros_simulator/initial_input | Initial control input |
| /ros_simulator/initial_state | Initial state |
| /ros_simulator/input_delay | Input delay |
| /ros_simulator/input_type | Control input type |
| /ros_simulator/sensors/sensor_names | Name of sensor |
| /ros_simulator/sensors/mocap/R/is_diag | If True, the motion capture measurement noise covariance matrix is given as its diagonal entries |
| /ros_simulator/sensors/mocap/R/value | Value of the Motion capture measurement noise covariance matrix |
| /ros_simulator/sensors/mocap/delay | Delay of the Motion capture measurements |
| /ros_simulator/sensors/mocap/frequency | Frequency at which the Motion capture measurements are published |
| /ros_simulator/sensors/mocap/key | Key that identifies the Motion capture sensor |
| /ros_simulator/sensors/mocap/measurement_noise/type | Type of noise applied to the measurements |
| /ros_simulator/state_type | State type |