1 #ifndef KINEMATICS_ROBOTCONTROLLER_HPP 2 #define KINEMATICS_ROBOTCONTROLLER_HPP 5 #include "Planners/Planner.hpp" 6 #include <CGAL/Simple_cartesian.h> 7 #include <CGAL/Surface_mesh.h> 8 #include <Kinematics/ConcurrentQueue.hpp> 9 #include <Kinematics/Matrix.hpp> 14 #include <unordered_set> 16 #include "RobotDriverHandler.hpp" 55 CGAL::Surface_mesh<CGAL::Simple_cartesian<double>::Point_3>
polyhedron;
249 void pick_up_cup(std::uint32_t
id);
263 void move_continue();
298 void set_error_callback(
const std::function<
void(
ArmError)>& cb);
307 void position_reached();
324 void event_handler();
329 void move_to_ready_handler();
334 void pick_up_cup_handler();
339 void pick_up_cup_stage1_handler();
344 void pick_up_cup_stage2_handler();
349 void move_cup_handler();
354 void move_stop_handler();
359 void move_continue_handler();
364 void move_cancel_handler();
380 const double ground_level = 0;
386 const double distance_from_cup = 0.12;
391 const double angle_step_size = 360;
396 const double euclidean_step_size = 0.05;
402 std::function<void(ArmError)> error_callback;
408 bool is_carrying =
false;
418 mutable std::mutex state_m;
428 std::unordered_map<std::uint32_t, EnvironmentObject> objects;
433 mutable std::recursive_mutex objects_m;
Matrix< double, 3, 1 > velocity
The velocity vector of the object.
Definition: RobotController.hpp:40
Robot arm is moving gripper to surround the cup.
Robot arm is moving to ready position,.
CGAL::Surface_mesh< CGAL::Simple_cartesian< double >::Point_3 > polyhedron
The CGAL polyhedron data. This can be used for collision checking.
Definition: RobotController.hpp:55
RobotControllerState
The current state of the robot controller.
Definition: RobotController.hpp:61
The arm has stopped due to a safety concern.
Robot arm is moving to cup.
std::uint32_t id
The id of the object.
Definition: RobotController.hpp:30
Describes an object that is detected in the environment.
Definition: RobotController.hpp:25
This class contains the main logic of the robotic arm. It handles the calculation of robotic path and...
Definition: RobotController.hpp:138
Abstract class that forces.
Definition: Planner.hpp:17
The arm couldn't be moved because there is an underlying driver error.
Robot arm is currently stopped.
bool has_speed
Whether this object has a valid speed.
Definition: RobotController.hpp:50
The arm has stopped because no valid path was found to execute the given action.
Robot arm is moving the cup.
Concrete handle on the robot using the ROS interface.
Definition: RobotDriverHandler.hpp:19
Event
Internal event class. These events are send to the worker thread and handled accordingly.
Definition: RobotController.hpp:145
bool is_cup
Whether this object is a cup.
Definition: RobotController.hpp:45
Is idle waiting to pick up a cup.
ArmError
Enum containing possible reasons for the robot arm not being able to succesfully execute the specifie...
Definition: RobotController.hpp:113
Matrix< double, 3, 1 > position
The position vector of the object.
Definition: RobotController.hpp:35
Robot arm is moving to lift cup.