Skip to content

Commit 8ef1746

Browse files
committed
Use geometry_msgs::msg::Pose as Pose2D is now in vision_msgs
Signed-off-by: Francisco Martín Rico <fmrico@gmail.com>
1 parent 2932f56 commit 8ef1746

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

plansys2_bt_actions/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ if(BUILD_TESTING)
6969
find_package(plansys2_msgs REQUIRED)
7070
find_package(test_msgs REQUIRED)
7171
find_package(geometry_msgs REQUIRED)
72-
72+
find_package(tf2_geometry_msgs)
7373
add_subdirectory(test)
7474
endif()
7575

plansys2_bt_actions/test/behavior_tree/Move.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919

2020
#include "Move.hpp"
2121

22-
#include "geometry_msgs/msg/pose2_d.hpp"
22+
#include "geometry_msgs/msg/pose.hpp"
23+
#include "tf2_geometry_msgs/tf2_geometry_msgs.hpp"
2324

2425
#include "behaviortree_cpp/behavior_tree.h"
2526

@@ -50,10 +51,10 @@ Move::Move(
5051

5152
std::vector<double> coords;
5253
if (node->get_parameter_or("waypoint_coords." + wp, coords, {})) {
53-
geometry_msgs::msg::Pose2D pose;
54-
pose.x = coords[0];
55-
pose.y = coords[1];
56-
pose.theta = coords[2];
54+
geometry_msgs::msg::Pose pose;
55+
pose.position.x = coords[0];
56+
pose.position.y = coords[1];
57+
pose.orientation = tf2::toMsg(tf2::Quaternion({0.0, 0.0, 1.0}, coords[2]));
5758

5859
waypoints_[wp] = pose;
5960
} else {
@@ -70,7 +71,7 @@ Move::on_tick()
7071
std::string goal;
7172
getInput<std::string>("goal", goal);
7273

73-
geometry_msgs::msg::Pose2D pose2nav;
74+
geometry_msgs::msg::Pose pose2nav;
7475
if (waypoints_.find(goal) != waypoints_.end()) {
7576
pose2nav = waypoints_[goal];
7677
} else {

plansys2_bt_actions/test/behavior_tree/Move.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include <string>
1919
#include <map>
2020

21-
#include "geometry_msgs/msg/pose2_d.hpp"
21+
#include "geometry_msgs/msg/pose.hpp"
2222
#include "test_msgs/action/fibonacci.hpp"
2323

2424
#include "plansys2_bt_actions/BTActionNode.hpp"
@@ -49,7 +49,7 @@ class Move : public plansys2::BtActionNode<test_msgs::action::Fibonacci>
4949

5050
private:
5151
int goal_reached_;
52-
std::map<std::string, geometry_msgs::msg::Pose2D> waypoints_;
52+
std::map<std::string, geometry_msgs::msg::Pose> waypoints_;
5353
};
5454

5555
} // namespace plansys2_bt_tests

plansys2_bt_actions/test/unit/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ foreach(bt_plugin ${plugin_libs})
2323
target_link_libraries(${bt_plugin}
2424
behaviortree_cpp::behaviortree_cpp
2525
${geometry_msgs_TARGETS}
26+
tf2_geometry_msgs::tf2_geometry_msgs
2627
rclcpp::rclcpp
2728
rclcpp_action::rclcpp_action
2829
rclcpp_lifecycle::rclcpp_lifecycle

0 commit comments

Comments
 (0)