1 #ifndef ABSTRACTCONTROLLER_HPP 2 #define ABSTRACTCONTROLLER_HPP 7 #include "std_msgs/String.h" 8 #include "urdf/model.h" 10 #include "VirtualServo.hpp" 11 #include <Simulation/VirtualSerialInterface.hpp> 30 const std::string& respond_topic,
31 const std::string& robot_description);
57 void write(
const std::string& message)
override;
63 std::string read()
override;
69 void handle_message_cb(
const std_msgs::String::ConstPtr& message);
74 void start_update_cycles();
105 std_msgs::String feedback;
110 ros::NodeHandle ros_node;
115 ros::Subscriber message_subscriber;
120 ros::Publisher feedback_publisher;
virtual void parse_message(const std::string &message)=0
This function parses the message.
std::vector< VirtualServo > servos
The joint in a vector of servos, this should be initialized in the derived class. ...
Definition: AbstractController.hpp:87
Interface the simulate the serial connection to the robot arm.
Definition: VirtualSerialInterface.hpp:13
AbstractController(const std::string &request_topic, const std::string &respond_topic, const std::string &robot_description)
Constructor for AbstractController.
virtual bool arm_is_moving()
Can be used to checks of any of the servos are moving Can be used to checks of any of the servos are ...
std::string response
The feedback message to send back, should be set by the derived class.
Definition: AbstractController.hpp:99
bool response_available
This should be set by the parser if a message had feedback to send back.
Definition: AbstractController.hpp:81
virtual void emergency_stop()
This function stops the servos immediately.
urdf::Model model
Init in the constructor with the robor parameters loaded from the ROS param server.
Definition: AbstractController.hpp:93
Creates to ROS topics to listen to the incoming messages.
Definition: AbstractController.hpp:20