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

Headlamp #8

Open
wants to merge 25 commits into
base: energy-quality
Choose a base branch
from
Open

Headlamp #8

wants to merge 25 commits into from

Conversation

schmerl
Copy link

@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

@@ -24,7 +24,7 @@
"objective": "energyConsumption",
"scaling-const": 0.3,
"min-step-value": 0.0,
"max-step-value": 2525
"max-step-value": 4185.0
Copy link
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.

@@ -28,9 +28,11 @@

private StateVarDefinition<Location> mrLocDef;
private EffectClass mEffectClass; // of rLoc
private StateVarDefinition<HeadlampState> mrHeadlampDef;
Copy link
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.

@@ -34,12 +34,13 @@
private FormulaActionDescription<MoveToAction> mrLocActionDesc;

public RobotLocationActionDescription(ActionDefinition<MoveToAction> moveToDef,
Precondition<MoveToAction> precondition, StateVarDefinition<Location> rLocDef) {
Precondition<MoveToAction> precondition, StateVarDefinition<Location> rLocDef, StateVarDefinition<HeadlampState> rHeadlampDef) {
Copy link
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
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