Skip to content
Open
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
2 changes: 1 addition & 1 deletion bond/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.20)
project(bond)

# Default to C++14
Expand Down
2 changes: 1 addition & 1 deletion bond_core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.20)
project(bond_core)
# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
Expand Down
2 changes: 1 addition & 1 deletion bondcpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.20)
project(bondcpp)

if(NOT CMAKE_CXX_STANDARD)
Expand Down
15 changes: 11 additions & 4 deletions bondcpp/include/bondcpp/bond.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,22 @@
#include <string>
#include <vector>

#include "bond/msg/constants.hpp"
#include "bond/msg/status.hpp"

#include "bondcpp/BondSM_sm.hpp"
#include "bondcpp/visibility_control.hpp"

#include <rclcpp/rclcpp.hpp>
#include <rclcpp_lifecycle/lifecycle_node.hpp>
#include "rclcpp/duration.hpp"
#include "rclcpp/node.hpp"
#include "rclcpp/node_interfaces/node_base_interface.hpp"
#include "rclcpp/node_interfaces/node_logging_interface.hpp"
#include "rclcpp/node_interfaces/node_parameters_interface.hpp"
#include "rclcpp/node_interfaces/node_timers_interface.hpp"
#include "rclcpp/node_interfaces/node_topics_interface.hpp"
#include "rclcpp/publisher.hpp"
#include "rclcpp/subscription.hpp"
#include "rclcpp/timer.hpp"
#include "rclcpp_lifecycle/lifecycle_node.hpp"

namespace bond
{
Expand Down Expand Up @@ -276,7 +284,6 @@ class Bond : public std::enable_shared_from_this<Bond>
rclcpp::Duration heartbeat_period_;
rclcpp::Duration dead_publish_period_;

rclcpp::CallbackGroup::SharedPtr sub_callback_group_;
rclcpp::Subscription<bond::msg::Status>::SharedPtr sub_;
rclcpp::Publisher<bond::msg::Status>::SharedPtr pub_;
};
Expand Down
21 changes: 19 additions & 2 deletions bondcpp/src/bond.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,20 @@
#include <utility>
#include <vector>

#include <rclcpp/rclcpp.hpp>
#include <rclcpp_lifecycle/lifecycle_node.hpp>
#include "bond/msg/constants.hpp"

#include "rclcpp/clock.hpp"
#include "rclcpp/create_publisher.hpp"
#include "rclcpp/create_subscription.hpp"
#include "rclcpp/create_timer.hpp"
#include "rclcpp/duration.hpp"
#include "rclcpp/logging.hpp"
#include "rclcpp/parameter.hpp"
#include "rclcpp/qos.hpp"
#include "rclcpp/rate.hpp"
#include "rclcpp/time.hpp"
#include "rclcpp/utilities.hpp"
#include "rclcpp_lifecycle/lifecycle_node.hpp"

using namespace std::chrono_literals;

Expand Down Expand Up @@ -265,6 +277,11 @@ void Bond::setHeartbeatTimeout(double dur)

void Bond::heartbeatTimerReset()
{
if (heartbeat_timer_) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to work I think. heartbeat_timeout_ can change using setHeartbeatTimeout but since it doesn't change when started_, its OK as this only occurs after its started.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just adding the comment for a future reviewer that I'm sure will want to track down the same thing.

heartbeat_timer_->reset();
return;
}

// Callback function of heartbeat timer
auto heartbeatTimerResetCallback =
[this]() -> void
Expand Down
2 changes: 1 addition & 1 deletion smclib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.20)
project(smclib)

if(NOT CMAKE_CXX_STANDARD)
Expand Down
2 changes: 1 addition & 1 deletion test_bond/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.20)
project(test_bond)

# Default to C++14
Expand Down
5 changes: 4 additions & 1 deletion test_bond/test/test_callbacks_cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@

#include "bondcpp/bond.hpp"

#include "rclcpp/rclcpp.hpp"
#include "rclcpp/duration.hpp"
#include "rclcpp/executors/single_threaded_executor.hpp"
#include "rclcpp/node.hpp"
#include "rclcpp/utilities.hpp"
#include "rclcpp_lifecycle/lifecycle_node.hpp"

#include "test_bond/srv/test_bond.hpp"
Expand Down