Skip to content

Commit

Permalink
Images added to pdf report. TUG waits for second hand raising correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
fbrand-new committed Apr 6, 2023
1 parent 2599f4f commit 9bdf398
Show file tree
Hide file tree
Showing 10 changed files with 89 additions and 187 deletions.
2 changes: 1 addition & 1 deletion app/conf/joystick_trigger_8bitdo.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Ax0 cartesian_xyz 0

//Important: you can execute only one-word commands or scripts
[BUTTONS_EXECUTE]
button7 /usr/local/src/robot/assistive-rehab/app/scripts/speech_trigger.sh
button4 /usr/local/src/robot/assistive-rehab/app/scripts/speech_trigger.sh

// **** Buttons ****
// button0 A
Expand Down
3 changes: 2 additions & 1 deletion modules/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
# All Rights Reserved.
# Authors: Ugo Pattacini <[email protected]>

add_subdirectory(lineDetector_new)
#add_subdirectory(lineDetector_new)
add_subdirectory(lineDetector)
add_subdirectory(motionAnalyzer)
add_subdirectory(skeletonViewer)
add_subdirectory(skeletonRetriever)
Expand Down
4 changes: 2 additions & 2 deletions modules/managerTUG/app/conf/config-it.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ target-sim (4.5 0.0 0.0)
engage-distance (0.0 2.0)
engage-azimuth (80.0 110.0)
exercise-timeout 15.0
questions-timeout 25.0
raising-hand-timeout 15.0
questions-timeout 20.0
raising-hand-timeout 20.0
2 changes: 1 addition & 1 deletion modules/managerTUG/app/conf/speak-it.ini
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ value "Mi dispiace, non so rispondere a questa domanda."

[section-22]
key "explain-questions"
value "Se vuoi farmi una domanda, per favore premi il tasto erre sul telecomando all'inizio e alla fine della domanda."
value "Se vuoi farmi una domanda, per favore premi il tasto sul telecomando all'inizio e alla fine della domanda."

[section-23]
key "line"
Expand Down
4 changes: 2 additions & 2 deletions modules/managerTUG/src/Manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ bool Manager::configure(ResourceFinder &rf)
period=rf.check("period",Value(0.1)).asFloat64();
_exercise_timeout = rf.check("exercise-timeout",Value(15)).asFloat64();
_questions_timeout = rf.check("questions-timeout",Value(15)).asFloat64();
_raising_hand_timeout = rf.check("raising-hand-timeout",Value(8)).asFloat64();
_raising_hand_timeout = rf.check("raising-hand-timeout",Value(20)).asFloat64();
speak_file=rf.check("speak-file",Value("speak-it")).asString();
arm_thresh=rf.check("arm-thresh",Value(0.6)).asFloat64();
detect_hand_up=rf.check("detect-hand-up",Value(false)).asBool();
Expand Down Expand Up @@ -1218,7 +1218,7 @@ bool Manager::updateModule()
{
yCDebugOnce(MANAGERTUG) << "Entering State::wait_to_start";
prev_state = state;
t0 = 0;
t0 = Time::now();
if(!has_started_interaction)
{
start_interaction();
Expand Down
51 changes: 2 additions & 49 deletions modules/skeletonRetriever/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -693,14 +693,10 @@ class Retriever : public RFModule
/****************************************************************/
bool update_gaze_frame()
{
Property* p;
if (p=gazePort.read(false))
if (Property* p=gazePort.read(false))
{
if (Bottle* b=p->find("depth_center").asList())
if (Bottle* b=p->find("depth_rgb").asList())
{
Stamp stamp;
gazePort.getEnvelope(stamp);
//cout << fixed << stamp.getTime();
if (b->size()>=7)
{
Vector pos(3);
Expand Down Expand Up @@ -960,9 +956,6 @@ class Retriever : public RFModule
// handle skeletons acquired from detector
if (Bottle *b1=skeletonsPort.read(false))
{
auto w = dcm2rpy(gazeFrame);
//yDebug() << w.toString(); // << " "<< b1->toString();

if (Bottle *b2=b1->get(0).asList())
{
// acquire skeletons with sufficient number of key-points
Expand All @@ -975,46 +968,11 @@ class Retriever : public RFModule
shared_ptr<MetaSkeleton> s=create(b3);
if (isValid(s))
{
//yDebug() << s.get()->skeleton.get()->keypoints[0].getPoint().toString();
//SkeletonStd k = ;
// std::string sss = std::string("head");
auto l = s->skeleton;
auto p = applyTransform(l);

yDebug() << w.toString() << " " << (*p)["head"]->getPoint().toString() <<
(*l)["head"]->getPoint().toString() <<
rootFrame[0][0] <<
rootFrame[0][1] <<
rootFrame[0][2] <<
rootFrame[0][3] <<
rootFrame[1][0] <<
rootFrame[1][1] <<
rootFrame[1][2] <<
rootFrame[1][3] <<
rootFrame[2][0] <<
rootFrame[2][1] <<
rootFrame[2][2] <<
rootFrame[2][3] <<
rootFrame[3][0] <<
rootFrame[3][1] <<
rootFrame[3][2] <<
rootFrame[3][3];

// yDebug() << *(s->skeleton)[std::string("head")]->getPoint().toString();
new_accepted_skeletons.push_back(s);
}
}
}

// yDebug() << "dt" << dt;
// yDebug() << "Number of new accepted skeletons: " << new_accepted_skeletons.size(); //new_skeletons at each frame: we expect 1 at a time.
// for(auto& i: new_accepted_skeletons)
// yDebug() << i.get()->skeleton.get()->getTag();
// yDebug() << "Number of skeletons in memory before update" << skeletons.size();
// for(auto& i: skeletons)
// yDebug() << i.get()->skeleton.get()->getTag();


// update existing skeletons / create new skeletons
if (!new_accepted_skeletons.empty())
{
Expand Down Expand Up @@ -1051,11 +1009,6 @@ class Retriever : public RFModule
enforce_tag_uniqueness_pending(pending);
viewerUpdate(viewer_remove_tags);
}

// yDebug() << "Number of skeletons in memory after update" << skeletons.size();
// for(auto& i: skeletons)
// yDebug() << i.get()->skeleton.get()->getTag();

}
}

Expand Down
1 change: 0 additions & 1 deletion modules/speechInteraction/modules/googleSpeech/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ class Processing : public yarp::os::TypedReaderCallback<yarp::sig::Sound>
b.clear();
}
else {
yDebug() << "Sending everything ok to bottle";
outStatus.addString("everything ok");
}
statusPort.write();
Expand Down
Loading

0 comments on commit 9bdf398

Please sign in to comment.