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

Make topic name configurable #104

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cfg/sick_tcp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ sick_driver:
max_ang: 1.57
intensity: true
skip: 0
pub_topic_scan: "scan"
frame_id: "laser"
time_offset: -0.001
publish_datagram: false

auto_reboot: true
3 changes: 2 additions & 1 deletion cfg/sick_usb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ sick_driver:
max_ang: 2.35619449019
intensity: true
skip: 0
pub_topic_scan: "scan"
frame_id: "laser"
time_offset: -0.001
publish_datagram: false
auto_reboot: true
auto_reboot: true
1 change: 1 addition & 0 deletions include/sick_tim/sick_tim_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ struct SickTimConfig
double max_ang;
bool intensity;
int skip;
std::string pub_topic_scan;
std::string frame_id;
double time_offset;
bool auto_reboot;
Expand Down
1 change: 1 addition & 0 deletions src/sick_tim551_2050001.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ int main(int argc, char ** argv)
node->declare_parameter("max_ang", 0.75 * M_PI);
node->declare_parameter("intensity", true);
node->declare_parameter("skip", 0);
node->declare_parameter("pub_topic_scan", "scan");
node->declare_parameter("frame_id", "laser");
node->declare_parameter("time_offset", -0.001);
node->declare_parameter("auto_reboot", true);
Expand Down
3 changes: 2 additions & 1 deletion src/sick_tim_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ SickTimCommon::SickTimCommon(
config_.max_ang = node_->get_parameter("max_ang").as_double();
config_.intensity = node_->get_parameter("intensity").as_bool();
config_.skip = node_->get_parameter("skip").as_int();
config_.pub_topic_scan = node_->get_parameter("pub_topic_scan").as_string();
config_.frame_id = node_->get_parameter("frame_id").as_string();
config_.time_offset = node_->get_parameter("time_offset").as_double();
config_.auto_reboot = node_->get_parameter("auto_reboot").as_bool();
Expand All @@ -88,7 +89,7 @@ SickTimCommon::SickTimCommon(
}

// scan publisher
pub_ = node_->create_publisher<sensor_msgs::msg::LaserScan>("scan", 1000);
pub_ = node_->create_publisher<sensor_msgs::msg::LaserScan>(config_.pub_topic_scan, 1000);
diagnosticPub_ = new diagnostic_updater::DiagnosedPublisher<sensor_msgs::msg::LaserScan>(
pub_, *diagnostics_,
// frequency should be target +- 10%.
Expand Down