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

Controller selection in OpenCDA #202

Closed
hlwei opened this issue Apr 24, 2023 · 2 comments
Closed

Controller selection in OpenCDA #202

hlwei opened this issue Apr 24, 2023 · 2 comments

Comments

@hlwei
Copy link

hlwei commented Apr 24, 2023

How to specify the controller in OpenCDA? I know there is a PID controller in the source code. But I cannot find where you define the controller type. Could you please provide some comments and help on this? Thx.

@wangxso
Copy link

wangxso commented Aug 3, 2023

in the default.yaml you can specify the controller like this

 controller:
    type: pid_controller # this has to be exactly the same name as the controller py file
    args:
      lat:
        k_p: 0.75
        k_d: 0.02
        k_i: 0.4
      lon:
        k_p: 0.37
        k_d: 0.024
        k_i: 0.032
      dynamic: false # whether use dynamic pid setting
      dt: ${world.fixed_delta_seconds} # this should be equal to your simulation time-step
      max_brake: 1.0
      max_throttle: 1.0
      max_steering: 0.3

and you need write some controller algorithm in opencda/core/actuation/xxx_controller.py
I don't know if it's right or not, I hope it can help you.

@wangxso
Copy link

wangxso commented Aug 3, 2023

in the default.yaml you can specify the controller like this

 controller:
    type: pid_controller # this has to be exactly the same name as the controller py file
    args:
      lat:
        k_p: 0.75
        k_d: 0.02
        k_i: 0.4
      lon:
        k_p: 0.37
        k_d: 0.024
        k_i: 0.032
      dynamic: false # whether use dynamic pid setting
      dt: ${world.fixed_delta_seconds} # this should be equal to your simulation time-step
      max_brake: 1.0
      max_throttle: 1.0
      max_steering: 0.3

and you need write some controller algorithm in opencda/core/actuation/xxx_controller.py I don't know if it's right or not, I hope it can help you.

and you also can read the doc with customization

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