28#include <SimoxUtility/math.h>
29#include <VirtualRobot/Nodes/RobotNode.h>
32 armarx::PlatformUnitInterfacePrx platform_unit,
40 armarx::PlatformUnitInterfacePrx platform_unit,
43 m_platform_unit{platform_unit}, m_robot{robot}, m_cfg{cfg}
50 m_platform_unit->stopPlatform();
55 const float target_ori)
64 m_waypoints.push_back(target);
65 m_current_waypoint_index = 0;
66 m_waypoint_changed =
true;
72 return m_waypoints.at(m_current_waypoint_index);
81 m_current_waypoint_index++;
82 m_waypoint_changed =
true;
88 if (m_waypoint_changed)
94 const float pos_thresh = m_cfg.pos_reached_threshold;
95 const float ori_thresh = m_cfg.ori_reached_threshold;
99 m_platform_unit->moveTo(target.pos.x(), target.pos.y(), target.ori, pos_thresh, ori_thresh);
101 m_waypoint_changed =
false;
115 m_waypoints = waypoints;
116 m_current_waypoint_index = 0;
117 m_waypoint_changed =
true;
123 m_waypoints.push_back(waypoint);
129 return m_current_waypoint_index + 1 >= m_waypoints.size();
161 m_platform_unit->setMaxVelocities(max_vel, max_angular_vel);
167 const Eigen::Vector2f agent_pos = m_robot->getGlobalPosition().head<2>();
174 using namespace simox::math;
176 const float agent_ori =
177 periodic_clamp<float>(mat4f_to_rpy(m_robot->getGlobalPose()).z(), -
M_PI,
M_PI);
std::shared_ptr< class Robot > RobotPtr