Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support auto reset setting #27

Merged
merged 3 commits into from Feb 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions include/vssp.h
Expand Up @@ -129,6 +129,13 @@ class VsspDriver
{
cb_ping_ = cb;
}
void setAutoReset(const bool enable)
{
if (enable)
send(std::string("SET:_ars=1\n"));
else
send(std::string("SET:_ars=0\n"));
}
[[deprecated("use setHorizontalInterlace() instead of setInterlace()")]]
void setInterlace(const int itl)
{
Expand Down
6 changes: 6 additions & 0 deletions src/hokuyo3d.cpp
Expand Up @@ -200,6 +200,8 @@ class Hokuyo3dNode
{
ROS_INFO("Connection established");
ping();
if (set_auto_reset_)
driver_.setAutoReset(auto_reset_);
driver_.setHorizontalInterlace(horizontal_interlace_);
driver_.requestHorizontalTable();
driver_.setVerticalInterlace(vertical_interlace_);
Expand Down Expand Up @@ -235,6 +237,8 @@ class Hokuyo3dNode
pnh_.param("imu_frame_id", imu_frame_id_, frame_id_ + "_imu");
pnh_.param("mag_frame_id", mag_frame_id_, frame_id_ + "_mag");
pnh_.param("range_min", range_min_, 0.0);
set_auto_reset_ = pnh_.hasParam("auto_reset");
pnh_.param("auto_reset", auto_reset_, false);

std::string output_cycle;
pnh_.param("output_cycle", output_cycle, std::string("field"));
Expand Down Expand Up @@ -402,6 +406,8 @@ class Hokuyo3dNode
std::string frame_id_;
std::string imu_frame_id_;
std::string mag_frame_id_;
bool auto_reset_;
bool set_auto_reset_;
};

int main(int argc, char **argv)
Expand Down