Skip to content

Commit b4394ec

Browse files
committed
minor fix
1 parent 77a7d0c commit b4394ec

File tree

6 files changed

+22
-16
lines changed

6 files changed

+22
-16
lines changed

CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ endif(raspicam_FOUND)
9797
configure_file(data/Haar_Cascades/haarcascade_frontalface_alt.xml haarcascade_frontalface_alt.xml COPYONLY)
9898
configure_file(data/Haar_Cascades/haarcascade_smile.xml haarcascade_smile.xml COPYONLY)
9999
configure_file(data/Haar_Cascades/haarcascade_hand.xml haarcascade_hand.xml COPYONLY)
100-
configure_file(data/Facial_Landmark_Model/shape_predictor_26_face_landmarks.dat
101-
shape_predictor_26_face_landmarks.dat COPYONLY)
100+
configure_file(data/Facial_Landmark_Model/shape_predictor_68_face_landmarks.dat
101+
shape_predictor_68_face_landmarks.dat COPYONLY)
102102

103103
install (TARGETS sensor_vision DESTINATION lib/TinyCog)
104104
install (FILES include/sense/vision/BoxTracker.hpp

comm/spi/SpiComm.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ std::string SpiComm::send_data(std::string data)
111111
for(int i = 8; i < packet_len; i++)
112112
packet[i] = (uint8_t)data.at(i-8);
113113

114-
if(DEBUG){
114+
if(DBG){
115115
printf("Data in Packet:\n");
116116
for(int i = 0; i < packet_len; i++)
117117
printf("%.2X ", packet[i]);
@@ -137,7 +137,7 @@ std::string SpiComm::spi_send(uint8_t *packet, size_t packet_len)
137137
tr.bits_per_word = bpw;
138138

139139
int ret = ioctl(fd, SPI_IOC_MESSAGE(1), &tr);
140-
if(DEBUG) printf("Ret=%d\n", ret);
140+
if(DBG) printf("Ret=%d\n", ret);
141141
if(ret < 1)
142142
exit_p("Couldn't Send The Message");
143143

@@ -150,7 +150,7 @@ std::string SpiComm::spi_send(uint8_t *packet, size_t packet_len)
150150
//printf("%.2X ", ret_buffer[i]);
151151
}
152152

153-
if(DEBUG)
153+
if(DBG)
154154
printf("\nFinal Data Size = %d\n%s\n", ret_data.size(),
155155
ret_data.c_str());
156156
return ret_data;

dr-roboto/dr-roboto.cpp.in

+11-5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
#include <stdio.h>
1515
#include <vector>
16+
#include <unistd.h>
1617

1718

1819
#if _DR_ROBOTO_RPI_
@@ -32,14 +33,14 @@
3233
#define HAVE_GUILE
3334

3435
#include <opencog/atomspace/AtomSpace.h>
35-
#include <opencog/atoms/base/Node.h>
36+
#include <opencog/truthvalue/TruthValue.h>
37+
#include <opencog/truthvalue/AttentionValue.h>
38+
3639
#include <opencog/atoms/proto/FloatValue.h>
3740
#include <opencog/atoms/proto/LinkValue.h>
3841
#include <opencog/atoms/proto/StringValue.h>
3942

4043
#include <opencog/guile/SchemePrimitive.h>
41-
#include <opencog/truthvalue/TruthValue.h>
42-
#include <opencog/truthvalue/AttentionValue.h>
4344

4445

4546
#define SCALE 0.1
@@ -106,7 +107,7 @@ DrRoboto::DrRoboto() : c2g("c2g") , eh("eh") , fcd("fcd") , smd("smd") ,
106107
#if _DR_ROBOTO_RPI_
107108
cap = new RaspiCamCapture("cap", 320, 240, 20);
108109
#else //_DR_ROBOTO_RPI_
109-
cap = new CamCapture("cap", 320, 240, 20, 0);
110+
cap = new CamCapture("cap", 320, 240, 0, 20);
110111
#endif //_DR_ROBOTO_RPI_
111112

112113
/*
@@ -138,7 +139,12 @@ void DrRoboto::start_sense()
138139
Handle hh = _as->add_node(CONCEPT_NODE, "hand");
139140
Handle fi = _as->add_node(CONCEPT_NODE, "fingers");
140141
Handle pos_h = _as->add_node(CONCEPT_NODE, "position");
142+
Handle sen_h = _as->add_node(CONCEPT_NODE, "sense");
143+
Handle rate_h = _as->add_node(CONCEPT_NODE, "rate");
144+
//sen_h->setValue(rate_h, createFloatValue(1000)); //u-secs to delay sensor
145+
141146
ProtoAtomPtr pap;
147+
142148
while(ok) {
143149
frame = cap->getCurrentFrame();
144150
gr = c2g.Transform(frame);
@@ -231,7 +237,7 @@ void DrRoboto::start_sense()
231237
h->setValue(fi, pap);
232238
}
233239

234-
240+
usleep(10000);
235241
} //while ok
236242
}
237243

examples/sense/vision/FaceNoddingDetection.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
#define MODEL_FILE "shape_predictor_68_face_landmarks.dat"
2626

27-
//#define DEBUG
27+
//#define DBG
2828

2929
#define FRAME_RATE 20
3030
#define WINDOW FRAME_RATE*3
@@ -47,7 +47,7 @@ int main(int argc, char** argv)
4747

4848
std::vector<facial_lms> f_lms; //landmarks of faces detected
4949

50-
#ifdef DEBUG
50+
#ifdef DBG
5151
dlib::image_window win;
5252
#endif
5353

@@ -79,7 +79,7 @@ int main(int argc, char** argv)
7979
{
8080
facial_lms shape = f_lms[idx];
8181

82-
#ifdef DEBUG
82+
#ifdef DBG
8383
//if(upping > 0.4)
8484
std::cout<< shape.part(0).x() << "," << shape.part(16).x() << "," << shape.part(48).x() << ","
8585
<< shape.part(54).x() << "," << shape.part(33).x() << "," << shape.part(36).x() << ","
@@ -118,7 +118,7 @@ int main(int argc, char** argv)
118118
q = 0;
119119
}
120120

121-
#ifdef DEBUG
121+
#ifdef DBG
122122
dlib::array2d<dlib::bgr_pixel> img;
123123
dlib::assign_image(img, dlib::cv_image<dlib::bgr_pixel>(image));
124124
win.clear_overlay();

include/comm/spi/SpiComm.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
#define PACKET_SIZE_L_IDX 2
2727
#define PACKET_SIZE_H_IDX 3
28-
#define DEBUG 1
28+
#define DBG 1
2929

3030
class SpiComm
3131
{

include/sense/vision/FingersCount.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <vector>
2323
#include <stdint.h>
2424

25-
#define DEBUG
25+
#define DBG
2626

2727
/*
2828
TODO find a better way for depth range

0 commit comments

Comments
 (0)