IceNavigator.cpp
Go to the documentation of this file.
1 #include "IceNavigator.h"
2 
4 
6 
7 
9 {
10 
11  std::vector<Eigen::Matrix4f>
12  convert(const std::vector<armarx::navigation::core::Pose>& ps)
13  {
14  using namespace armarx::navigation;
15  std::vector<Eigen::Matrix4f> ms;
16  ms.reserve(ps.size());
18  ps.begin(), ps.end(), std::back_inserter(ms), [](const auto& p) { return p.matrix(); });
19  return ms;
20  }
21 
23  {
24  // pass
25  }
26 
27 
28  IceNavigator::IceNavigator(const NavigatorInterfacePrx& navigator) : navigator(navigator)
29  {
30  // pass
31  }
32 
34  {
35  // pass
36  }
37 
38  void
39  IceNavigator::setNavigatorComponent(const NavigatorInterfacePrx& navigator)
40  {
41  this->navigator = navigator;
42  }
43 
44  void
46  const std::string& configId)
47  {
49  this->configId = configId;
50  navigator->createConfig(config.toAron(), configId);
51  }
52 
53  void
54  IceNavigator::moveTo(const std::vector<core::Pose>& waypoints,
55  core::NavigationFrame navigationFrame)
56  {
58 
59  navigator->begin_moveTo(
60  convert(waypoints), core::NavigationFrameNames.to_name(navigationFrame), configId);
61  }
62 
63 
64  void
65  IceNavigator::moveTo(const std::vector<client::WaypointTarget>& targets,
66  core::NavigationFrame navigationFrame)
67  {
69 
70  navigator->moveTo2(
71  freeze(targets), core::NavigationFrameNames.to_name(navigationFrame), configId);
72  }
73 
74  void IceNavigator::moveToLocation(const std::string& location)
75  {
77  navigator->moveToLocation(location, configId);
78  }
79 
80  void
82  core::NavigationFrame navigationFrame)
83  {
85 
86  navigator->moveTowards(
87  direction, core::NavigationFrameNames.to_name(navigationFrame), configId);
88  }
89 
90  void
91  IceNavigator::update(const std::vector<core::Pose>& waypoints,
92  core::NavigationFrame navigationFrame)
93  {
95 
96  navigator->updateMoveTo(
97  convert(waypoints), core::NavigationFrameNames.to_name(navigationFrame), configId);
98  }
99 
100  void
102  {
103  navigator->pause(configId);
104  }
105 
106  void
108  {
109  navigator->resume(configId);
110  }
111 
112  void
114  {
115  navigator->stop(configId);
116  }
117 
118  bool
119  IceNavigator::isPaused() const noexcept
120  {
121  return navigator->isPaused(configId);
122  }
123 
124  bool
125  IceNavigator::isStopped() const noexcept
126  {
127  return navigator->isStopped(configId);
128  }
129 
130 
131 } // namespace armarx::navigation::client
armarx::navigation::client::IceNavigator::resume
void resume() override
Definition: IceNavigator.cpp:107
armarx::navigation::client::IceNavigator::IceNavigator
IceNavigator()
Definition: IceNavigator.cpp:22
armarx::navigation::client::IceNavigator::update
void update(const std::vector< core::Pose > &waypoints, core::NavigationFrame navigationFrame) override
Definition: IceNavigator.cpp:91
armarx::navigation::client::IceNavigator::setNavigatorComponent
void setNavigatorComponent(const NavigatorInterfacePrx &navigator)
Definition: IceNavigator.cpp:39
armarx::navigation::client::IceNavigator::pause
void pause() override
Definition: IceNavigator.cpp:101
armarx::navigation::client::NavigationStackConfig::toAron
aron::data::dto::DictPtr toAron() const
Definition: NavigationStackConfig.cpp:27
armarx::navigation::client::IceNavigator::isPaused
bool isPaused() const noexcept override
Definition: IceNavigator.cpp:119
armarx::navigation::core::NavigationFrame
NavigationFrame
Definition: types.h:43
armarx::navigation::client::freeze
client::detail::GlobalPlanningStrategy freeze(const client::GlobalPlanningStrategy &strategy)
Definition: ice_conversions.cpp:77
armarx::navigation::client::IceNavigator::moveToLocation
void moveToLocation(const std::string &location) override
Definition: IceNavigator.cpp:74
trace.h
armarx::navigation::client
This file is part of ArmarX.
Definition: ComponentPlugin.cpp:20
armarx::navigation::client::IceNavigator::~IceNavigator
~IceNavigator() override
Definition: IceNavigator.cpp:33
armarx::navigation::client::NavigationStackConfig
Definition: NavigationStackConfig.h:55
armarx::navigation
This file is part of ArmarX.
Definition: aron_conversions.cpp:13
armarx::navigation::core::NavigationFrameNames
const simox::meta::EnumNames< NavigationFrame > NavigationFrameNames
Definition: types.h:49
ARMARX_TRACE
#define ARMARX_TRACE
Definition: trace.h:69
armarx::navigation::client::IceNavigator::isStopped
bool isStopped() const noexcept override
Definition: IceNavigator.cpp:125
IceNavigator.h
armarx::navigation::client::IceNavigator::stop
void stop() override
Definition: IceNavigator.cpp:113
armarx::transform
auto transform(const Container< InputT, Alloc > &in, OutputT(*func)(InputT const &)) -> Container< OutputT, typename std::allocator_traits< Alloc >::template rebind_alloc< OutputT > >
Convenience function (with less typing) to transform a container of type InputT into the same contain...
Definition: algorithm.h:315
armarx::navigation::client::IceNavigator::moveTowards
void moveTowards(const core::Direction &direction, core::NavigationFrame navigationFrame) override
Definition: IceNavigator.cpp:81
armarx::navigation::core::Direction
Eigen::Vector3f Direction
Definition: basic_types.h:39
armarx::navigation::client::IceNavigator::createConfig
void createConfig(const client::NavigationStackConfig &config, const std::string &configId)
Definition: IceNavigator.cpp:45
armarx::navigation::client::convert
std::vector< Eigen::Matrix4f > convert(const std::vector< armarx::navigation::core::Pose > &ps)
Definition: IceNavigator.cpp:12
armarx::navigation::client::IceNavigator::moveTo
void moveTo(const std::vector< core::Pose > &waypoints, core::NavigationFrame navigationFrame) override
Definition: IceNavigator.cpp:54
types.h