Skip to content

Commit 8eea99a

Browse files
committed
invisible pose, chill pose, and feeding neighbor work
1 parent 1ba6157 commit 8eea99a

File tree

7 files changed

+282
-203
lines changed

7 files changed

+282
-203
lines changed

config/gen2_feeding_demo.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ wheelchair:
5656
feedingDemo:
5757
heightAbovePlate: 0.15
5858
heightAboveFood: 0.08
59-
heightIntoFood: 0.085
59+
heightIntoFood: 0.105
6060
moveOutofFood: 0.025
6161
#distanceToPerson: 0.25
6262
distanceToPerson: 0.05

config/named_configs_gen2_6dof.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@ arm:
44
# hardcoded pose in front of person
55
# Wheelchair
66
in_front_person_pose: [-2.30252, 4.23221, 3.84109, -4.65546, 3.94225, 4.26543]
7+
# side_in_front_person_pose: [-0.28053, 4.316922, 4.187446, 0.562417, -1.9308152, -2.541829]
8+
side_in_front_person_pose: [2.74709, 2.01400, 1.85257, -2.83523, -1.61925, -2.67325]
79
# Tripod
810
# moveIFOPose: [-1.81753, 4.32404, 4.295815, 3.12878, 1.89724, -0.61526]
911
# Participant
1012
# moveIFOPose: [-2.30293, 4.04904, 3.63059, 1.62787, -2.34089, -2.01773]
1113
# Participant Tripod
1214
# moveIFOPose: [-1.81752, 4.60286, 4.64300, -3.05122, 1.89743, -0.61493]
1315
home_config: [-2.11666, 3.34967, 2.04129, -2.30031, -2.34026, 2.9545]
16+
# kinova_invisible_pose: [-1.56836, 2.61908, 0.46859, -1.60935, 0.09055, 1.74078] # Collides with the table
17+
invisible_pose: [-1.56836, 2.61908, 0.55755, -1.60935, 0.09055, 1.74078]
18+
# feed_other_person: [-0.189133, 3.220472, 1.560045, -1.817854, 0.732292, 1.276713]
19+
feed_other_person: [-0.378204, 3.410839, 1.590085, -2.009985, 0.857700, 1.464658]

include/feeding/util.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ void dumpSplinePhasePlot(const aikido::trajectory::Spline &spline,
6161
/// param[in] food_only If true, only food choices are valid
6262
/// param[in]] nodeHandle Ros Node to set food name for detection.
6363
std::string getUserFoodInput(bool food_only, ros::NodeHandle &nodeHandle,
64-
bool useAlexa = true, double timeout = 10);
64+
bool useAlexa = true, double timeout = 13);
6565

6666
int getUserInputWithOptions(const std::vector<std::string> &optionPrompts,
6767
const std::string &prompt);

scripts/demo.cpp

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,28 @@ void demo(
4343
if (feedingDemo.getFTThresholdHelper())
4444
feedingDemo.getFTThresholdHelper()->setThresholds(STANDARD_FT_THRESHOLD);
4545

46+
const std::shared_ptr<::ada::Ada> &ada = feedingDemo.getAda();
47+
int ifo_pose_i = getUserInputWithOptions(std::vector<std::string>{"(1) no","(2) yes"}, "Start in invisible pose?");
48+
if (ifo_pose_i == 2) {
49+
// NOTE: This is dangerous since we aren't using a constraint! It is done
50+
// to account for the strange orientation the head is sometimes placed in,
51+
// after perceiveFace,which messes up collision checking.
52+
auto trajectory = ada->getArm()->planToConfiguration(
53+
ada->getArm()->getNamedConfiguration("invisible_pose"));/*,
54+
ada->getArm()->getWorldCollisionConstraint());*/
55+
bool success = true;
56+
try {
57+
auto future = ada->getArm()->executeTrajectory(
58+
trajectory); // check velocity limits are set in FeedingDemo
59+
future.get();
60+
} catch (const std::exception &e) {
61+
dtwarn << "Exception in trajectoryExecution: " << e.what() << std::endl;
62+
success = false;
63+
}
64+
}
65+
4666
if (useSound)
47-
talk("What food would you like?", false);
67+
talk("What food would you like?", true);
4868

4969
auto foodName = getUserFoodInput(false, nodeHandle, feedingDemo.mUseAlexa);// "cantaloupe";//
5070
if (foodName == std::string("quit")) {

0 commit comments

Comments
 (0)