Component.cpp
Go to the documentation of this file.
1/**
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @package Navigation::ArmarXObjects::Navigator
17 * @author Fabian Reister ( fabian dot reister at kit dot edu )
18 * @author Christian R. G. Dreher ( c dot dreher at kit dot edu )
19 * @date 2021
20 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
21 * GNU General Public License
22 */
23
24#include "Component.h"
25
26#include <algorithm>
27#include <cmath>
28#include <cstdint>
29#include <experimental/memory>
30#include <iterator>
31#include <memory>
32#include <optional>
33#include <string>
34#include <tuple>
35#include <utility>
36#include <vector>
37
38#include <Eigen/Geometry>
39
40#include <Ice/Current.h>
41
42#include <opencv2/core/eigen.hpp>
43
44#include <SimoxUtility/color/ColorMap.h>
45#include <SimoxUtility/color/cmaps/colormaps.h>
46
56
59#include <RobotAPI/interface/ArViz/Elements.h>
60#include <RobotAPI/interface/aron/Aron.h>
62
64#include <armarx/navigation/client/ice/NavigatorInterface.h>
83
88
89namespace armarx::navigation
90{
91
92 std::vector<core::Pose>
93 convert(const std::vector<Eigen::Matrix4f>& wps)
94 {
95 std::vector<core::Pose> p;
96 p.reserve(wps.size());
97 std::transform(wps.begin(),
98 wps.end(),
99 std::back_inserter(p),
100 [](const auto& p) { return core::Pose(p); });
101 return p;
102 }
103
104} // namespace armarx::navigation
105
107{
108
109 Component::Component() : parameterizationService(nullptr, nullptr)
110 // publisher(&resultsWriter, &eventsWriter)
111 {
112 // scene().timeServer = &timeServer;
113
114 addPlugin(parameterizationReaderPlugin);
115 addPlugin(parameterizationWriterPlugin);
116 addPlugin(eventsWriterPlugin);
117 addPlugin(resultsWriterPlugin);
118 addPlugin(graphReaderPlugin);
119 addPlugin(costmapReaderPlugin);
120 addPlugin(costmap3dReaderPlugin);
121 addPlugin(humanReaderPlugin);
122 addPlugin(laserScannerFeaturesReaderPlugin);
123
124 addPlugin(virtualRobotReaderPlugin);
125
126 parameterizationService = server::MemoryParameterizationService(
127 &parameterizationReaderPlugin->get(), &parameterizationWriterPlugin->get());
128 }
129
130
131 Component::~Component() = default;
132
133 void
135 {
136 usingProxy("RobotStateMemory");
137 usingProxy("ObjectMemory");
138 usingProxy("navigation_memory");
139 }
140
141 void
143 {
145
146 // virtualRobotReaderPlugin->get().setSyncTimeout(Duration::MilliSeconds(20));
147 // virtualRobotReaderPlugin->get().setSleepAfterSyncFailure(Duration::MilliSeconds(10));
148
150
151 // initialize scene provider
153 {
155 .graphReader = &graphReaderPlugin->get(),
156 .costmapReader = &costmapReaderPlugin->get(),
157 .costmap3dReader = &costmap3dReaderPlugin->get(),
158 .virtualRobotReader = &virtualRobotReaderPlugin->get(),
159 .humanReader = &humanReaderPlugin->get(),
160 .laserScannerFeaturesReader = &laserScannerFeaturesReaderPlugin->get(),
161 .objectPoseClient = ObjectPoseClientPluginUser::getClient()};
162
163 // emplace (below) will be effectless if object is already initialized
164 if (sceneProvider)
165 {
166 ARMARX_INFO << "Resetting scene provider";
167 sceneProvider.reset();
168 }
169 sceneProvider.emplace(srv, params.sceneCfg);
170 }
171
173
175
176 if (not params.disableExecutor)
177 {
178 if (executor)
179 {
180 ARMARX_INFO << "Executor will be reset.";
181 executor.reset();
182 }
183
184 executor.emplace(
187 .robotName = params.sceneCfg.robotName,
188 .rtUnitDynamicallyLoadLibraries = params.rtUnitDynamicallyLoadLibraries});
189 }
190
192
193 if(introspector)
194 {
195 ARMARX_INFO << "Resetting introspector";
196 introspector.reset();
197 }
198 introspector = server::ArvizIntrospector(
200 // memoryIntrospector = server::MemoryIntrospector(resultsWriterPlugin->get(), );
201
202 // initialized = true;
203
204 // Setup the remote GUI.
205 {
208 }
209
210 ARMARX_INFO << "Initialized. Will now respond to navigation requests.";
211 }
212
213 void
215 {
217
218 // "Running" in a broader sense. The navigator could also be paused but will be stopped subsequenty.
219 const bool isAnyNavigatorRunning = std::any_of(navigators.begin(),
220 navigators.end(),
221 [](const auto& p) -> bool
222 {
223 const server::Navigator& navigator =
224 p.second;
225
226 return not navigator.isStopped();
227 });
228
229
230 if (isAnyNavigatorRunning)
231 {
233 << "A navigator was running when the component got disconnected. Will try to stop "
234 "as much as possible but expect something to be broken now.";
235 }
236
237 stopAllImpl(isAnyNavigatorRunning);
238
239 sceneProvider.reset();
240 executor.reset();
241 introspector.reset();
242 }
243
244 void
248
249 bool
251 {
253 return sceneProvider->initialize(armarx::Clock::Now());
254 }
255
256 std::string
258 {
259 return GetDefaultName();
260 }
261
262 std::string
264 {
265 return "navigator";
266 }
267
268 void
270 const std::string& callerId,
271 const Ice::Current&)
272 {
273 // TODO: Not thread-safe.
275 ARMARX_INFO << "Creating config for caller " << QUOTED(callerId);
276
277 parameterizationService.store(stackConfig, callerId, armarx::Clock::Now());
278
281 sceneProvider->scene(),
284
285 // FIXME unify this. The local planner also needs the visu. Yet, it is passed to the navigation stack factory above now.
286 // set visualization of LocalPlanner
287 if (stack.localPlanner)
288 {
289 stack.localPlanner->setVisualization(getArvizClient());
290 }
291
292 memoryIntrospectors.emplace_back(
293 std::make_unique<server::MemoryIntrospector>(resultsWriterPlugin->get(), callerId));
294
295 // keep track of all memory publishers
296 memoryPublishers.emplace(
297 callerId,
298 std::make_unique<server::MemoryPublisher>(
299 &resultsWriterPlugin->get(), &eventsWriterPlugin->get(), callerId));
300
301 server::ExecutorInterface* executorPtr = nullptr;
302 if (executor.has_value())
303 {
304 executorPtr = &executor.value();
305 }
306
307 // Extract goal reached config from stack config if present
308 server::GoalReachedMonitorConfig goalReachedCfg = params.navigatorGoalReachedConfig;
309 {
310 aron::data::Dict aronDict(stackConfig);
311 const std::string goalReachedKey =
313 if (aronDict.hasElement(goalReachedKey))
314 {
315 auto goalReachedElement =
316 aron::data::Dict::DynamicCast(aronDict.getElement(goalReachedKey));
317 if (goalReachedElement && goalReachedElement->hasElement(core::PARAMS_KEY))
318 {
319 auto paramsDict = aron::data::Dict::DynamicCast(
320 goalReachedElement->getElement(core::PARAMS_KEY));
321 if (paramsDict)
322 {
323 auto coreCfg = core::GoalReachedConfig::FromAron(paramsDict);
324 goalReachedCfg.posTh = coreCfg.posTh;
325 goalReachedCfg.oriTh = coreCfg.oriTh;
326 goalReachedCfg.linearVelTh = coreCfg.linearVelTh;
327 goalReachedCfg.angularVelTh = coreCfg.angularVelTh;
328 goalReachedCfg.filterCount = coreCfg.filterCount;
329 }
330 }
331 }
332 }
333
334 // if we emplace an existing key it is not replaced, so remove it first.
335 navigators.erase(callerId);
336 navigators.emplace(
337 std::piecewise_construct,
338 std::forward_as_tuple(callerId),
339 std::forward_as_tuple(
340 server::Navigator::Config{.stack = std::move(stack),
341 .general = params.navigatorGeneralConfig,
342 .goalReachedConfig = goalReachedCfg},
344 .executor = executorPtr,
345 .publisher = memoryPublishers.at(callerId).get(),
346 .introspector = introspector.has_value() ? &(introspector.value()) : nullptr,
347 .drawer = introspector.has_value() ? &(introspector.value()) : nullptr,
348 .debugObserverHelper = &getDebugObserverComponentPlugin(),
349 .sceneProvider =
350 sceneProvider.has_value() ? &sceneProvider.value() : nullptr}));
351 }
352
353 void
354 Component::removeConfig(const std::string& callerId, const Ice::Current&)
355 {
356 navigators.erase(callerId);
357 memoryPublishers.erase(callerId);
358 }
359
360 void
361 Component::moveTo(const std::vector<Eigen::Matrix4f>& waypoints,
362 const std::string& navigationMode,
363 const std::string& callerId,
364 const Ice::Current&)
365 {
367
368 ARMARX_INFO << "moveTo() requested by caller " << QUOTED(callerId)
369 << " with navigation mode `" << navigationMode << "`.";
370 ARMARX_CHECK(navigators.count(callerId) > 0)
371 << "Navigator config for caller " << QUOTED(callerId) << " not registered!";
372
373 try
374 {
375 navigators.at(callerId).moveTo(convert(waypoints),
376 core::NavigationFrameNames.from_name(navigationMode));
377 }
378 catch (...)
379 {
381
382 // TODO: Error handling.
383 ARMARX_WARNING << "Failed to execute moveTo()."
384 << "Movement will be paused.";
385 stopAll(); // TODO pause movement must not throw
386 throw;
387 }
388 }
389
390 void
391 Component::updateMoveTo(const std::vector<Eigen::Matrix4f>& waypoints,
392 const std::string& navigationMode,
393 const std::string& callerId,
394 const Ice::Current& /*c*/)
395 {
397
398 ARMARX_INFO << "updateMoveTo() requested by caller " << QUOTED(callerId);
399 ARMARX_CHECK(navigators.count(callerId) > 0)
400 << "Navigator config for caller " << QUOTED(callerId) << " not registered!";
401
402 const auto checkIsActiveNavigator = [&](const std::string& callerId)
403 {
404 const std::optional<std::string> activeNavigatorCallerId = activeNavigatorId();
405 if (not activeNavigatorCallerId.has_value())
406 {
407 ARMARX_VERBOSE << "No navigator is active.";
408 return false;
409 }
410
411 return activeNavigatorCallerId == callerId;
412 };
413
414 ARMARX_CHECK(checkIsActiveNavigator(callerId))
415 << "The navigator with id " << QUOTED(callerId) << " is not active!";
416
417 navigators.at(callerId).update(convert(waypoints),
418 core::NavigationFrameNames.from_name(navigationMode));
419 }
420
421 void
423 const std::string& navigationMode,
424 const std::string& callerId,
425 const Ice::Current& c)
426 {
428
429 ARMARX_IMPORTANT << "moveTo2 requested by caller " << QUOTED(callerId);
430
431 const std::vector<client::WaypointTarget> wps = client::defrost(waypoints);
432
433 ARMARX_CHECK(navigators.count(callerId) > 0)
434 << "Navigator config for caller " << QUOTED(callerId) << " not registered!";
435
436 navigators.at(callerId).moveTo(wps, core::NavigationFrameNames.from_name(navigationMode));
437 }
438
439 void
441 const std::string& navigationMode,
442 const std::string& callerId,
443 const Ice::Current& c)
444 {
446
447 ARMARX_INFO << "moveToAlternatives() requested by caller " << QUOTED(callerId)
448 << " with navigation mode `" << navigationMode << "`.";
449 ARMARX_CHECK(navigators.count(callerId) > 0)
450 << "Navigator config for caller " << QUOTED(callerId) << " not registered!";
451
452 const std::vector<core::TargetAlternative> alts = client::defrost(targets);
453
454 try
455 {
456 navigators.at(callerId).moveToAlternatives(
457 alts, core::NavigationFrameNames.from_name(navigationMode));
458 }
459 catch (...)
460 {
462
463 // TODO: Error handling.
464 ARMARX_WARNING << "Failed to execute moveTo()."
465 << "Movement will be paused.";
466 stopAll(); // TODO pause movement must not throw
467 throw;
468 }
469 }
470
471 void
473 const IceUtil::Optional<std::string>& providerNameIce,
474 const std::string& callerId,
475 const Ice::Current& c)
476 {
478 ARMARX_INFO << "MoveToLocation " << QUOTED(location) << " requested by caller '" << callerId
479 << "'";
480
481 ARMARX_CHECK(navigators.count(callerId) > 0)
482 << "Navigator config for caller " << QUOTED(callerId) << " not registered!";
483
484 std::optional<std::string> providerName;
485 if (providerNameIce)
486 {
487 providerName = providerNameIce.value();
488 }
489
490 navigators.at(callerId).moveToLocation(location, providerName);
491 }
492
493 void
494 Component::moveTowards(const Eigen::Vector3f& direction,
495 const std::string& navigationMode,
496 const std::string& callerId,
497 const Ice::Current&)
498 {
499 // TODO: Error handling.
501 ARMARX_INFO << "MoveTowards requested by caller " << QUOTED(callerId);
502
503 ARMARX_CHECK(navigators.count(callerId) > 0)
504 << "Navigator config for caller " << QUOTED(callerId) << " not registered!";
505
506 navigators.at(callerId).moveTowards(direction,
507 core::NavigationFrameNames.from_name(navigationMode));
508 }
509
510 void
511 Component::setVelocityFactor(float velocityFactor,
512 const std::string& callerId,
513 const Ice::Current&)
514 {
516 ARMARX_CHECK(navigators.count(callerId) > 0)
517 << "Navigator config for caller " << QUOTED(callerId) << " not registered!";
518 navigators.at(callerId).setVelocityFactor(velocityFactor);
519 }
520
521 void
522 Component::pause(const std::string& configId, const Ice::Current&)
523 {
524 ARMARX_CHECK(navigators.count(configId) > 0)
525 << "Navigator config for caller " << QUOTED(configId) << " not registered!";
526 navigators.at(configId).pause();
527 }
528
529 void
530 Component::resume(const std::string& configId, const Ice::Current&)
531 {
533 ARMARX_CHECK(navigators.count(configId) > 0)
534 << "Navigator config for caller " << QUOTED(configId) << " not registered!";
535 navigators.at(configId).resume();
536 }
537
538 void
539 Component::stop(const std::string& configId, const Ice::Current&)
540 {
541 // FIXME make sure that event is emitted
543 ARMARX_CHECK(navigators.count(configId) > 0)
544 << "Navigator config for caller " << QUOTED(configId) << " not registered!";
545 navigators.at(configId).stop();
546
547 // emit UserAbortTriggered event
549 core::Pose(scene().robot->getGlobalPose())};
550 memoryPublishers.at(configId)->userAbortTriggered(event);
551 }
552
553 void
554 Component::stopAll(const Ice::Current&)
555 {
556 stopAllImpl(true);
557 }
558
559 void
560 Component::stopAllImpl(const bool emitMemoryEvent)
561 {
562 ARMARX_IMPORTANT << "stopAll()";
563
565 for (auto& [_, navigator] : navigators)
566 {
567 navigator.stop();
568 }
569
570 if (emitMemoryEvent)
571 {
572 ARMARX_INFO << "Trying to emit memory event `UserAbortTriggered`";
573 // emit UserAbortTriggered event
575 core::Pose(scene().robot->getGlobalPose())};
576
577 // This call might fail if the component is already disconnected from the NavigationMemory in onDisconnectComponent.
578 for (auto& [callerId, memoryPublisher] : memoryPublishers)
579 {
580 memoryPublisher->userAbortTriggered(event);
581 }
582 }
583 }
584
585 bool
586 Component::isPaused(const std::string& configId, const Ice::Current&)
587 {
589 ARMARX_CHECK(navigators.count(configId) > 0)
590 << "Navigator config for caller " << QUOTED(configId) << " not registered!";
591 return navigators.at(configId).isPaused();
592 }
593
594 const core::Scene&
596 {
597 ARMARX_CHECK_NOT_NULL(sceneProvider);
598 return sceneProvider->scene();
599 }
600
601 bool
602 Component::isStopped(const std::string& configId, const Ice::Current&)
603 {
605 ARMARX_CHECK(navigators.count(configId) > 0)
606 << "Navigator config for caller " << QUOTED(configId) << " not registered!";
607 return navigators.at(configId).isStopped();
608 }
609
612 {
614
616
617 // Publish to a topic (passing the TopicListenerPrx).
618 // def->topic(myTopicListener);
619
620 // Subscribe to a topic (passing the topic name).
621 // def->topic<PlatformUnitListener>("MyTopic");
622
623 // Add a required property.
624 // def->required(properties.boxLayerName, "p.box.LayerName", "Name of the box layer in ArViz.");
625
626 // Add an optionalproperty.
627 def->optional(params.occupiedGridThreshold,
628 "p.occupancy_grid.occopied_threshold",
629 "Threshold for each cell to be considered occupied. Increase this value to "
630 "reduce noise.");
631
632 def->optional(params.disableExecutor,
633 "p.disableExecutor",
634 "If the executor is disabled, the navigator will only plan the trajectory "
635 "but won't execute it.");
636
637 def->required(params.sceneCfg.robotName, "p.scene.robotName");
638 def->optional(params.sceneCfg.staticCostmapProviderName,
639 "p.scene.staticCostmapProviderName");
640 def->optional(params.sceneCfg.staticCostmapName, "p.scene.staticCostmapName");
641 def->optional(params.sceneCfg.costmap3dProviderName, "p.scene.costmap3dProviderName");
642 def->optional(params.sceneCfg.costmap3dName, "p.scene.costmap3dName");
643 def->optional(params.sceneCfg.humanProviderName, "p.scene.humanProviderName");
644 def->optional(params.sceneCfg.laserScannerFeaturesProviderName,
645 "p.scene.laserScannerFeaturesProviderName");
646
647 def->optional(params.rtUnitDynamicallyLoadLibraries,
648 "p.rtUnitDynamicallyLoadLibraries",
649 "If enabled, the controller library will automatically be loaded in the "
650 "RobotUnit. If disabled (desired), you have to make sure that the controller "
651 "library is listed in the RobotUnit's property `LoadLibraries`");
652
653
654 def->optional(params.navigatorGeneralConfig.tasks.replanningUpdatePeriod,
655 "p.navigator.general.replanningPeriod");
656
657 def->optional(
658 params.navigatorGeneralConfig.subdivision.enable,
659 "p.navigator.general.subdivision.enable",
660 "Whether to enable global path subdivision when local planner is enabled as well.");
661 def->optional(params.navigatorGeneralConfig.subdivision.localPlannerCostmapThreshold,
662 "p.navigator.general.subdivision.localPlannerCostmapThreshold",
663 "The minimum value in the costmap to enable local planning.");
664 def->optional(
665 params.navigatorGeneralConfig.subdivision.globalPlanExpansionDistance,
666 "p.navigator.general.subdivision.globalPlanExpansionDistance",
667 "The length by which global planner segments are expaned (in both directions).");
668 def->optional(params.navigatorGeneralConfig.subdivision.minSegmentDistance,
669 "p.navigator.general.subdivision.minSegmentDistance",
670 "The minimum length for a local planner segment (otherwise it is deleted and "
671 "joined with the neighboring global planner segments).");
672
673 def->optional(params.navigatorGeneralConfig.targetAlternativesFilterTimeSeconds,
674 "p.navigator.general.targetAlternativesFilterTimeSeconds",
675 "The number of seconds to wait before replanning alternatives after all "
676 "alternatives where impossible.");
677
678 def->optional(params.navigatorGoalReachedConfig.posTh, "p.navigator.goalReached.posTh");
679 def->optional(params.navigatorGoalReachedConfig.oriTh, "p.navigator.goalReached.oriTh");
680 def->optional(params.navigatorGoalReachedConfig.linearVelTh,
681 "p.navigator.goalReached.linearVelTh");
682 def->optional(params.navigatorGoalReachedConfig.angularVelTh,
683 "p.navigator.goalReached.angularVelTh");
684 def->optional(params.navigatorGoalReachedConfig.filterCount,
685 "p.navigator.goalReached.filterCount");
686
687 return def;
688 }
689
690 void
691 visualize(const algorithms::Costmap& costmap, viz::Client& arviz, const std::string& name)
692 {
693 const auto cmap = simox::color::cmaps::viridis();
694 const float vmax = costmap.getGrid().array().maxCoeff();
695
696 const auto asColor = [&cmap, &vmax](const float distance) -> viz::data::Color
697 {
698 const auto color = cmap.at(distance, 0.F, vmax);
699 return {color.a, color.r, color.g, color.b};
700 };
701
702 auto layer = arviz.layer("costmap_" + name);
703
704 const std::int64_t cols = costmap.getGrid().cols();
705 const std::int64_t rows = costmap.getGrid().rows();
706
707 auto mesh = viz::Mesh("");
708
709 std::vector<std::vector<Eigen::Vector3f>> vertices;
710 std::vector<std::vector<viz::data::Color>> colors;
711
712 for (int r = 0; r < rows; r++)
713 {
714 auto& verticesRow = vertices.emplace_back(cols);
715 auto& colorsRow = colors.emplace_back(cols);
716
717 for (int c = 0; c < cols; c++)
718 {
719 verticesRow.at(c) = conv::to3D(costmap.toPositionGlobal({r, c}));
720 colorsRow.at(c) = asColor(costmap.getGrid()(r, c));
721 }
722 }
723
724 mesh.grid2D(vertices, colors);
725
726 layer.add(mesh);
727
728 arviz.commit(layer);
729 }
730
733 {
734
735 const auto navigatorId = activeNavigatorId();
736 if (not navigatorId.has_value())
737 {
738 return nullptr;
739 }
740
741 return &navigators.at(navigatorId.value());
742 }
743
744 std::optional<std::string>
746 {
748 // We define the active navigator to be the one whose movement is enabled.
749 const auto isActive = [](const auto& nameNavPair) -> bool
750 {
751 const auto& [name, navigator] = nameNavPair;
752 return not navigator.isPaused();
753 };
754
755 const auto it = std::find_if(navigators.begin(), navigators.end(), isActive);
756
757 // no navigator active?
758 if (it == navigators.end())
759 {
760 return std::nullopt;
761 }
762
763 return it->first;
764 }
765
766 void
768 {
769 using namespace armarx::RemoteGui::Client;
770
771 VBoxLayout root;
772
773 tab.stopAll.setLabel("Stop All");
774
775 root.addChild(tab.stopAll);
776
777 RemoteGui_createTab(getName(), root, &tab);
778 }
779
780 void
782 {
783 if (tab.stopAll.wasClicked())
784 {
785 stopAll();
786 }
787 }
788
789} // namespace armarx::navigation::components::navigator
#define ARMARX_REGISTER_COMPONENT_EXECUTABLE(ComponentT, applicationName)
Definition Decoupled.h:29
#define QUOTED(x)
constexpr T c
armarx::viz::Client & getArvizClient()
static DateTime Now()
Current time on the virtual clock.
Definition Clock.cpp:93
Default component property definition container.
Definition Component.h:70
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition Component.cpp:90
plugins::DebugObserverComponentPlugin & getDebugObserverComponentPlugin()
bool usingProxy(const std::string &name, const std::string &endpoints="")
Registers a proxy for retrieval after initialization and adds it to the dependency list.
PluginT * addPlugin(const std::string prefix="", ParamsT &&... params)
std::string getName() const
Retrieve name of object.
void setLogObjectDiscoveryError(bool logEnabled)
objpose::ObjectPoseClient getClient() const
bool hasElement(const std::string &) const
Definition Dict.cpp:228
VariantPtr getElement(const std::string &) const
Definition Dict.cpp:234
Position toPositionGlobal(const Index &index) const
Definition Costmap.cpp:75
void moveToLocation(const std::string &location, const IceUtil::Optional< std::string > &providerName, const std::string &callerId, const Ice::Current &c=Ice::emptyCurrent) override
void removeConfig(const std::string &callerId, const Ice::Current &c=Ice::emptyCurrent) override
void pause(const std::string &callerId, const Ice::Current &c=Ice::emptyCurrent) override
void resume(const std::string &callerId, const Ice::Current &c=Ice::emptyCurrent) override
void setVelocityFactor(float velocityFactor, const std::string &callerId, const Ice::Current &c=Ice::emptyCurrent) override
std::optional< std::string > activeNavigatorId() const
void moveToAlternatives(const client::detail::TargetAlternatives &targets, const std::string &navigationMode, const std::string &callerId, const Ice::Current &c=Ice::emptyCurrent) override
void RemoteGui_update() override
After calling RemoteGui_startRunningTask, this function is called periodically in a separate thread.
bool isPaused(const std::string &callerId, const Ice::Current &c=Ice::emptyCurrent) override
bool isStopped(const std::string &callerId, const Ice::Current &c=Ice::emptyCurrent) override
PropertyDefinitionsPtr createPropertyDefinitions() override
void updateMoveTo(const std::vector< Eigen::Matrix4f > &waypoints, const std::string &navigationMode, const std::string &callerId, const Ice::Current &c=Ice::emptyCurrent) override
void createConfig(const aron::data::dto::DictPtr &stackConfig, const std::string &callerId, const Ice::Current &c=Ice::emptyCurrent) override
void stop(const std::string &callerId, const Ice::Current &c=Ice::emptyCurrent) override
void moveTo(const std::vector< Eigen::Matrix4f > &waypoints, const std::string &navigationMode, const std::string &callerId, const Ice::Current &c=Ice::emptyCurrent) override
void moveTowards(const Eigen::Vector3f &direction, const std::string &navigationMode, const std::string &callerId, const Ice::Current &c=Ice::emptyCurrent) override
void moveTo2(const client::detail::Waypoints &waypoints, const std::string &navigationMode, const std::string &callerId, const Ice::Current &c=Ice::emptyCurrent) override
void createRemoteGuiTab()
This function should be called once in onConnect() or when you need to re-create the Remote GUI tab.
static server::NavigationStack create(const aron::data::DictPtr &params, const core::Scene &scene, std::experimental::observer_ptr< viz::Client > arviz, std::experimental::observer_ptr< DebugObserverComponentPluginUser > debugObserver)
An executer the server navigator will use to send its control commands to.
Brief description of class targets.
Definition targets.h:39
virtual Layer layer(std::string const &name) const
Definition Client.cpp:80
CommitResult commit(StagedCommit const &commit)
Definition Client.cpp:89
#define ARMARX_CHECK(expression)
Shortcut for ARMARX_CHECK_EXPRESSION.
#define ARMARX_CHECK_NOT_NULL(ptr)
This macro evaluates whether ptr is not null and if it turns out to be false it will throw an Express...
#define ARMARX_INFO
The normal logging level.
Definition Logging.h:181
#define ARMARX_IMPORTANT
The logging level for always important information, but expected behaviour (in contrast to ARMARX_WAR...
Definition Logging.h:190
#define ARMARX_WARNING
The logging level for unexpected behaviour, but not a serious problem.
Definition Logging.h:193
#define ARMARX_VERBOSE
The logging level for verbose information.
Definition Logging.h:187
::IceInternal::Handle< Dict > DictPtr
sequence< TargetAlternative > TargetAlternatives
client::GlobalPlanningStrategy defrost(const client::detail::GlobalPlanningStrategy &strategy)
void visualize(const algorithms::Costmap &costmap, viz::Client &arviz, const std::string &name)
std::vector< Eigen::Vector3f > to3D(const std::vector< Eigen::Vector2f > &v)
Definition eigen.cpp:14
const std::string PARAMS_KEY
Definition constants.h:34
Eigen::Isometry3f Pose
Definition basic_types.h:31
const simox::meta::EnumNames< StackLayer > StackLayerNames
Definition constants.h:46
const simox::meta::EnumNames< NavigationFrame > NavigationFrameNames
Definition types.h:54
This file is part of ArmarX.
Definition constants.cpp:4
core::GoalReachedConfig GoalReachedMonitorConfig
This file is part of ArmarX.
std::vector< core::Pose > convert(const std::vector< Eigen::Matrix4f > &wps)
Definition Component.cpp:93
std::string GetHandledExceptionString()
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
observer_ptr< _Tp > make_observer(_Tp *__p) noexcept
double distance(const Point &a, const Point &b)
Definition point.hpp:95
void RemoteGui_createTab(std::string const &name, RemoteGui::Client::Widget const &rootWidget, RemoteGui::Client::Tab *tab)
void addChild(Widget const &child)
Definition Widgets.cpp:95
static GoalReachedConfig FromAron(const aron::data::DictPtr &dict)
Event describing that the user aborted the current execution.
Definition events.h:97
local_planning::LocalPlannerPtr localPlanner
#define ARMARX_TRACE
Definition trace.h:77