Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions nav2_amcl/src/amcl_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ AmclNode::checkLaserReceived()
RCLCPP_WARN(
get_logger(), "Laser scan has not been received"
" (and thus no pose updates have been published)."
" Verify that data is being published on the %s topic.", scan_topic_);
" Verify that data is being published on the %s topic.", scan_topic_.c_str());
return;
}

Expand All @@ -415,7 +415,7 @@ AmclNode::checkLaserReceived()
RCLCPP_WARN(
get_logger(), "No laser scan received (and thus no pose updates have been published) for %f"
" seconds. Verify that data is being published on the %s topic.",
d.nanoseconds() * 1e-9, scan_topic_);
d.nanoseconds() * 1e-9, scan_topic_.c_str());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ class BtActionNode : public BT::ActionNodeBase
const BT::NodeConfiguration & conf)
: BT::ActionNodeBase(xml_tag_name, conf), action_name_(action_name)
{
node_ = config().blackboard->get<rclcpp::Node::SharedPtr>("node");
node_ = config().blackboard->template get<rclcpp::Node::SharedPtr>("node");

// Get the required items from the blackboard
server_timeout_ =
config().blackboard->get<std::chrono::milliseconds>("server_timeout");
config().blackboard->template get<std::chrono::milliseconds>("server_timeout");
getInput<std::chrono::milliseconds>("server_timeout", server_timeout_);

// Initialize the input and output messages
Expand Down Expand Up @@ -245,9 +245,9 @@ class BtActionNode : public BT::ActionNodeBase
void increment_recovery_count()
{
int recovery_count = 0;
config().blackboard->get<int>("number_recoveries", recovery_count); // NOLINT
config().blackboard->template get<int>("number_recoveries", recovery_count); // NOLINT
recovery_count += 1;
config().blackboard->set<int>("number_recoveries", recovery_count); // NOLINT
config().blackboard->template set<int>("number_recoveries", recovery_count); // NOLINT
}

std::string action_name_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ class BtServiceNode : public BT::SyncActionNode
const BT::NodeConfiguration & conf)
: BT::SyncActionNode(service_node_name, conf), service_node_name_(service_node_name)
{
node_ = config().blackboard->get<rclcpp::Node::SharedPtr>("node");
node_ = config().blackboard->template get<rclcpp::Node::SharedPtr>("node");

// Get the required items from the blackboard
server_timeout_ =
config().blackboard->get<std::chrono::milliseconds>("server_timeout");
config().blackboard->template get<std::chrono::milliseconds>("server_timeout");
getInput<std::chrono::milliseconds>("server_timeout", server_timeout_);

// Now that we have node_ to use, create the service client for this BT service
Expand Down Expand Up @@ -126,9 +126,9 @@ class BtServiceNode : public BT::SyncActionNode
void increment_recovery_count()
{
int recovery_count = 0;
config().blackboard->get<int>("number_recoveries", recovery_count); // NOLINT
config().blackboard->template get<int>("number_recoveries", recovery_count); // NOLINT
recovery_count += 1;
config().blackboard->set<int>("number_recoveries", recovery_count); // NOLINT
config().blackboard->template set<int>("number_recoveries", recovery_count); // NOLINT
}

std::string service_name_, service_node_name_;
Expand Down
7 changes: 1 addition & 6 deletions nav2_bt_navigator/src/ros_topic_logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,7 @@ void RosTopicLogger::callback(

// BT timestamps are a duration since the epoch. Need to convert to a time_point
// before converting to a msg.
#ifndef _WIN32
event.timestamp =
tf2_ros::toMsg(std::chrono::time_point<std::chrono::high_resolution_clock>(timestamp));
#else
event.timestamp = tf2_ros::toMsg(timestamp);
#endif
event.timestamp = tf2_ros::toMsg(tf2::TimePoint(timestamp));
event.node_name = node.name();
event.previous_status = toStr(prev_status, false);
event.current_status = toStr(status, false);
Expand Down
5 changes: 5 additions & 0 deletions nav2_costmap_2d/include/nav2_costmap_2d/observation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ class Observation
delete cloud_;
}

/**
* @brief Explicitly define copy assignment operator for Observation as it has a user-declared destructor
*/
Observation & operator=(const Observation &) = default;

/**
* @brief Creates an observation from an origin point and a point cloud
* @param origin The origin point of the observation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include "nav2_costmap_2d/observation.hpp"
#include "nav2_util/lifecycle_node.hpp"


namespace nav2_costmap_2d
{
/**
Expand Down Expand Up @@ -80,7 +81,7 @@ class ObservationBuffer
double min_obstacle_height, double max_obstacle_height, double obstacle_range,
double raytrace_range, tf2_ros::Buffer & tf2_buffer, std::string global_frame,
std::string sensor_frame,
double tf_tolerance);
tf2::Duration tf_tolerance);

/**
* @brief Destructor... cleans up
Expand Down Expand Up @@ -146,7 +147,7 @@ class ObservationBuffer
double min_obstacle_height_, max_obstacle_height_;
std::recursive_mutex lock_; ///< @brief A lock for accessing data in callbacks safely
double obstacle_range_, raytrace_range_;
double tf_tolerance_;
tf2::Duration tf_tolerance_;
};
} // namespace nav2_costmap_2d
#endif // NAV2_COSTMAP_2D__OBSERVATION_BUFFER_HPP_
2 changes: 1 addition & 1 deletion nav2_costmap_2d/plugins/obstacle_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ void ObstacleLayer::onInitialize()
node, topic, observation_keep_time, expected_update_rate,
min_obstacle_height,
max_obstacle_height, obstacle_range, raytrace_range, *tf_, global_frame_,
sensor_frame, transform_tolerance)));
sensor_frame, tf2::durationFromSec(transform_tolerance))));

// check if we'll add this buffer to our marking observation buffers
if (marking) {
Expand Down
6 changes: 3 additions & 3 deletions nav2_costmap_2d/src/observation_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ ObservationBuffer::ObservationBuffer(
double expected_update_rate,
double min_obstacle_height, double max_obstacle_height, double obstacle_range,
double raytrace_range, tf2_ros::Buffer & tf2_buffer, std::string global_frame,
std::string sensor_frame, double tf_tolerance)
std::string sensor_frame, tf2::Duration tf_tolerance)
: tf2_buffer_(tf2_buffer),
observation_keep_time_(rclcpp::Duration::from_seconds(observation_keep_time)),
expected_update_rate_(rclcpp::Duration::from_seconds(expected_update_rate)),
Expand Down Expand Up @@ -95,7 +95,7 @@ void ObservationBuffer::bufferCloud(const sensor_msgs::msg::PointCloud2 & cloud)
local_origin.point.x = 0;
local_origin.point.y = 0;
local_origin.point.z = 0;
tf2_buffer_.transform(local_origin, global_origin, global_frame_);
tf2_buffer_.transform(local_origin, global_origin, global_frame_, tf_tolerance_);
tf2::convert(global_origin.point, observation_list_.front().origin_);

// make sure to pass on the raytrace/obstacle range
Expand All @@ -106,7 +106,7 @@ void ObservationBuffer::bufferCloud(const sensor_msgs::msg::PointCloud2 & cloud)
sensor_msgs::msg::PointCloud2 global_frame_cloud;

// transform the point cloud
tf2_buffer_.transform(cloud, global_frame_cloud, global_frame_);
tf2_buffer_.transform(cloud, global_frame_cloud, global_frame_, tf_tolerance_);
global_frame_cloud.header.stamp = cloud.header.stamp;

// now we need to remove observations from the cloud that are below
Expand Down
3 changes: 3 additions & 0 deletions nav2_dwb_controller/nav_2d_utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ set(dependencies
tf2_geometry_msgs
nav2_msgs
nav2_util
nav_2d_msgs
)

include_directories(
Expand Down Expand Up @@ -53,6 +54,8 @@ ament_target_dependencies(tf_help
${dependencies}
)

target_link_libraries(tf_help conversions)

install(TARGETS conversions path_ops tf_help
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
Expand Down
2 changes: 1 addition & 1 deletion nav2_recoveries/include/nav2_recoveries/recovery.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class Recovery : public nav2_core::Recovery

collision_checker_ = collision_checker;

vel_pub_ = node->create_publisher<geometry_msgs::msg::Twist>("cmd_vel", 1);
vel_pub_ = node->template create_publisher<geometry_msgs::msg::Twist>("cmd_vel", 1);

onConfigure();
}
Expand Down
2 changes: 2 additions & 0 deletions nav2_util/src/dump_params.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <libgen.h>

#include <iomanip>
#include <iostream>
#include <memory>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@
#ifndef NAV2_WAYPOINT_FOLLOWER__PLUGINS__PHOTO_AT_WAYPOINT_HPP_
#define NAV2_WAYPOINT_FOLLOWER__PLUGINS__PHOTO_AT_WAYPOINT_HPP_

/**
* While C++17 isn't the project standard. We have to force LLVM/CLang
* to ignore deprecated declarations
*/
#define _LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_FILESYSTEM


#include <experimental/filesystem>
#include <mutex>
#include <string>
Expand Down
7 changes: 5 additions & 2 deletions nav2_waypoint_follower/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@
<maintainer email="stevenmacenski@gmail.com">Steve Macenski</maintainer>
<license>Apache-2.0</license>

<depend>tf2_ros</depend>

<buildtool_depend>ament_cmake</buildtool_depend>

<depend>nav2_common</depend>
<depend>cv_bridge</depend>
<depend>pluginlib</depend>
<depend>image_transport</depend>
<depend>rclcpp</depend>
<depend>rclcpp_action</depend>
<depend>rclcpp_lifecycle</depend>
<depend>nav_msgs</depend>
<depend>nav2_msgs</depend>
<depend>nav2_util</depend>
<depend>nav2_core</depend>
<depend>tf2_ros</depend>

<test_depend>ament_lint_common</test_depend>
<test_depend>ament_lint_auto</test_depend>
Expand Down
2 changes: 1 addition & 1 deletion smac_planner/src/a_star.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ AStarAlgorithm<NodeSE2>::NodePtr AStarAlgorithm<NodeSE2>::getAnalyticPath(
float d = node->motion_table.state_space->distance(from(), to());
NodePtr prev(node);
// A move of sqrt(2) is guaranteed to be in a new cell
constexpr float sqrt_2 = std::sqrt(2.);
static const float sqrt_2 = std::sqrt(2.);
unsigned int num_intervals = std::floor(d / sqrt_2);

using PossibleNode = std::pair<NodePtr, Coordinates>;
Expand Down