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

Debug and output flags cause UnicodeEncodeError #1055

Open
paulbourelly999 opened this issue Feb 16, 2024 · 1 comment
Open

Debug and output flags cause UnicodeEncodeError #1055

paulbourelly999 opened this issue Feb 16, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@paulbourelly999
Copy link

paulbourelly999 commented Feb 16, 2024

Describe the bug
Using the debug flag or the output flag causes uncaught encoding exceptions to crash scenario runner
Using versions 0.9.10 and 0.9.11

To Reproduce
Steps to reproduce the behavior:

  1. Create a scenario with CollisionTest criteria.
  2. set --debug or --output flags
  3. Run scenario using
python3 scenario_runner.py
      --scenario <your scenario>
      -- debug
      --record metrics/data/

Expected behavior
Debug logging for scenario runner active and working

Actual behavior
Crash with following logs

--------- Tick ---------

[DEBUG] VulnerableRoadUserCollision : Parallel.tick()
[DEBUG] Sequence             : Sequence.tick()
[DEBUG] root_sequence        : Sequence.tick()
[DEBUG] TriggerDistanceToVehicle : InTriggerDistanceToVehicle.tick()
[DEBUG] TriggerDistanceToVehicle : InTriggerDistanceToVehicle.update()[Status.RUNNING->Status.RUNNING]
[DEBUG] TimeOut              : TimeOut.tick()
[DEBUG] TimeOut              : TimeOut.update()[Status.RUNNING->Status.RUNNING]
[DEBUG] WeatherBehavior      : WeatherBehavior.tick()
[DEBUG] UpdateAllActorControls : UpdateAllActorControls.tick()
[DEBUG] Test Criteria        : Parallel.tick()
[DEBUG] CollisionTest        : CollisionTest.tick()
[DEBUG] CollisionTest        : CollisionTest.update()[Status.RUNNING->Status.RUNNING]


VulnerableRoadUserCollision [*]
[-] root_sequence [*]
    [-] root_sequence [*]
        --> TriggerDistanceToVehicle [*]
        (o) actor_behaviors [-]
            --> walk_across_street [-]
        --> DriveDistance [-]
--> TimeOut [*]
--> WeatherBehavior [*]
--> UpdateAllActorControls [*]
(o) Test Criteria [*]
    --> CollisionTest [*]

--------- Tick ---------

[DEBUG] VulnerableRoadUserCollision : Parallel.tick()
[DEBUG] Sequence             : Sequence.tick()
[DEBUG] root_sequence        : Sequence.tick()
[DEBUG] TriggerDistanceToVehicle : InTriggerDistanceToVehicle.tick()
[DEBUG] TriggerDistanceToVehicle : InTriggerDistanceToVehicle.update()[Status.RUNNING->Status.RUNNING]
[DEBUG] TimeOut              : TimeOut.tick()
[DEBUG] TimeOut              : TimeOut.update()[Status.RUNNING->Status.RUNNING]
[DEBUG] WeatherBehavior      : WeatherBehavior.tick()
[DEBUG] UpdateAllActorControls : UpdateAllActorControls.tick()
[DEBUG] Test Criteria        : Parallel.tick()
[DEBUG] CollisionTest        : CollisionTest.tick()
[DEBUG] CollisionTest        : CollisionTest.update()[Status.RUNNING->Status.RUNNING]


VulnerableRoadUserCollision [*]
[-] root_sequence [*]
    [-] root_sequence [*]
        --> TriggerDistanceToVehicle [*]
        (o) actor_behaviors [-]
            --> walk_across_street [-]
        --> DriveDistance [-]
--> TimeOut [*]
--> WeatherBehavior [*]
--> UpdateAllActorControls [*]
(o) Test Criteria [*]
    --> CollisionTest [*]

--------- Tick ---------

[DEBUG] VulnerableRoadUserCollision : Parallel.tick()
[DEBUG] Sequence             : Sequence.tick()
[DEBUG] root_sequence        : Sequence.tick()
[DEBUG] TriggerDistanceToVehicle : InTriggerDistanceToVehicle.tick()
[DEBUG] TriggerDistanceToVehicle : InTriggerDistanceToVehicle.update()[Status.RUNNING->Status.RUNNING]
[DEBUG] TimeOut              : TimeOut.tick()
[DEBUG] TimeOut              : TimeOut.update()[Status.RUNNING->Status.RUNNING]
[DEBUG] WeatherBehavior      : WeatherBehavior.tick()
[DEBUG] UpdateAllActorControls : UpdateAllActorControls.tick()
[DEBUG] Test Criteria        : Parallel.tick()
[DEBUG] CollisionTest        : CollisionTest.tick()
[DEBUG] CollisionTest        : CollisionTest.update()[Status.RUNNING->Status.RUNNING]


VulnerableRoadUserCollision [*]
[-] root_sequence [*]
    [-] root_sequence [*]
        --> TriggerDistanceToVehicle [*]
        (o) actor_behaviors [-]
            --> walk_across_street [-]
        --> DriveDistance [-]
--> TimeOut [*]
--> WeatherBehavior [*]
--> UpdateAllActorControls [*]
(o) Test Criteria [*]
    --> CollisionTest [*]

--------- Tick ---------

[DEBUG] VulnerableRoadUserCollision : Parallel.tick()
[DEBUG] Sequence             : Sequence.tick()
[DEBUG] root_sequence        : Sequence.tick()
[DEBUG] TriggerDistanceToVehicle : InTriggerDistanceToVehicle.tick()
[DEBUG] TriggerDistanceToVehicle : InTriggerDistanceToVehicle.update()[Status.RUNNING->Status.SUCCESS]
[DEBUG] TriggerDistanceToVehicle : InTriggerDistanceToVehicle.stop(Status.RUNNING->Status.SUCCESS)
[DEBUG] TriggerDistanceToVehicle : InTriggerDistanceToVehicle.terminate()[Status.RUNNING->Status.SUCCESS]
[DEBUG] actor_behaviors      : Parallel.tick()
[DEBUG] walk_across_street   : KeepVelocity.tick()
[DEBUG] walk_across_street   : KeepVelocity.initialise()
[DEBUG] walk_across_street   : KeepVelocity.update()[Status.INVALID->Status.RUNNING]
[DEBUG] TimeOut              : TimeOut.tick()
[DEBUG] TimeOut              : TimeOut.update()[Status.RUNNING->Status.RUNNING]
[DEBUG] WeatherBehavior      : WeatherBehavior.tick()
[DEBUG] UpdateAllActorControls : UpdateAllActorControls.tick()
[DEBUG] Test Criteria        : Parallel.tick()
[DEBUG] CollisionTest        : CollisionTest.tick()
[DEBUG] CollisionTest        : CollisionTest.update()[Status.RUNNING->Status.RUNNING]


VulnerableRoadUserCollision [*]
[-] root_sequence [*]
    [-] root_sequence [*]
Traceback (most recent call last):
  File "scenario_runner.py", line 405, in _load_and_run_scenario
'ascii' codec can't encode character '\u2713' in position 38: ordinal not in range(128)
    self.manager.run_scenario()
  File "/app/scenario_runner/srunner/scenariomanager/scenario_manager.py", line 133, in run_scenario
    self._tick_scenario(timestamp)
[DEBUG] UpdateAllActorControls : UpdateAllActorControls.terminate()[Status.RUNNING->Status.INVALID]
  File "/app/scenario_runner/srunner/scenariomanager/scenario_manager.py", line 178, in _tick_scenario
    py_trees.display.print_ascii_tree(self.scenario_tree, show_status=True)
  File "/usr/local/lib/python3.6/dist-packages/py_trees/display.py", line 184, in print_ascii_tree
    print("%s" % line)
UnicodeEncodeError: 'ascii' codec can't encode character '\u2713' in position 38: ordinal not in range(128)
[DEBUG] CollisionTest        : CollisionTest.terminate()[Status.RUNNING->Status.INVALID]
[DEBUG] TriggerDistanceToVehicle : InTriggerDistanceToVehicle.terminate()[Status.SUCCESS->Status.INVALID]
[DEBUG] DriveDistance        : DriveDistance.terminate()[Status.INVALID->Status.INVALID]
[DEBUG] walk_across_street   : KeepVelocity.terminate()[Status.RUNNING->Status.INVALID]
[DEBUG] UpdateAllActorControls : UpdateAllActorControls.terminate()[Status.RUNNING->Status.INVALID]
[DEBUG] CollisionTest        : CollisionTest.terminate()[Status.RUNNING->Status.INVALID]
[DEBUG] TriggerDistanceToVehicle : InTriggerDistanceToVehicle.terminate()[Status.SUCCESS->Status.INVALID]
[DEBUG] DriveDistance        : DriveDistance.terminate()[Status.INVALID->Status.INVALID]
[DEBUG] walk_across_street   : KeepVelocity.terminate()[Status.RUNNING->Status.INVALID]
No more scenarios .... Exiting
[DEBUG] UpdateAllActorControls : UpdateAllActorControls.terminate()[Status.RUNNING->Status.INVALID]
[DEBUG] CollisionTest        : CollisionTest.terminate()[Status.RUNNING->Status.INVALID]
[DEBUG] TriggerDistanceToVehicle : InTriggerDistanceToVehicle.terminate()[Status.SUCCESS->Status.INVALID]
[DEBUG] DriveDistance        : DriveDistance.terminate()[Status.INVALID->Status.INVALID]
[DEBUG] walk_across_street   : KeepVelocity.terminate()[Status.RUNNING->Status.INVALID]

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Cbuntu 18:04 (Docker)
  • CARLA Version 0.9.10
  • Python version 3.6
  • Version 0.9.10 and 0.9.11

Additional context
Add any other context about the problem here.

@paulbourelly999 paulbourelly999 added the bug Something isn't working label Feb 16, 2024
MishkaMN pushed a commit to usdot-fhwa-stol/carma-config that referenced this issue Feb 16, 2024
<!-- Thanks for the contribution, this is awesome. -->

# PR Details
## Description
Debug flag causes following error in scenario runner
(carla-simulator/scenario_runner#1055)
<!--- Describe your changes in detail -->

## Related Issue
carla-simulator/scenario_runner#1055
<!--- This project only accepts pull requests related to open issues -->
<!--- If suggesting a new feature or change, please discuss it in an
issue first -->
<!--- If fixing a bug, there should be an issue describing it with steps
to reproduce -->
<!--- Please link to the issue here: -->

## Motivation and Context
Avoid scenario runner crashes
<!--- Why is this change required? What problem does it solve? -->

## How Has This Been Tested?
CDASim deployment
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->

## Types of changes

<!--- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->

- [x] Defect fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that cause existing functionality
to change)

## Checklist:

<!--- Go over all the following points, and put an `x` in all the boxes
that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->

- [ ] I have added any new packages to the sonar-scanner.properties file
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [x] I have read the **CONTRIBUTING** document.
[CARMA Contributing
Guide](https://github.com/usdot-fhwa-stol/carma-platform/blob/develop/Contributing.md)
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.
@starrye
Copy link
Contributor

starrye commented Feb 18, 2024

In fact, py_trees version: 0.8.13 using \u2713 a check sign in py trees indicates success,but in the new version o is used to indicate success

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

3 participants