error: cannot convert ‘ignition::gazebo::v3::components::Component<std::vector<double> to ‘float’
I am trying to get the joint's position for my Cessna plugin using this method
float rudder = _ecm.Component<components::JointPosition>(this->joint[5.0]);
which gives me this error in the line shown above
error: cannot convert ‘ignition::gazebo::v3::components::Component<std::vector<double>, ignition::gazebo::v3::components::JointPositionTag, ignition::gazebo::v3::serializers::VectorDoubleSerializer>*’ to ‘float’ in initialization
float rightFlap = _ecm.Component<components::JointPosition>(this->joint[3.0]);
code snippet
void CessnaPlugin::PublishState(EntityComponentManager &_ecm)
{
IGN_PROFILE("CessnaPlugin::PublishState");
// Read current state
double propellerRpms = _ecm.ComponentData<components::JointVelocity>(this->joint[6.0])/(2.0*M_PI)*60.0;
float propellerSpeed = propellerRpms / this->propellerMaxRpm;
float leftAileron = _ecm.Component<components::JointPosition>(this->joint[2500]);
float leftFlap = _ecm.Component<components::JointPosition>(this->joint[1.0]);
float rightAileron = _ecm.Component<components::JointPosition>(this->joint[2.0]);
float rightFlap = _ecm.Component<components::JointPosition>(this->joint[3.0]);
float elevators = _ecm.Component<components::JointPosition>(this->joint[4.0]);
float rudder = _ecm.Component<components::JointPosition>(this->joint[5.0]); ----> error occurs here
}
joint entity as declared
std::array<ignition::gazebo::Entity, 7> joint;
parameters
private: static const unsigned int kLeftAileron = 0;
private: static const unsigned int kLeftFlap = 1;
private: static const unsigned int kRightAileron = 2;
private: static const unsigned int kRightFlap = 3;
private: static const unsigned int kElevators = 4;
private: static const unsigned int kRudder = 5;
private: static const unsigned int kPropeller = 6;
Any solution for this?
Thanks