djhanove / autorally

Software for the AutoRally platform
http://autorally.github.io
0 stars 0 forks source link

Add Units #8

Open juicedatom opened 4 years ago

juicedatom commented 4 years ago

This is a personal opinion but all quantities that can have unit should.

float time;

vs

float time_s;

that's better, but what time is it referencing?

float vehicle_timestamp_s;

that's more specific. Not to your use case, but just you get the general idea.

Another exampe

float acceleration;

vs;

float acceleration_mpss;

https://github.com/djhanove/autorally/blob/b09af86ebc8b6a8b934a53a1532bee135e0bb31d/autorally_control/src/LTVMPC/LTVMPC.h#L41

djhanove commented 4 years ago

Thoughts on doing this in the header as comments?

    // ** Vehicle Parameters ** //
    const double Vehicle_m = 21.88; // total mass of vehicle (kg)
    const double Vehicle_Iz = 1.124; // Yaw-moment of inertia (kg-m^2);
    const double Vehicle_lF = 0.34; // Length from CG to front axle(m)
    const double Vehicle_lR = 0.23; // Length from CG to rear axle (m)
    const double Vehicle_IwF = 0.048;// Rolling moment of inertia of front wheels (kg-m^2)
    const double Vehicle_IwR = 0.044;// Rolling moment of inertia of rear wheels (kg-m^2)
    const double Vehicle_rF = 0.095; // Radius of Front Wheel (m)
    const double Vehicle_rR = 0.095; // Radius of Rear Wheel (m)
    const double Vehicle_mu1 = 0.7;  // Gazebo world parameter http://gazebosim.org/tutorials?tut=physics_params&cat=physics
    const double Vehicle_mu2 = 0.75; // Gazebo world parameter http://gazebosim.org/tutorials?tut=physics_params&cat=physics
    const double Vehicle_h = 0.2;    // Height of CG (m)
    const double accel_g = 9.80665; // gravitational constant (m/s^2)