Skip to content

Headlamp#8

Open
schmerl wants to merge 25 commits intoenergy-qualityfrom
headlamp
Open

Headlamp#8
schmerl wants to merge 25 commits intoenergy-qualityfrom
headlamp

Conversation

@schmerl
Copy link
Copy Markdown

@schmerl schmerl commented Aug 27, 2021

This pull request shows how to add a headlamp turn on/off action to the robot scenario. The idea is that:

  1. Some of the corridors in the building are dark, and require the robot to use a headlamp
  2. Using the headlamp consumes additional energy

The changes in this PR are broadly described as:

  1. Added information about lighting to the map, and change code associated with reading the map.
  2. Adding actions to turn the headlamp on/off
  3. Adding preconditions that preclude moving into dark corridors without the headlamp being on.
  4. Adding a state to keep track of the headlamp
  5. Changing associated discriminant classes with information to do with MoveAction to include the headlamp state of the robot

"scaling-const": 0.3,
"min-step-value": 0.0,
"max-step-value": 2525
"max-step-value": 4185.0
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This needs to change to cater for added energy along the longest path if the headlamp was turned on.


private StateVarDefinition<Location> mrLocDef;
private EffectClass mEffectClass; // of rLoc
private StateVarDefinition<HeadlampState> mrHeadlampDef;
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Movement probability now depends on the headlamp state, so change this file to add headlamp as a discriminant class and to use it to calculate transition probability.


public RobotLocationActionDescription(ActionDefinition<MoveToAction> moveToDef,
Precondition<MoveToAction> precondition, StateVarDefinition<Location> rLocDef) {
Precondition<MoveToAction> precondition, StateVarDefinition<Location> rLocDef, StateVarDefinition<HeadlampState> rHeadlampDef) {
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Now depend on headlamp state var

@@ -1,44 +1,52 @@
package examples.mobilerobot.metrics;

import examples.mobilerobot.models.HeadlampState;
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

EnergyConsumption now depends on headlamp state, so add that here.

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

Successfully merging this pull request may close these issues.

1 participant