SMACC
Loading...
Searching...
No Matches
cp_costmap_switch.h
Go to the documentation of this file.
1/*****************************************************************************************************************
2 * ReelRobotix Inc. - Software License Agreement Copyright (c) 2018
3 * Authors: Pablo Inigo Blasco, Brett Aldrich
4 *
5 ******************************************************************************************************************/
6#pragma once
7
8#include <functional>
9#include <array>
10#include <ros/ros.h>
11
13#include <smacc/component.h>
14
15#include <dynamic_reconfigure/DoubleParameter.h>
16#include <dynamic_reconfigure/Reconfigure.h>
17#include <dynamic_reconfigure/Config.h>
18
19
20namespace cl_move_base_z
21{
22class CostmapProxy;
23
25{
26public:
27 enum class StandardLayers
28 {
33 };
34
35 static std::array<std::string, 4> layerNames;
36
38
39 virtual void onInitialize() override;
40
41 static std::string getStandardCostmapName(StandardLayers layertype);
42
43 bool exists(std::string layerName);
44
45 void enable(std::string layerName);
46
47 void enable(StandardLayers layerType);
48
49 void disable(std::string layerName);
50
51 void disable(StandardLayers layerType);
52
53 void registerProxyFromDynamicReconfigureServer(std::string costmapName, std::string enablePropertyName = "enabled");
54
55private:
56 std::map<std::string, std::shared_ptr<CostmapProxy>> costmapProxies;
58};
59//-------------------------------------------------------------------------
61{
62public:
63 CostmapProxy(std::string costmap_name, std::string enablePropertyName);
64
65 void setCostmapEnabled(bool value);
66
67private:
68 std::string costmapName_;
69 dynamic_reconfigure::Config enableReq;
70 dynamic_reconfigure::Config disableReq;
71
72 void dynreconfCallback(const dynamic_reconfigure::Config::ConstPtr &configuration_update);
73
74 ros::Subscriber dynrecofSub_;
75};
76}
dynamic_reconfigure::Config disableReq
void dynreconfCallback(const dynamic_reconfigure::Config::ConstPtr &configuration_update)
dynamic_reconfigure::Config enableReq
void registerProxyFromDynamicReconfigureServer(std::string costmapName, std::string enablePropertyName="enabled")
std::map< std::string, std::shared_ptr< CostmapProxy > > costmapProxies
static std::string getStandardCostmapName(StandardLayers layertype)
cl_move_base_z::ClMoveBaseZ * moveBaseClient_
void enable(std::string layerName)
virtual void onInitialize() override
bool exists(std::string layerName)
static std::array< std::string, 4 > layerNames
void disable(std::string layerName)