Nav2 Navigation Stack - jazzy  jazzy
ROS 2 Navigation Stack
types.hpp
1 // Copyright (c) 2024 Open Navigation LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef OPENNAV_DOCKING__TYPES_HPP_
16 #define OPENNAV_DOCKING__TYPES_HPP_
17 
18 #include <unordered_map>
19 #include <string>
20 
21 #include "nav2_msgs/action/dock_robot.hpp"
22 #include "nav2_msgs/action/undock_robot.hpp"
23 #include "opennav_docking_core/charging_dock.hpp"
24 #include "opennav_docking_core/docking_exceptions.hpp"
25 
26 typedef nav2_msgs::action::DockRobot DockRobot;
27 typedef nav2_msgs::action::UndockRobot UndockRobot;
28 
32 struct Dock
33 {
34  geometry_msgs::msg::PoseStamped getStagingPose()
35  {
36  return this->plugin->getStagingPose(this->pose, this->frame);
37  }
38 
39  geometry_msgs::msg::Pose pose;
40  std::string frame;
41  std::string type;
42  std::string id;
43  opennav_docking_core::ChargingDock::Ptr plugin{nullptr};
44 };
45 
47 using DockPluginMap = std::unordered_map<std::string, opennav_docking_core::ChargingDock::Ptr>;
48 using DockMap = std::unordered_map<std::string, Dock>;
49 
50 #endif // OPENNAV_DOCKING__TYPES_HPP_
Abstract interface for a charging dock for the docking framework.
Definition: types.hpp:33