Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

find the optimal trajectories for a bunch of tracks #5

Closed
19 of 25 tasks
Tracked by #1
Armandpl opened this issue May 2, 2023 · 7 comments · Fixed by #14
Closed
19 of 25 tasks
Tracked by #1

find the optimal trajectories for a bunch of tracks #5

Armandpl opened this issue May 2, 2023 · 7 comments · Fixed by #14

Comments

@Armandpl
Copy link
Owner

Armandpl commented May 2, 2023

  • make a sim using the bicycle model
    • bicycle model with linear tires
    • more advanced bicycle model??
    • measure car dimensions
      • width, length, wheel_width, wheel_length=66mm
    • measure car params and update the sim
    • render sim
    • load and display track
    • raytrace to find the edges of the track
    • project the current pos onto the center line and get track progress
    • find if the car went outside the track
  • randomize initial speeds
  • randomize model params?
    • would increase the chance that the simulated traj can actually be executed on the car
    • but I think the current ones should be doable, go back to this if needed
  • add max accel and servo steering rate for the sim. currently we can go from 0 to 100km/h in 0 sec and steer from left to right instantly. in reality that's not the case
    • measure max accel with accelerometer
    • measure steering rate with camera
  • is the position of the bicycle model the center of mass or the geometric center?
    • it's the center of mass, update the sim accordingly!
  • import data dir and load stuff from there? e.g model config and track?
  • add other tracks
  • add option for random track loading
    • later, don't need it for now
  • log videos to wandb
    • fix the render system: add back rgb array, check the car racing env
  • log lap time!! in evaluate?
  • run sweep to see if we can train faster, if the crash reward is useful, how important gamma is
    • add early stopping? on lap time? on reward? but reward will change with crash reward
    • actually not urgent just let it run overnight
  • make script to export trajectories that we can then use in blender
    • input: model saved on wandb, traj len, total steps
    • output traj with: speed + position + orientation + end of traj delimiter
    • need way to go from global traj to local traj
    • metadata: track name
  • plot traj on track w/ speed and/or accel
  • config w/hydra so that e.g car params are saved to wandb
    • this is important bc trained models depend on this!
    • from a trained model we want to be able to retrieve
      • algo parameters
      • car parameters
      • which track(s?) it was trained on
@Armandpl Armandpl mentioned this issue May 2, 2023
2 tasks
@Armandpl
Copy link
Owner Author

Armandpl commented May 4, 2023

could have a fixed speed in simulation? and find the best traj with this constraint. this way we can just fix the speed in real life

@Armandpl
Copy link
Owner Author

Armandpl commented May 4, 2023

max steering is roughly ~25 deg for the inside tire (ackerman steering?). I guess to be safe I could model it to be 20 deg and see what the trajectories look like?

@Armandpl
Copy link
Owner Author

Armandpl commented May 4, 2023

looking at the gear ratio to try and compute the forces exerted on the wheels:
motor pinion: 30T
spur gear: 68T
diff pinion: 13T
diff spur: 40T
wheel diam: 66mm

current ratio is 68/30 * 40/13 = 6.97. motor doc recommends 3 for touring on small track
when using the 37T pinion we'll get to 68/37 * 40/13 = 5.65 which is still far from the rec but maybe we need more torque bc the car is heavy with the electronics and extra battery? also we probably don't need to go 70kph? we do need fast acceleration though so I think we want to get to that peak current

@Armandpl
Copy link
Owner Author

Armandpl commented May 4, 2023

trying to understand how many ticks per motor rotation to compute car speed

motor doc here (with gearing recs)

IMHO the connector is "EFRA standard" (RC cars)
see here page 25
http://mgm-compro.com/manuals/en-man...-071011-a1.pdf
Pin #1 – black wire, ground potential (minus)
Pin #2 – orange wire, sensor phase C
Pin #3 – white wire, sensor phase B
Pin #4 – green wire, sensor phase A
Pin #5 – blue wire, motor temperature sensing, 10 k NTC
(other end of sensor is on ground potential, pin #1)
Pin #6 – red wire, sensors feeding, +5.0 V ± 10%.

There is one sensor per motor phase, do they tick once per motor revolution or three times per motor revolution? or does it depend when the phases are activated?

ok so:

  • i'm assuming this is an inrunner motor
  • i'm assuming the sensors are spaced by 120 deg bc that's common and makes the most sense?
  • the stator has two poles

therefore each sensor will tick once per rotation

@Armandpl
Copy link
Owner Author

Armandpl commented May 4, 2023

more motor notes:
BLUE: A
YELLOW: B
ORANGE: C

"B, Y, O" as in 'Bring Your Own.'

@Armandpl
Copy link
Owner Author

  • randomiser les parametres initiaux (v_x, v_y, yaw_rate) en plus de la position initiale
  • modeliser la steering rate du servo et l'accel max de la voiture
  • randomiser les parametres de la voiture autours des parametres actuels (e.g +- 10%)

@Armandpl
Copy link
Owner Author

Sur la vraie piste il y a des rampes à côté des chicanes, si on deborde de la piste potentiellement on se retourne, on casse la voiture et c'est la fin. P-e il faudrait prendre ça en compte dans le reward de l'agent? ajouter du bruit dans l'action et ajouter un penalty si on touche les rampes?

@Armandpl Armandpl linked a pull request May 21, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant