ZilantRobotics / innopolis_vtol_dynamics

Cyphal/DroneCAN UAV HITL simulator
GNU General Public License v3.0
41 stars 8 forks source link

Is propeller location calculation is right? #13

Closed prihex closed 2 years ago

prihex commented 2 years ago

In vtolDynamicsSim.cpp:loadParams() function, propeller locations are created by multiplying sin(45) for x and y locations.

params_.propellersLocation[0] << propLocX * sin(3.1415/4),  propLocY * sin(3.1415/4), propLocZ;
params_.propellersLocation[1] <<-propLocX * sin(3.1415/4), -propLocY * sin(3.1415/4), propLocZ;
params_.propellersLocation[2] << propLocX * sin(3.1415/4), -propLocY * sin(3.1415/4), propLocZ;
params_.propellersLocation[3] <<-propLocX * sin(3.1415/4),  propLocY * sin(3.1415/4), propLocZ;

I think multiplying sin45 is unnecessary and wrong. I am not sure of it, still trying to understand all part of code. In body frame, locx is simply distance in x axis. Please correct me if I'm wrong.

// That might be the solution if i think right
params_.propellersLocation[0] << propLocX,  propLocY,  propLocZ;
params_.propellersLocation[1] <<-propLocX, -propLocY,  propLocZ;
params_.propellersLocation[2] << propLocX, -propLocY,  propLocZ;
params_.propellersLocation[3] <<-propLocX,  propLocY,  propLocZ;
PonomarevDA commented 2 years ago

Hi. Your suggestion looks more clear than what is currently implemented. It is expected to specify in params.yaml file x and y offsets in FRD coordinate system with VTOL motors numeration as in the picture below (although in the code it is started from 0): image I will verify calculated values with what we actually have and fix it later.

PonomarevDA commented 2 years ago

close because it is fixed