Skip to content

Commit

Permalink
Reuse base class publish topic name
Browse files Browse the repository at this point in the history
add missing getter
  • Loading branch information
jlblancoc committed Aug 8, 2024
1 parent c421f63 commit c6d601f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 1 addition & 4 deletions mrpt_sensor_gnss_nmea/src/mrpt_sensor_gnss_nmea_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,7 @@ void process_gps(

auto& pubs = NMEA_Pubs::Instance();

std::string publish_topic = "sensor";
node.declare_parameter("publish_topic", publish_topic);
node.get_parameter("publish_topic", publish_topic);
pubs.ensure_pubs_are_created(node, publish_topic);
pubs.ensure_pubs_are_created(node, node.publish_topic());

std_msgs::msg::Header msgHeader;
msgHeader.frame_id = node.sensor_frame_id();
Expand Down
1 change: 1 addition & 0 deletions mrpt_sensorlib/include/mrpt_sensorlib/mrpt_sensorlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class GenericSensorNode : public rclcpp::Node
std::shared_ptr<tf2_ros::TransformBroadcaster> tf_bc_;

const auto sensor_frame_id() const { return sensor_frame_id_; }
const auto publish_topic() const { return publish_topic_; }

private:
// ----------------- ROS 2 params -----------------
Expand Down

0 comments on commit c6d601f

Please sign in to comment.