From 6d3d2eeb551934af09aece94106d325a36f72e79 Mon Sep 17 00:00:00 2001 From: FrankE Date: Fri, 22 Apr 2016 12:24:22 +0200 Subject: [PATCH] new activities --- grid/walk/GridWalk.h | 3 ++- grid/walk/GridWalkPathControl.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/grid/walk/GridWalk.h b/grid/walk/GridWalk.h index 31c0ea9..cbef10a 100644 --- a/grid/walk/GridWalk.h +++ b/grid/walk/GridWalk.h @@ -9,7 +9,8 @@ enum class Activity { UNKNOWN, STANDING, WALKING, - STAIRS, + STAIRS_UP, + STAIRS_DOWN, ELEVATOR, }; diff --git a/grid/walk/GridWalkPathControl.h b/grid/walk/GridWalkPathControl.h index 87926ee..afae95c 100644 --- a/grid/walk/GridWalkPathControl.h +++ b/grid/walk/GridWalkPathControl.h @@ -105,7 +105,8 @@ private: const double nodeProb = (possible.distToTarget < prev.distToTarget) ? 1 : pOther; // from previous node double actProb = 1.0; - if (act == Activity::STAIRS) {actProb = (prev.z_cm != possible.z_cm) ? (0.8) : (0.2);} + if (act == Activity::STAIRS_UP) {actProb = (prev.z_cm < possible.z_cm) ? (0.8) : (0.2);} + if (act == Activity::STAIRS_DOWN) {actProb = (prev.z_cm > possible.z_cm) ? (0.8) : (0.2);} if (act == Activity::WALKING) {actProb = (prev.z_cm == possible.z_cm) ? (0.8) : (0.2);} // bring it together