Decision Module  1.0
ICRA2020 AI Challenge Northwestern Polytechnical University Aoxiang Team Strategy Code
roborts_decision::GimbalContrl Class Reference

The class can make a transformation: the 3D position of enemy --> pitch,yaw angle of gimbal. For more derails, see projectile_model.pdf TODO: add enemy motion estimation. More...

#include <gimbal_control.h>

Public Member Functions

void Init (float x, float y, float z, float pitch, float yaw, float init_v, float init_k)
 Init the Transformation matrix from camera to gimbal //TODO: write in ros tf. More...
 
void Transform (geometry_msgs::Point32 &postion, float &pitch, float &yaw)
 Get the gimbal control info. More...
 

Private Member Functions

float BulletModel (float x, float v, float angle)
 Calculate the actual y value with air resistance. More...
 
float GetPitch (float x, float y, float v)
 Get the gimbal control angle. More...
 

Private Attributes

geometry_msgs::Point32 offset_
 
float offset_pitch_
 Rotation matrix unit: degree. More...
 
float offset_yaw_
 
float init_v_
 Initial value. More...
 
float init_k_
 

Detailed Description

The class can make a transformation: the 3D position of enemy --> pitch,yaw angle of gimbal. For more derails, see projectile_model.pdf TODO: add enemy motion estimation.

Member Function Documentation

◆ BulletModel()

float roborts_decision::GimbalContrl::BulletModel ( float  x,
float  v,
float  angle 
)
private

Calculate the actual y value with air resistance.

Parameters
xthe distanc
vProjectile velocity
anglePitch angle
Returns
The actual y value in the gimbal coordinate

◆ GetPitch()

float roborts_decision::GimbalContrl::GetPitch ( float  x,
float  y,
float  v 
)
private

Get the gimbal control angle.

Parameters
xDistance from enemy(the armor selected to shoot) to gimbal
yValue of y in gimbal coordinate.
vProjectile velocity
Returns
Gimbal pitch angle

◆ Init()

void roborts_decision::GimbalContrl::Init ( float  x,
float  y,
float  z,
float  pitch,
float  yaw,
float  init_v,
float  init_k 
)

Init the Transformation matrix from camera to gimbal //TODO: write in ros tf.

Parameters
xTranslate x
yTranslate y
zTranslate z
pitchRotate pitch
yawRotate yaw

◆ Transform()

void roborts_decision::GimbalContrl::Transform ( geometry_msgs::Point32 &  postion,
float &  pitch,
float &  yaw 
)

Get the gimbal control info.

Parameters
postionEnemy position(actually it should be the target armor).
pitchInput and output actual pitch angle
yawInput and output actual yaw angle

Member Data Documentation

◆ init_k_

float roborts_decision::GimbalContrl::init_k_
private

◆ init_v_

float roborts_decision::GimbalContrl::init_v_
private

Initial value.

◆ offset_

geometry_msgs::Point32 roborts_decision::GimbalContrl::offset_
private

Transformation matrix between camera coordinate system and gimbal coordinate system. Translation unit: cm

◆ offset_pitch_

float roborts_decision::GimbalContrl::offset_pitch_
private

Rotation matrix unit: degree.

◆ offset_yaw_

float roborts_decision::GimbalContrl::offset_yaw_
private

The documentation for this class was generated from the following files: