mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-28 18:07:25 +08:00
[fc_rotor] fix include and use python3
This commit is contained in:
committed by
Gautier Hattenberger
parent
06cb3e4d78
commit
ba931c0315
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
#include "math/pprz_algebra_float.h"
|
||||
#include "subsystems/abi.h"
|
||||
//#include "subsystems/datalink/datalink.h" // dl_buffer
|
||||
#include "subsystems/datalink/datalink.h"
|
||||
#include "autopilot.h"
|
||||
#include "modules/multi/fc_rotor/fc_rotor.h"
|
||||
#include "firmwares/rotorcraft/navigation.h"
|
||||
@@ -32,7 +32,7 @@ void fc_rotor_init(void)
|
||||
void fc_read_msg(uint8_t *buf)
|
||||
{
|
||||
struct FloatVect3 u;
|
||||
uint8_t ac_id = DL_DESIRED_SETPOINT_ac_id();
|
||||
uint8_t ac_id = DL_DESIRED_SETPOINT_ac_id(buf);
|
||||
|
||||
if (ac_id == AC_ID) {
|
||||
// 0: 2D control, 1: 3D control
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/env python3
|
||||
#
|
||||
# Copyright (C) 2017 Hector Garcia de Marina <hgdemarina@gmail.com>
|
||||
# Gautier Hattenberger <gautier.hattenberger@enac.fr>
|
||||
|
||||
@@ -28,7 +28,7 @@ def make_Bd(B):
|
||||
return Bd
|
||||
|
||||
def make_Zh(Z, m):
|
||||
edges = Z.size/m
|
||||
edges = int(Z.size/m)
|
||||
Zh = np.zeros(Z.size)
|
||||
|
||||
for i in range(0, edges):
|
||||
@@ -39,7 +39,7 @@ def make_Zh(Z, m):
|
||||
return Zh
|
||||
|
||||
def make_Dz(Z, m):
|
||||
edges = Z.size/m
|
||||
edges = int(Z.size/m)
|
||||
Dz = np.zeros((Z.size, edges))
|
||||
|
||||
j = 0
|
||||
@@ -51,7 +51,7 @@ def make_Dz(Z, m):
|
||||
return Dz
|
||||
|
||||
def make_Dzt(Z, m, l):
|
||||
edges = Z.size/m
|
||||
edges = int(Z.size/m)
|
||||
if l == 2:
|
||||
return np.eye(edges)
|
||||
|
||||
@@ -78,7 +78,7 @@ def make_Dztstar(d, m, l):
|
||||
return np.diag(Ztstar)
|
||||
|
||||
def make_DPzh(Z, m):
|
||||
edges = Z.size/m
|
||||
edges = int(Z.size/m)
|
||||
DPzh = np.zeros((2*edges, 2*edges))
|
||||
|
||||
Zt = np.diag(make_Dzt(Z, m, 1))
|
||||
@@ -93,7 +93,7 @@ def make_DPzh(Z, m):
|
||||
return DPzh
|
||||
|
||||
def make_E(Z, d, m, l):
|
||||
edges = Z.size/m
|
||||
edges = int(Z.size/m)
|
||||
E = np.zeros(edges)
|
||||
if edges == 1:
|
||||
E[0] = la.norm(Z)**l - d**l
|
||||
|
||||
Reference in New Issue
Block a user