Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00027
00029
00030 #ifndef HARDWARE_INTERFACE_POSVELACC_COMMAND_INTERFACE_H
00031 #define HARDWARE_INTERFACE_POSVELACC_COMMAND_INTERFACE_H
00032
00033 #include <cassert>
00034 #include <string>
00035 #include <hardware_interface/internal/hardware_resource_manager.h>
00036 #include <hardware_interface/posvel_command_interface.h>
00037
00038 namespace hardware_interface
00039 {
00040
00042 class PosVelAccJointHandle : public PosVelJointHandle
00043 {
00044 public:
00045 PosVelAccJointHandle() : PosVelJointHandle(), cmd_acc_(0) {}
00046
00053 PosVelAccJointHandle(const JointStateHandle& js, double* cmd_pos, double* cmd_vel, double* cmd_acc)
00054 : PosVelJointHandle(js, cmd_pos, cmd_vel), cmd_acc_(cmd_acc)
00055 {
00056 if (!cmd_acc)
00057 {
00058 throw HardwareInterfaceException("Cannot create handle '" + js.getName() + "'. Command acceleration data pointer is null.");
00059 }
00060 }
00061
00062 void setCommand(double cmd_pos, double cmd_vel, double cmd_acc)
00063 {
00064 setCommandPosition(cmd_pos);
00065 setCommandVelocity(cmd_vel);
00066 setCommandAcceleration(cmd_acc);
00067 }
00068
00069 void setCommandAcceleration(double cmd_acc) {assert(cmd_acc_); *cmd_acc_ = cmd_acc;}
00070 double getCommandAcceleration() const {assert(cmd_acc_); return *cmd_acc_;}
00071
00072 private:
00073 double* cmd_acc_;
00074 };
00075
00076
00085 class PosVelAccJointInterface : public HardwareResourceManager<PosVelAccJointHandle, ClaimResources> {};
00086
00087 }
00088
00089 #endif