Go to the documentation of this file. 1 #ifndef AIKIDO_ROBOT_ROS_ROSROBOT_HPP_
2 #define AIKIDO_ROBOT_ROS_ROSROBOT_HPP_
6 #include <controller_manager_msgs/ListControllers.h>
7 #include <controller_manager_msgs/LoadController.h>
8 #include <controller_manager_msgs/SwitchController.h>
9 #include <dart/utils/urdf/DartLoader.hpp>
32 const dart::common::Uri& urdf,
33 const dart::common::Uri& srdf,
34 const std::string name,
35 const bool addDefaultExecutors,
36 const dart::common::ResourceRetrieverPtr& retriever
37 = std::make_shared<aikido::io::CatkinResourceRetriever>(),
38 const ::ros::NodeHandle& node = ::ros::NodeHandle(),
39 const std::string modeControllerName =
"");
45 dart::dynamics::ReferentialSkeletonPtr refSkeleton,
47 dart::collision::CollisionDetectorPtr collisionDetector,
48 std::shared_ptr<dart::collision::BodyNodeCollisionFilter> collisionFilter,
49 const std::string name,
50 const ::ros::NodeHandle& node = ::ros::NodeHandle(),
51 const std::string modeControllerName =
"");
61 void step(
const std::chrono::system_clock::time_point& timepoint)
override;
71 dart::dynamics::ReferentialSkeletonPtr refSkeleton,
72 const std::string& name,
73 const std::string& modeControllerName =
"");
95 std::string desiredName,
96 std::string controllerName,
97 hardware_interface::JointCommandModes controllerMode);
112 std::string desiredName,
113 std::string controllerName);
137 std::unordered_map<int, hardware_interface::JointCommandModes>
155 std::shared_ptr<aikido::control::ros::RosJointModeCommandClient>
180 const std::vector<std::string> startControllersNames,
181 const std::vector<std::string> stopControllersNames);
196 const hardware_interface::JointCommandModes jointMode);
210 #endif // AIKIDO_ROBOT_ROS_ROSROBOT_HPP_
int registerExecutor(aikido::control::ExecutorPtr executor, std::string desiredName, std::string controllerName, hardware_interface::JointCommandModes controllerMode)
Loads the controller.
std::unordered_map< int, hardware_interface::JointCommandModes > mRosControllerModes
Definition: RosRobot.hpp:138
std::shared_ptr< Executor > ExecutorPtr
Definition: Executor.hpp:16
virtual bool activateExecutor(const int id)
Deactivates the current active executor.
std::shared_ptr<::ros::ServiceClient > mRosLoadControllerServiceClient
Definition: RosRobot.hpp:148
RobotPtr registerSubRobot(dart::dynamics::ReferentialSkeletonPtr refSkeleton, const std::string &name, const std::string &modeControllerName="")
Registers a subset of the joints of the skeleton as a new RosRobot.
Format of serialized trajectory in YAML.
Definition: algorithm.hpp:4
Robot interface augmented with ROS components.
Definition: RosRobot.hpp:22
bool activateExecutor(const int id) override
Deactivates the current active executor.
std::shared_ptr< Robot > RobotPtr
Definition: Robot.hpp:35
bool startController(const std::string startControllerName)
Starts the controller with name startControllerName.
::ros::NodeHandle mNode
Definition: RosRobot.hpp:142
std::shared_ptr<::ros::ServiceClient > mRosSwitchControllerServiceClient
Definition: RosRobot.hpp:151
bool switchControllerMode(const hardware_interface::JointCommandModes jointMode)
Switches the controller mode to jointMode.
virtual ~RosRobot()=default
Destructor.
RosRobot(const dart::common::Uri &urdf, const dart::common::Uri &srdf, const std::string name, const bool addDefaultExecutors, const dart::common::ResourceRetrieverPtr &retriever=std::make_shared< aikido::io::CatkinResourceRetriever >(), const ::ros::NodeHandle &node=::ros::NodeHandle(), const std::string modeControllerName="")
Construct a new RosRobot object.
void deactivateExecutor() override
Stops the controller corresponding to this executor and deactivates executor.
std::shared_ptr<::ros::ServiceClient > mRosListControllersServiceClient
Definition: RosRobot.hpp:145
std::shared_ptr< aikido::control::ros::RosJointModeCommandClient > mRosJointModeCommandClient
Definition: RosRobot.hpp:156
bool stopController(const std::string stopControllerName)
Stops the controller with name stopControllerName.
bool switchControllers(const std::vector< std::string > startControllersNames, const std::vector< std::string > stopControllersNames)
Stops the controller with name stopControllerName and starts the controller with name startController...
void setRosControllerClients(const std::string modeControllerName)
Sets the ros controller clients which enable controller listing, loading, switching and mode switchin...
void step(const std::chrono::system_clock::time_point &timepoint) override
Steps the ros robot (and underlying executors and subrobots) through time.
std::unordered_map< int, std::string > mRosControllerNames
Definition: RosRobot.hpp:139
bool isControllerActive(const std::string controllerName)
Checks if the controller with name controllerName is active.
bool loadController(const std::string loadControllerName)
Loads the controller with name loadControllerName.
Robot base class for defining basic behaviors common to most robots.
Definition: Robot.hpp:38
#define AIKIDO_DECLARE_POINTERS(X)
Definition: pointers.hpp:21