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

Taimya only moves backwards in basic_motion #133

Open
ParkerAI opened this issue Jun 23, 2022 · 2 comments
Open

Taimya only moves backwards in basic_motion #133

ParkerAI opened this issue Jun 23, 2022 · 2 comments

Comments

@ParkerAI
Copy link

Gotten the hardware and software installed, and attempting to get basic motion to work. Steering was reversed, but responded fine, however, throttle will only move backwards, and will only accept positive values. Making either throttle or throttle_gain negative causes the car to simply sit in place and no action can be heard from the motor. I had once instance where it responded moving forward and backward correctly, but I'm not sure what caused it, it occurred in the middle of testing, and I have yet to be able to replicate it.

So right now the car will only take positive values for throttle, and because it's reserved, it will only move backwards. Wracking my brain for a solution, but can't find anything.

@gotbordom
Copy link

gotbordom commented Jun 30, 2022

This sounds almost like the both the steering servo and the motor controller were plugged into the pins on the controller backwards?

@krissdap
Copy link

@ParkerAI
For steering issue, you can modify steering_gain in jetracer/nvidia_racecar.py it defaults to -0.65, try setting to positive value, you might need to try adjusting steering_offset too if you can't make it center.

For forward/backward issue, if it only goes backwards, try working with throttle_gain from the same file.

For example,

from jetracer.nvidia_racecar import NvidiaRacecar

car = NvidiaRacecar()
car.steering_gain = traitlets.Float(default_value=0.65)
car.throttle_gain = traitlets.Float(default_value=-0.8)

The other problem of going in one direction not the other, it's probably because the behavior of the ESC (Electronic speed controller). Most modern ESC has three possible outputs: forward, brake, and backward.

To confirm this, send command in one direction, see the motor spin (in your case it's still going backward), then send command in another direction, the motor should stop, then repeat the same command again, the motor should now spin the the other direction (forward in your case).

If this is confirmed, then add code to your backward instruction.

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

No branches or pull requests

3 participants