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

docs(tutorial): add traffic light in planning simulation: (1) use AutowareStatePanel for engaging the vehicle (2) add traffic light simulation #129

Conversation

soblin
Copy link
Contributor

@soblin soblin commented May 27, 2022

docs(tutorial): add traffic light in planning simulation: (1) use AutowareStatePanel for engaging the vehicle (2) add traffic light simulation
Signed-off-by: Mamoru Sobue mamoru.sobue@tier4.jp

Description

This PR updates the content of planning simulation tutorial.
(1) add description for how to use 'AutowareState panel' when the user engage the vehicle
(2) add description for the usage of traffic light panel, how to set/reset traffic light color during the simulation

Pre-review checklist for the PR author

The PR author must check the checkboxes below when creating the PR.

In-review checklist for the PR reviewers

The Reviewers must check the checkboxes below before approval.

Post-review checklist for the PR author

The PR author must check the checkboxes below before merging.

  • There are no open discussions or they are tracked via tickets.

After all checkboxes are checked, anyone who has write access can merge the PR.

@soblin soblin added the type:documentation Creating or refining documentation. label May 27, 2022
@soblin soblin force-pushed the feature/use-rviz-panel-and-add-traffic-light-psim branch 2 times, most recently from 9f9ffc2 to 2608685 Compare May 27, 2022 04:48
…owareStatePanel for engaging the vehicle (2) add traffic light simulation

Signed-off-by: Mamoru Sobue <mamoru.sobue@tier4.jp>
@soblin soblin force-pushed the feature/use-rviz-panel-and-add-traffic-light-psim branch from 2608685 to b1e6810 Compare May 27, 2022 04:50
@shmpwk shmpwk changed the title docs(tutorial): add traffic light in planning simulation docs(tutorial): add traffic light in planning simulation: (1) use AutowareStatePanel for engaging the vehicle (2) add traffic light simulation May 27, 2022
@shmpwk
Copy link
Contributor

shmpwk commented May 27, 2022

My construction suggestion.

Current version

  • Planning simulation
    • Preparation

      • 1 Download and unpack a sample map.
    • How to run a planning simulation

      • Launch Autoware
      • Open Autoware State Panel
      • Set an initial pose for the ego vehicle
      • Set a goal pose for the ego vehicle
      • Place a dummy object
      • Set traffic light
      • Engage the ego vehicle
      • Reset traffic light
    • How to simulate parking maneuvers

      • 1
      • 2
      • 3

My suggestion

Type 1

  • Planning simulation
    • Preparation
      • Download and unpack a sample map.
    • How to run lane driving
      • Launch Autoware
      • Open Autoware State Panel
      • Set an initial pose for the ego vehicle
      • Set a goal pose for the ego vehicle
      • Place a dummy object
      • Set traffic light
      • Engage the ego vehicle
      • Reset traffic light
    • How to simulate parking maneuvers
      • Launch Autoware ~ Set a goal pose for the ego vehicle, Engage the ego vehicle
        • 1
        • 2
        • 3

Type2

  • Planning simulation
    • Preparation
      • 1 Download and unpack a sample map.
    • How to run lane driving
      • 1 Launch Autoware
      • 2 Open Autoware State Panel
      • 3 Set an initial pose for the ego vehicle
        • a
        • b
      • 4 Set a goal pose for the ego vehicle
      • 5 Place a dummy object (Optional)
      • 6 Set traffic light (Optional)
      • 7 Engage the ego vehicle
      • 8 Reset traffic light (Optional)
    • How to simulate parking maneuvers
      • Following 1~4, 7
        • a
        • b
        • c

Copy link
Contributor

@shmpwk shmpwk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1. Set an initial pose and a goal pose, and engage the ego vehicle.

I suggest adding

Note that a goal pose should be set in the parking area.

IMO, some people include me mistakenly think that wherever the car can park.

@kminoda
Copy link
Contributor

kminoda commented May 27, 2022

@shmpwk Thanks for sharing your idea. My suggestion is as follows

Type 3

Tutorial

  • Planning simulation
    • Preparation
      • Download and unpack a sample map.
    • How to run lane driving
      • Launch Autoware
      • Open Autoware State Panel
      • Set an initial pose for the ego vehicle
      • Set a goal pose for the ego vehicle
      • Place a dummy object
    • How to simulate parking maneuvers
      • Launch Autoware ~ Set a goal pose for the ego vehicle, Engage the ego vehicle
        • 1
        • 2
        • 3
    • (Maybe stating For more advanced topics such as traffic light simulation, please refer to "How-to guides")

====
How-to guides

  • Simulating traffic light in planning simulation
    • Set traffic light
    • Engage the ego vehicle
    • Reset traffic light

@soblin
Copy link
Contributor Author

soblin commented May 27, 2022

Thanks, anyway I'll fix heading level and numbered/bulleted lists first

@soblin soblin marked this pull request as draft May 27, 2022 09:01
soblin and others added 2 commits May 30, 2022 09:42
Co-authored-by: Kenji Miyake <31987104+kenji-miyake@users.noreply.github.com>
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed and suggestions added. I also noted the following:

  • Since the page is called "Planning simulation" and it is in the tutorial section, I think that the "How to run a planning simulation" title can be removed and all sub-sections moved up in the heading hierarchy
  • Most of the images have been reduced to a more appropriate size to make things easier to read (👍🏾), but not the parking simulation images. Will these be redone later on?


2. Set an initial pose for the ego vehicle.
### Open Autoware State Panel
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Open Autoware State Panel
### Add Autoware State Panel


- a) Click the `2D Pose estimate` button in the toolbar, or hit the `P` key
- b) In the 3D View pane, click and hold the left-mouse button, and then drag to set the direction for the initial pose.
This panel is useful when we start planning simulation. Click `Panels -> Add new panel`, select `AutowareStatePanel`, and then press `OK`.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This panel is useful when we start planning simulation. Click `Panels -> Add new panel`, select `AutowareStatePanel`, and then press `OK`.
This panel is useful when running planning simulations. To add the panel, click `Panels -> Add new panel`, select `AutowareStatePanel`, and then click `OK`.

Comment on lines 51 to 55
### Place a dummy object

You can skip this step.

To place a dummy car/pedestrian, click the `2D Dummy Car` and/or `2D Dummy Pedestrian` button in the toolbar, and then set its pose by dragging on the map. You can set its velocity in `Tool Properties -> 2D Dummy Car/Pedestrian` panel. In the image the velocity is set to 0.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is simpler to mark the step as optional in the title. Thoughts or comments?
I also added some explanation about what zero velocity means for dummy objects.

Suggested change
### Place a dummy object
You can skip this step.
To place a dummy car/pedestrian, click the `2D Dummy Car` and/or `2D Dummy Pedestrian` button in the toolbar, and then set its pose by dragging on the map. You can set its velocity in `Tool Properties -> 2D Dummy Car/Pedestrian` panel. In the image the velocity is set to 0.
### Place a dummy object (optional)
To place a dummy car or pedestrian, click either the `2D Dummy Car` or the `2D Dummy Pedestrian` button in the toolbar, and then set its pose by dragging on the map. You can set the object's velocity in `Tool Properties -> 2D Dummy Car/Pedestrian` panel. In the image the velocity is set to 0 and so the dummy object will remain stationary.


![set-dummy-car](images/planning/lane-following/place-dummy-car.png)

To delete those objects, click the `Delete All Objects` button in the toolbar.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To delete those objects, click the `Delete All Objects` button in the toolbar.
To delete any dummy objects placed in the view, click the `Delete All Objects` button in the toolbar.

Comment on lines 61 to 65
### Set traffic light

You can skip this step.

To simulate traffic light recognition, go to `Panels -> Add new panel`, select `TrafficLightPublishPanel`, and then press `OK`. Then in the panel you need to set the `ID` and color of the traffic light.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same reasoning as above.

Suggested change
### Set traffic light
You can skip this step.
To simulate traffic light recognition, go to `Panels -> Add new panel`, select `TrafficLightPublishPanel`, and then press `OK`. Then in the panel you need to set the `ID` and color of the traffic light.
### Set traffic light (optional)
To simulate traffic light recognition, first go to `Panels -> Add new panel`, select `TrafficLightPublishPanel`, and then click `OK`. Then in the panel, input the id of the traffic light that you want to test, choose the color for the light and then click the `SET` button.


![start-driving](images/planning/lane-following/start-driving.png)
Now you can start driving by clicking `Engage` button in `AutowareStatePanel`. Or you can also manually `engage` the vehicle by running this command.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Now you can start driving by clicking `Engage` button in `AutowareStatePanel`. Or you can also manually `engage` the vehicle by running this command.
Now you can start the ego vehicle driving by clicking the `Engage` button in `AutowareStatePanel`. Alteratively, you can manually engage the vehicle by running the following command:


7. After that, the vehicle will restart driving and reach the goal.
### Reset traffic light
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Reset traffic light
### Reset traffic light (optional)


![restart-driving](images/planning/lane-following/restart-driving.png)
You can reset the color of the traffic light and let the vehicle make a turn at the intersection.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You can reset the color of the traffic light and let the vehicle make a turn at the intersection.
If you previously set a traffic light to `RED` or `AMBER`, you can reset the color of the traffic light to `GREEN` and let the ego vehicle make a turn at the intersection.


![set-dummy-pedestrian](images/planning/lane-following/set-dummy-pedestrian.png)
1. Click the `2D Nav Goal` button in the toolbar, or hit the `G` key
2. In the 3D View pane, click and hold the left-mouse button, and then drag to set the direction for the goal pose. Keep in mind to set the goal pose aligned with the lane direction. Otherwise the path will not be planned. Now you will see a planned path.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the warning about goal pose alignment to be a warning using the mkdocs admonition code block.

Suggested change
2. In the 3D View pane, click and hold the left-mouse button, and then drag to set the direction for the goal pose. Keep in mind to set the goal pose aligned with the lane direction. Otherwise the path will not be planned. Now you will see a planned path.
2. In the 3D View pane, click and hold the left-mouse button, and then drag to set the direction for the goal pose. If done correctly, you will see a planned path from initial pose to goal pose.
!!! warning
Remember to set the goal pose to be aligned with the lane direction, otherwise the path will not be planned!

- a) Click the `2D Nav Goal` button in the toolbar, or hit the `G` key
- b) In the 3D View pane, click and hold the left-mouse button, and then drag to set the direction for the goal pose.
1. Click the `2D Pose estimate` button in the toolbar, or hit the `P` key.
2. In the 3D View pane, click and hold the left-mouse button, and then drag to set the direction for the initial pose. The car should be placed in the right direction according to the lane(you can check the arrow on the lane). Now you will see a car on the Rviz.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if the initial pose direction is opposite to that of the lane. Will the vehicle still be displayed? If the vehicle is displayed, will path planning fail after the goal pose is (correctly) set?

Suggested change
2. In the 3D View pane, click and hold the left-mouse button, and then drag to set the direction for the initial pose. The car should be placed in the right direction according to the lane(you can check the arrow on the lane). Now you will see a car on the Rviz.
2. In the 3D View pane, click and hold the left-mouse button, and then drag to set the direction for the initial pose. An image representing the vehicle should now be displayed.
!!! warning
Remember to set the initial pose of the car in the same direction as the lane. To confirm the direction of the lane, check the arrowheads displayed on the map.

@ghost
Copy link

ghost commented May 31, 2022

Regarding the structure of these tutorials, I do not think that traffic light simulation should be separated from the planning simulator tutorial. Perhaps we could divide the tutorial into basic and advanced sections? For example:

  • Planning simulation
    • Preparation
      • Download and unpack a sample map.
    • Basic simulations
      • Lane driving
      • Parking maneuvers
    • Advanced simulations
      • Dummy objects
      • Traffic light simulation

@ghost ghost mentioned this pull request May 31, 2022
4 tasks
@soblin
Copy link
Contributor Author

soblin commented Jun 1, 2022

Sounds good. We can discuss this later after the merge of #124 and autowarefoundation/autoware.universe#1010, which improves traffic light UI (and a bit easier). On the granularity of this page I agree with your idea -- traffic light simulation should be a "basic" one

@ghost
Copy link

ghost commented Jun 2, 2022

Sounds good. We can discuss this later after the merge of #124 and autowarefoundation/autoware.universe#1010, which improves traffic light UI (and a bit easier). On the granularity of this page I agree with your idea -- traffic light simulation should be a "basic" one

@soblin #124 is now merged!

soblin and others added 2 commits June 6, 2022 15:46
@soblin soblin closed this Jun 6, 2022
@soblin soblin deleted the feature/use-rviz-panel-and-add-traffic-light-psim branch June 6, 2022 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:documentation Creating or refining documentation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants