refactor
This commit is contained in:
+9
-15
@@ -37,9 +37,6 @@
|
|||||||
|
|
||||||
namespace svo {
|
namespace svo {
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
using namespace vk;
|
|
||||||
|
|
||||||
/// SVO Interface
|
/// SVO Interface
|
||||||
class VoNode
|
class VoNode
|
||||||
{
|
{
|
||||||
@@ -50,7 +47,7 @@ public:
|
|||||||
bool publish_dense_input_;
|
bool publish_dense_input_;
|
||||||
vk::UserInputThread* user_input_thread_;
|
vk::UserInputThread* user_input_thread_;
|
||||||
ros::Subscriber sub_remote_key_;
|
ros::Subscriber sub_remote_key_;
|
||||||
string remote_input_;
|
std::string remote_input_;
|
||||||
vk::AbstractCamera* cam_;
|
vk::AbstractCamera* cam_;
|
||||||
bool quit_;
|
bool quit_;
|
||||||
VoNode();
|
VoNode();
|
||||||
@@ -60,8 +57,7 @@ public:
|
|||||||
void remoteKeyCb(const std_msgs::StringConstPtr& key_input);
|
void remoteKeyCb(const std_msgs::StringConstPtr& key_input);
|
||||||
};
|
};
|
||||||
|
|
||||||
VoNode::
|
VoNode::VoNode() :
|
||||||
VoNode() :
|
|
||||||
vo_(NULL),
|
vo_(NULL),
|
||||||
publish_markers_(vk::getParam<bool>("svo/publish_markers", true)),
|
publish_markers_(vk::getParam<bool>("svo/publish_markers", true)),
|
||||||
publish_dense_input_(vk::getParam<bool>("svo/publish_dense_input", false)),
|
publish_dense_input_(vk::getParam<bool>("svo/publish_dense_input", false)),
|
||||||
@@ -88,16 +84,14 @@ VoNode() :
|
|||||||
vo_->start();
|
vo_->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
VoNode::
|
VoNode::~VoNode()
|
||||||
~VoNode()
|
|
||||||
{
|
{
|
||||||
delete vo_;
|
delete vo_;
|
||||||
delete user_input_thread_;
|
delete user_input_thread_;
|
||||||
delete cam_;
|
delete cam_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VoNode::
|
void VoNode::imgCb(const sensor_msgs::ImageConstPtr& msg)
|
||||||
imgCb(const sensor_msgs::ImageConstPtr& msg)
|
|
||||||
{
|
{
|
||||||
cv::Mat img;
|
cv::Mat img;
|
||||||
try {
|
try {
|
||||||
@@ -116,7 +110,7 @@ imgCb(const sensor_msgs::ImageConstPtr& msg)
|
|||||||
visualizer_.exportToDense(vo_->lastFrame());
|
visualizer_.exportToDense(vo_->lastFrame());
|
||||||
|
|
||||||
if(vo_->stage() == FrameHandlerMono::STAGE_PAUSED)
|
if(vo_->stage() == FrameHandlerMono::STAGE_PAUSED)
|
||||||
usleep(100000); // avoid busy loop when paused
|
usleep(100000);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VoNode::processUserActions()
|
void VoNode::processUserActions()
|
||||||
@@ -132,15 +126,15 @@ void VoNode::processUserActions()
|
|||||||
{
|
{
|
||||||
case 'q':
|
case 'q':
|
||||||
quit_ = true;
|
quit_ = true;
|
||||||
printf("Svo User Input: QUIT\n");
|
printf("SVO user input: QUIT\n");
|
||||||
break;
|
break;
|
||||||
case 'r':
|
case 'r':
|
||||||
vo_->reset();
|
vo_->reset();
|
||||||
printf("Svo User Input: RESET\n");
|
printf("SVO user input: RESET\n");
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
vo_->start();
|
vo_->start();
|
||||||
printf("Svo User Input: START\n");
|
printf("SVO user input: START\n");
|
||||||
break;
|
break;
|
||||||
default: ;
|
default: ;
|
||||||
}
|
}
|
||||||
@@ -175,6 +169,6 @@ int main(int argc, char **argv)
|
|||||||
// TODO check when last image was processed. when too long ago. publish warning that no msgs are received!
|
// TODO check when last image was processed. when too long ago. publish warning that no msgs are received!
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Svo terminated.\n");
|
printf("SVO terminated.\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user