29 #ifndef HECTOR_QUADROTOR_CONTROLLER_QUADROTOR_INTERFACE_H 30 #define HECTOR_QUADROTOR_CONTROLLER_QUADROTOR_INTERFACE_H 65 if (input)
return input;
68 input.reset(
new HandleType(
this, name));
69 inputs_[name] = input;
72 if (outputs_.count(name)) {
74 output->connectTo(*input);
83 if (output)
return output;
86 output.reset(
new HandleType(
this, name));
87 outputs_[name] = output;
88 *output = output->ownData(
new typename HandleType::ValueType());
94 if (inputs_.count(name)) {
96 output->connectTo(*input);
105 return boost::static_pointer_cast<HandleType>(outputs_.at(name));
111 return boost::static_pointer_cast<HandleType>(inputs_.at(name));
114 template <
typename HandleType>
typename HandleType::ValueType
const*
getCommand(
const std::string& name)
const 117 if (!output || !output->connected())
return 0;
118 return &(output->command());
121 virtual const Pose *getPoseCommand()
const;
122 virtual const Twist *getTwistCommand()
const;
123 virtual const Wrench *getWrenchCommand()
const;
124 virtual const MotorCommand *getMotorCommand()
const;
136 std::map<std::string, CommandHandlePtr>
inputs_;
138 std::map<std::string, const CommandHandle *>
enabled_;
143 #endif // HECTOR_QUADROTOR_CONTROLLER_QUADROTOR_INTERFACE_H
virtual bool getMassAndInertia(double &mass, double inertia[3])
boost::shared_ptr< HandleType > addOutput(const std::string &name)
boost::shared_ptr< TwistHandle > TwistHandlePtr
virtual ImuHandlePtr getSensorImu()
HandleType::ValueType const * getCommand(const std::string &name) const
std::map< std::string, CommandHandlePtr > outputs_
boost::shared_ptr< HandleType > addInput(const std::string &name)
virtual MotorStatusHandlePtr getMotorStatus()
std::map< std::string, const CommandHandle * > enabled_
virtual AccelerationHandlePtr getAcceleration()
boost::shared_ptr< ImuHandle > ImuHandlePtr
boost::shared_ptr< HandleType > getHandle()
std::map< std::string, CommandHandlePtr > inputs_
boost::shared_ptr< HandleType > getInput(const std::string &name) const
virtual PoseHandlePtr getPose()
boost::shared_ptr< HandleType > getOutput(const std::string &name) const
boost::shared_ptr< AccelerationHandle > AccelerationHandlePtr
boost::shared_ptr< MotorStatusHandle > MotorStatusHandlePtr
boost::shared_ptr< PoseHandle > PoseHandlePtr
virtual TwistHandlePtr getTwist()