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

Carla Auto pilot does not work for xosc files #1115

Open
omkart opened this issue Oct 8, 2024 · 0 comments
Open

Carla Auto pilot does not work for xosc files #1115

omkart opened this issue Oct 8, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@omkart
Copy link

omkart commented Oct 8, 2024

Carla 0.9.15
Scenario-runner 0.9.14 and 0.9.15

if I change the following external_control to carla_autopilot as value I get the following error

<AssignControllerAction>
                <Controller name="HeroAgent">
                  <Properties>
                    <Property name="module" value="external_control"/>
                  </Properties>
                </Controller>
              </AssignControllerAction>

<AssignControllerAction>
                <Controller name="HeroAgent">
                  <Properties>
                    <Property name="module" value="carla_autopilot"/>
                  </Properties>
                </Controller>
              </AssignControllerAction>

File "/home/scenario_runner-0.9.15/srunner/scenariomanager/actorcontrols/actor_control.py", line 95, in init
self.control_instance = getattr(module_control, control_class_name)(actor, args)
AttributeError: module 'carla_autopilot' has no attribute 'CarlaAutopilot'
module 'carla_autopilot' has no attribute 'CarlaAutopilot'
Destroying ego vehicle 215

I found the issue that the value inputted needs to align with the name of the class being used to be imported.
for auto pilot control of the vehicle there is a class name carla_autopilot.py with the Class as CarlaAutoPilotControl

The following logic inside the actor_control.py
control_class_name = control_py_module.split('.')[-1].title().replace('_', '')

loads the class name as CarlaAutopilot ((Take a note of the P in Pilot is small here) instead of CarlaAutoPilotControl

This causes the following line to import the correct module but unable to find the class
self.control_instance = getattr(module_control, control_class_name)(actor, args)

The solution to this would be

  1. Modify the module file name to carla_auto_pilot_control.py
    And while adding the value in xosc file use "carla_auto_pilot_control"
    OR
  2. Add a the logic inside actor_control.py that will import modules and class independent of the absolute values entered in the xosc files
@omkart omkart added the bug Something isn't working label Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants