2017-05-11 22:24:45 +00:00
|
|
|
# SIM\_wheelbot
|
2016-03-03 19:22:37 +00:00
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
SIM\_wheelbot is a simulation of a two-wheeled electric vehicle that follows a set of waypoints.
|
|
|
|
|
|
|
|
![Picture of Vehicle](images/Figure1.png)
|
|
|
|
---
|
|
|
|
### Building the Simulation
|
|
|
|
In the SIM\_wheelbot directory, type **trick-CP** to build the simulation executable. When it's complete, you should see:
|
|
|
|
|
|
|
|
```
|
|
|
|
=== Simulation make complete ===
|
|
|
|
```
|
|
|
|
|
|
|
|
Now **cd** into models/Graphics/ and type **make**. This builds the display client for the simulation.
|
|
|
|
|
|
|
|
### Running the Simulation
|
|
|
|
In the SIM_wheelbot directory:
|
|
|
|
|
|
|
|
```
|
|
|
|
% S_main_*.exe RUN_test/input.py
|
|
|
|
```
|
|
|
|
|
2016-02-18 22:14:44 +00:00
|
|
|
---
|
|
|
|
|
2016-03-03 19:22:37 +00:00
|
|
|
### Inputs
|
|
|
|
Variable | Type | Units | Default Value
|
|
|
|
-----------------------------------------------|----------------|-------|--------------
|
|
|
|
veh.vehicle.distanceBetweenWheels | double | m | 0.183
|
|
|
|
veh.vehicle.wheelRadius | double | m | 0.045
|
2017-08-04 23:37:16 +00:00
|
|
|
veh.vehicle.wheelSpeedLimit | double | rad/s | 8.880
|
|
|
|
veh.vehicle.headingRateLimit | double | rad/s | 𝛑/4
|
2016-03-03 19:22:37 +00:00
|
|
|
veh.vehicle.wheelDragConstant | double | -- | 1.875
|
|
|
|
veh.vehicle.corningStiffness | double | -- | 10.0
|
2020-08-03 15:09:34 +00:00
|
|
|
veh.vehicle.slowDownDistance | double | -- | 0.5
|
2016-03-03 19:22:37 +00:00
|
|
|
veh.vehicle.arrivalDistance | double | -- | 0.1
|
|
|
|
|
|
|
|
![Picture of Vehicle](images/Figure2.png)
|
|
|
|
|
|
|
|
#### Adding Waypoints
|
|
|
|
Waypoints, for the vehicle to follow, are added with a call to
|
|
|
|
|
|
|
|
veh.vehicle.add_waypoint( double N, double W )
|
|
|
|
|
2020-08-03 15:09:34 +00:00
|
|
|
#### Adding Home point
|
|
|
|
A home point is designated by the last waypoint in the waypoint file.
|
2016-03-03 19:22:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
### Input/Output
|
|
|
|
Variable | Type | Units
|
|
|
|
-----------------------------------------------|----------------|-------
|
|
|
|
veh.vehicle.position | double[2] | m
|
|
|
|
veh.vehicle.velocity | double[2] | m
|
2017-08-04 23:37:16 +00:00
|
|
|
veh.vehicle.heading | double | rad
|
|
|
|
veh.vehicle.headingRate | double | rad
|
2016-03-03 19:22:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
### Outputs
|
|
|
|
Variable | Type | Units
|
|
|
|
----------------------------------------------|----------------|--------
|
|
|
|
veh.vehicle.acceleration | double[2] | m
|
2017-08-04 23:37:16 +00:00
|
|
|
veh.vehicle.headingAccel | double | rad
|
2016-03-03 19:22:37 +00:00
|
|
|
veh.vehicle.driveForce | double[2] | N
|
|
|
|
veh.vehicle.lateralTireForce | double[2] | N
|
|
|
|
veh.vehicle.rollingResistForce | double[2] | N
|
|
|
|
veh.vehicle.forceTotal | double[2] | N
|
|
|
|
veh.vehicle.vehicleZTorque | double | N*m
|