#include <gazebo_gimbal_controller_plugin.h>
Public Member Functions | |
GimbalControllerPlugin () | |
Constructor. | |
virtual void | Init () |
virtual void | Load (physics::ModelPtr _model, sdf::ElementPtr _sdf) |
Private Member Functions | |
double | NormalizeAbout (double _angle, double _reference) |
returns _angle1 normalized about (_reference - M_PI, _reference + M_PI] | |
void | OnPitchStringMsg (ConstAnyPtr &_msg) |
void | OnRollStringMsg (ConstAnyPtr &_msg) |
void | OnUpdate () |
void | OnYawStringMsg (ConstAnyPtr &_msg) |
ignition::ignition::math::Vector3d | QtoZXY (const ignition::math::Quaterniond &_q) |
double | ShortestAngularDistance (double _from, double _to) |
returns shortest angular distance from _from to _to | |
ignition::ignition::math::Vector3d | ThreeAxisRot (double r11, double r12, double r21, double r31, double r32) |
Private Attributes | |
std::vector< event::ConnectionPtr > | connections |
sensors::ImuSensorPtr | imuSensor |
common::Time | lastUpdateTime |
physics::ModelPtr | model |
transport::NodePtr | node |
double | pitchCommand |
physics::JointPtr | pitchJoint |
camera pitch joint | |
common::PID | pitchPid |
transport::PublisherPtr | pitchPub |
transport::SubscriberPtr | pitchSub |
double | rollCommand |
physics::JointPtr | rollJoint |
camera roll joint | |
common::PID | rollPid |
transport::PublisherPtr | rollPub |
transport::SubscriberPtr | rollSub |
sdf::ElementPtr | sdf |
std::string | status |
double | yawCommand |
physics::JointPtr | yawJoint |
yaw camera | |
common::PID | yawPid |
transport::PublisherPtr | yawPub |
transport::SubscriberPtr | yawSub |
Definition at line 36 of file gazebo_gimbal_controller_plugin.h.
Constructor.
TODO: make these gains part of sdf xml
Definition at line 28 of file gazebo_gimbal_controller_plugin.cpp.
void GimbalControllerPlugin::Init | ( | ) | [virtual] |
Definition at line 138 of file gazebo_gimbal_controller_plugin.cpp.
void GimbalControllerPlugin::Load | ( | physics::ModelPtr | _model, |
sdf::ElementPtr | _sdf | ||
) | [virtual] |
Definition at line 41 of file gazebo_gimbal_controller_plugin.cpp.
double GimbalControllerPlugin::NormalizeAbout | ( | double | _angle, |
double | _reference | ||
) | [private] |
returns _angle1 normalized about (_reference - M_PI, _reference + M_PI]
something to move into Angle class
[in] | _angle1 | input angle |
[in] | _reference | reference input angle for normalization |
Definition at line 387 of file gazebo_gimbal_controller_plugin.cpp.
void GimbalControllerPlugin::OnPitchStringMsg | ( | ConstAnyPtr & | _msg | ) | [private] |
Definition at line 185 of file gazebo_gimbal_controller_plugin.cpp.
void GimbalControllerPlugin::OnRollStringMsg | ( | ConstAnyPtr & | _msg | ) | [private] |
Definition at line 192 of file gazebo_gimbal_controller_plugin.cpp.
void GimbalControllerPlugin::OnUpdate | ( | ) | [private] |
Get current joint angles (in sensor frame):
currentAngleYPRVariable is defined in roll-pitch-yaw-fixed-axis and gimbal is constructed using yaw-roll-pitch-variable-axis
get joint limits (in sensor frame) TODO: move to Load() if limits do not change
Definition at line 232 of file gazebo_gimbal_controller_plugin.cpp.
void GimbalControllerPlugin::OnYawStringMsg | ( | ConstAnyPtr & | _msg | ) | [private] |
Definition at line 199 of file gazebo_gimbal_controller_plugin.cpp.
ignition::ignition::math::Vector3d GimbalControllerPlugin::QtoZXY | ( | const ignition::math::Quaterniond & | _q | ) | [private] |
Definition at line 216 of file gazebo_gimbal_controller_plugin.cpp.
double GimbalControllerPlugin::ShortestAngularDistance | ( | double | _from, |
double | _to | ||
) | [private] |
returns shortest angular distance from _from to _to
something to move into Angle class
[in] | _from | starting anglular position |
[in] | _to | end angular position |
Definition at line 403 of file gazebo_gimbal_controller_plugin.cpp.
ignition::ignition::math::Vector3d GimbalControllerPlugin::ThreeAxisRot | ( | double | r11, |
double | r12, | ||
double | r21, | ||
double | r31, | ||
double | r32 | ||
) | [private] |
Definition at line 206 of file gazebo_gimbal_controller_plugin.cpp.
std::vector<event::ConnectionPtr> gazebo::GimbalControllerPlugin::connections [private] |
Definition at line 68 of file gazebo_gimbal_controller_plugin.h.
sensors::ImuSensorPtr gazebo::GimbalControllerPlugin::imuSensor [private] |
Definition at line 89 of file gazebo_gimbal_controller_plugin.h.
common::Time gazebo::GimbalControllerPlugin::lastUpdateTime [private] |
Definition at line 102 of file gazebo_gimbal_controller_plugin.h.
physics::ModelPtr gazebo::GimbalControllerPlugin::model [private] |
Definition at line 78 of file gazebo_gimbal_controller_plugin.h.
transport::NodePtr gazebo::GimbalControllerPlugin::node [private] |
Definition at line 97 of file gazebo_gimbal_controller_plugin.h.
double gazebo::GimbalControllerPlugin::pitchCommand [private] |
Definition at line 93 of file gazebo_gimbal_controller_plugin.h.
physics::JointPtr gazebo::GimbalControllerPlugin::pitchJoint [private] |
camera pitch joint
Definition at line 87 of file gazebo_gimbal_controller_plugin.h.
common::PID gazebo::GimbalControllerPlugin::pitchPid [private] |
Definition at line 99 of file gazebo_gimbal_controller_plugin.h.
transport::PublisherPtr gazebo::GimbalControllerPlugin::pitchPub [private] |
Definition at line 74 of file gazebo_gimbal_controller_plugin.h.
transport::SubscriberPtr gazebo::GimbalControllerPlugin::pitchSub [private] |
Definition at line 70 of file gazebo_gimbal_controller_plugin.h.
double gazebo::GimbalControllerPlugin::rollCommand [private] |
Definition at line 95 of file gazebo_gimbal_controller_plugin.h.
physics::JointPtr gazebo::GimbalControllerPlugin::rollJoint [private] |
camera roll joint
Definition at line 84 of file gazebo_gimbal_controller_plugin.h.
common::PID gazebo::GimbalControllerPlugin::rollPid [private] |
Definition at line 100 of file gazebo_gimbal_controller_plugin.h.
transport::PublisherPtr gazebo::GimbalControllerPlugin::rollPub [private] |
Definition at line 75 of file gazebo_gimbal_controller_plugin.h.
transport::SubscriberPtr gazebo::GimbalControllerPlugin::rollSub [private] |
Definition at line 71 of file gazebo_gimbal_controller_plugin.h.
sdf::ElementPtr gazebo::GimbalControllerPlugin::sdf [private] |
Definition at line 66 of file gazebo_gimbal_controller_plugin.h.
Definition at line 91 of file gazebo_gimbal_controller_plugin.h.
double gazebo::GimbalControllerPlugin::yawCommand [private] |
Definition at line 94 of file gazebo_gimbal_controller_plugin.h.
physics::JointPtr gazebo::GimbalControllerPlugin::yawJoint [private] |
yaw camera
Definition at line 81 of file gazebo_gimbal_controller_plugin.h.
common::PID gazebo::GimbalControllerPlugin::yawPid [private] |
Definition at line 101 of file gazebo_gimbal_controller_plugin.h.
transport::PublisherPtr gazebo::GimbalControllerPlugin::yawPub [private] |
Definition at line 76 of file gazebo_gimbal_controller_plugin.h.
transport::SubscriberPtr gazebo::GimbalControllerPlugin::yawSub [private] |
Definition at line 72 of file gazebo_gimbal_controller_plugin.h.