projects
/
201903hackathon.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
experiment with reverse
[201903hackathon.git]
/
cpp
/
openCVnaiveObstacleAvoidance
/
openCVnaiveObstacleAvoidance.cpp
diff --git
a/cpp/openCVnaiveObstacleAvoidance/openCVnaiveObstacleAvoidance.cpp
b/cpp/openCVnaiveObstacleAvoidance/openCVnaiveObstacleAvoidance.cpp
index
5849e23
..
9758346
100644
(file)
--- a/
cpp/openCVnaiveObstacleAvoidance/openCVnaiveObstacleAvoidance.cpp
+++ b/
cpp/openCVnaiveObstacleAvoidance/openCVnaiveObstacleAvoidance.cpp
@@
-59,6
+59,9
@@
class MyListener : public IDepthDataListener
const string bobbycar_left = "l";
const string bobbycar_right = "r";
const string bobbycar_left = "l";
const string bobbycar_right = "r";
+ uint8_t bobbycar_reversing = 254;
+ royale::Vector<royale::String> boobycar_reversing_script ={"s","b","b","b","b","r","b","r","b","r","b"};
+
public :
public :
@@
-265,6
+268,11
@@
private:
void naiveObstacleAvoidanceDemo()
{
void naiveObstacleAvoidanceDemo()
{
+ if (bobbycar_reversing<boobycar_reversing_script.size()) {
+ std::cout << boobycar_reversing_script.at(bobbycar_reversing++);
+ }
+
+
bool free_paths[num_dist_columns_];
if (naiveIsObstaclePresent(free_paths))
{
bool free_paths[num_dist_columns_];
if (naiveIsObstaclePresent(free_paths))
{
@@
-284,6
+292,7
@@
private:
} else {
// std::cout << "STOP" << std::endl;
std::cout << bobbycar_stop << std::endl;
} else {
// std::cout << "STOP" << std::endl;
std::cout << bobbycar_stop << std::endl;
+ bobbycar_reversing = 0;
}
} else {
std::cout << bobbycar_forward << std::endl;
}
} else {
std::cout << bobbycar_forward << std::endl;