38 #include <IceUtil/Time.h>
41 #include <VirtualRobot/Nodes/RobotNode.h>
50 #include <RobotAPI/interface/components/ObstacleAvoidance/ObstacleAvoidanceInterface.h>
85 Eigen::Vector2f target_pos;
87 Eigen::Vector2f target_vel;
90 float target_angular_dist;
91 Eigen::Vector2f agent_pos;
93 double agent_safety_margin = 0;
94 float min_vel_near_target = 50;
95 float min_vel_general = 100;
97 float max_rot_vel = 0.3;
98 float pos_near_threshold = 250;
99 float pos_reached_threshold = 8;
100 float ori_reached_threshold = 0.1;
102 std::deque<std::tuple<Eigen::Vector2f, Eigen::Vector2f>> vel_history;
103 unsigned amount_smoothing = 50;
104 unsigned amount_max_vel = 3;
105 float adaptive_max_vel_exp = 0;
110 Eigen::Vector3f start;
111 std::vector<Eigen::Vector3f> path;
117 Eigen::Vector2f target_local;
118 Eigen::Vector2f modulated_local;
119 Eigen::Vector2f target_global;
120 Eigen::Vector2f modulated_global;
123 float err_angular_dist;
133 virtual void moveTo(
float target_pos_x,
136 float pos_reached_threshold,
137 float ori_reached_threshold,
138 const Ice::Current& = Ice::Current{})
override;
140 virtual void move(
float target_vel_x,
142 float target_rot_vel,
143 const Ice::Current& = Ice::Current{})
override;
146 float target_pos_delta_y,
147 float target_delta_ori,
148 float pos_reached_threshold,
149 float ori_reached_threshold,
150 const Ice::Current& = Ice::Current{})
override;
154 const Ice::Current& = Ice::Current{})
override;
156 virtual void stopPlatform(
const Ice::Current& = Ice::Current{})
override;
168 void schedule_high_level_control_loop(
control_mode mode);
170 void high_level_control_loop();
172 velocities get_velocities();
174 void update_agent_dependent_values();
176 Eigen::Vector2f get_target_velocity()
const;
178 float get_target_rotational_velocity()
const;
180 bool target_position_reached()
const;
182 bool target_orientation_reached()
const;
184 bool target_reached()
const;
186 Eigen::Vector2f post_process_vel(
const Eigen::Vector2f& target_vel,
187 const Eigen::Vector2f& modulated_vel);
189 Eigen::Vector2f calculate_mean_modulated_vel()
const;
191 unsigned calculate_adaptive_smoothing_buffer_size()
const;
193 float calculate_adaptive_max_vel()
const;
197 void visualize(
const velocities& vels);
199 bool is_near_target(
const Eigen::Vector2f& control_velocity)
const noexcept;
205 PlatformUnitInterfacePrx m_platform;
206 ObstacleAvoidanceInterfacePrx m_obstacle_avoidance;
209 ObstacleAvoidingPlatformUnit::control_loop m_control_loop;
210 ObstacleAvoidingPlatformUnit::control_data m_control_data;
212 mutable PIDController m_rot_pid_controller{1.0, 0.00009, 0.0};