35 #include <gazebo/gazebo.hh>
36 #include <gazebo/physics/physics.hh>
37 #include <gazebo/sensors/sensors.hh>
40 #include <gazebo/gazebo_config.h>
41 #if GAZEBO_MAJOR_VERSION < 8
42 #error "Paparazzi only supports gazebo versions > 7, please upgrade to a more recent version of Gazebo"
49 #include "generated/airframe.h"
50 #include "generated/flight_plan.h"
62 #if defined(NPS_DEBUG_VIDEO)
64 #include <opencv2/core/core.hpp>
65 #include <opencv2/highgui/highgui.hpp>
66 #include <opencv2/imgproc/imgproc.hpp>
71 #ifndef NPS_GAZEBO_WORLD
72 #define NPS_GAZEBO_WORLD "empty.world"
74 #ifndef NPS_GAZEBO_AC_NAME
75 #define NPS_GAZEBO_AC_NAME "ardrone"
79 #if NPS_SIMULATE_VIDEO
87 static void init_gazebo_video(
void);
88 static void gazebo_read_video(
void);
89 static void read_image(
91 gazebo::sensors::CameraSensorPtr cam);
93 gazebo::sensors::CameraSensorPtr cam;
94 gazebo::common::Time last_measurement_time;
98 #if NPS_SIMULATE_MT9F002
101 #endif // NPS_SIMULATE_VIDEO
114 #if NPS_SIMULATE_LASER_RANGE_ARRAY
119 static void gazebo_init_range_sensors(
void);
120 static void gazebo_read_range_sensors(
void);
129 static gazebo::physics::ModelPtr
model = NULL;
132 static gazebo::sensors::ContactSensorPtr
ct;
137 static void gazebo_write(
double act_commands[],
int commands_nb);
143 ecef_p.
x = ecef_i.X();
144 ecef_p.
y = ecef_i.Y();
145 ecef_p.
z = ecef_i.Z();
161 lla_p.
lat = lla_i.X();
162 lla_p.
lon = lla_i.Y();
163 lla_p.
alt = lla_i.Z();
170 body_p.
x = body_g.X();
171 body_p.
y = -body_g.Y();
172 body_p.
z = -body_g.Z();
179 body_p.
p = body_g.X();
180 body_p.
q = -body_g.Y();
181 body_p.
r = -body_g.Z();
188 eulers.
psi = -quat.Yaw();
189 eulers.
theta = -quat.Pitch();
190 eulers.
phi = quat.Roll();
197 eulers.
psi = -quat.Yaw() - M_PI / 2;
198 eulers.
theta = -quat.Pitch();
199 eulers.
phi = quat.Roll();
224 #ifdef NPS_ACTUATOR_TIME_CONSTANTS
230 #ifdef NPS_ACTUATOR_MAX_ANGULAR_MOMENTUM
232 const float Iwmax[
NPS_COMMANDS_NB] = NPS_ACTUATOR_MAX_ANGULAR_MOMENTUM;
248 bool launch __attribute__((unused)),
249 double *act_commands,
261 #if NPS_SIMULATE_VIDEO
264 #if NPS_SIMULATE_LASER_RANGE_ARRAY
265 gazebo_init_range_sensors();
271 gazebo::runWorld(
model->GetWorld(), 1);
272 gazebo::sensors::run_once();
275 #if NPS_SIMULATE_VIDEO
278 #if NPS_SIMULATE_LASER_RANGE_ARRAY
279 gazebo_read_range_sensors();
287 double speed __attribute__((unused)),
288 double dir __attribute__((unused)))
293 double wind_north __attribute__((unused)),
294 double wind_east __attribute__((unused)),
295 double wind_down __attribute__((unused)))
300 double wind_speed __attribute__((unused)),
301 int turbulence_severity __attribute__((unused)))
307 double temp __attribute__((unused)),
308 double h __attribute__((unused)))
326 string gazebo_home =
"/conf/simulator/gazebo/";
327 string pprz_home(getenv(
"PAPARAZZI_HOME"));
328 string gazebodir = pprz_home + gazebo_home;
329 cout <<
"Gazebo directory: " << gazebodir << endl;
331 if (!gazebo::setupServer(0, NULL)) {
332 cout <<
"Failed to start Gazebo, exiting." << endl;
336 cout <<
"Add Paparazzi paths: " << gazebodir << endl;
337 gazebo::common::SystemPaths::Instance()->AddModelPaths(gazebodir +
"models/");
338 sdf::addURIPath(
"model://", gazebodir +
"models/");
339 sdf::addURIPath(
"world://", gazebodir +
"world/");
341 cout <<
"Add TU Delft paths: " << pprz_home +
"/sw/ext/tudelft_gazebo_models/" << endl;
342 gazebo::common::SystemPaths::Instance()->AddModelPaths(pprz_home +
"/sw/ext/tudelft_gazebo_models/models/");
343 sdf::addURIPath(
"model://", pprz_home +
"/sw/ext/tudelft_gazebo_models/models/");
344 sdf::addURIPath(
"world://", pprz_home +
"/sw/ext/tudelft_gazebo_models/world/");
348 string vehicle_filename = sdf::findFile(vehicle_uri,
false);
349 if (vehicle_filename.empty()) {
350 cout <<
"ERROR, could not find vehicle " + vehicle_uri << endl;
353 cout <<
"Load vehicle: " << vehicle_filename << endl;
354 sdf::SDFPtr vehicle_sdf(
new sdf::SDF());
356 if (!sdf::readFile(vehicle_filename, vehicle_sdf)) {
357 cout <<
"ERROR, could not read vehicle " + vehicle_filename << endl;
363 #if NPS_SIMULATE_LASER_RANGE_ARRAY
364 vehicle_sdf->Root()->GetFirstElement()->AddElement(
"include")->GetElement(
"uri")->Set(
"model://range_sensors");
365 sdf::ElementPtr range_joint = vehicle_sdf->Root()->GetFirstElement()->AddElement(
"joint");
366 range_joint->GetAttribute(
"name")->Set(
"range_sensor_joint");
367 range_joint->GetAttribute(
"type")->Set(
"fixed");
368 range_joint->GetElement(
"parent")->Set(
"chassis");
369 range_joint->GetElement(
"child")->Set(
"range_sensors::base");
372 #ifdef NPS_SIMULATE_MT9F002
373 sdf::ElementPtr link = vehicle_sdf->Root()->GetFirstElement()->GetElement(
"link");
375 if (link->Get<
string>(
"name") ==
"front_camera") {
376 int w = link->GetElement(
"sensor")->GetElement(
"camera")->GetElement(
"image")->GetElement(
"width")->Get<
int>();
377 link->GetElement(
"sensor")->GetElement(
"camera")->GetElement(
"image")->GetElement(
"width")->Set(
379 int h = link->GetElement(
"sensor")->GetElement(
"camera")->GetElement(
"image")->GetElement(
"height")->Get<
int>();
380 link->GetElement(
"sensor")->GetElement(
"camera")->GetElement(
"image")->GetElement(
"height")->Set(
381 h * MT9F002_OUTPUT_SCALER);
382 int env = link->GetElement(
"sensor")->GetElement(
"camera")->GetElement(
"lens")->GetElement(
"env_texture_size")->Get<
int>();
383 link->GetElement(
"sensor")->GetElement(
"camera")->GetElement(
"lens")->GetElement(
"env_texture_size")->Set(
384 env * MT9F002_OUTPUT_SCALER);
385 cout <<
"Applied MT9F002_OUTPUT_SCALER (=" << MT9F002_OUTPUT_SCALER <<
") to " << link->Get<
string>(
"name") << endl;
387 cout <<
"Applied MT9F002_TARGET_FPS (=" <<
MT9F002_TARGET_FPS <<
") to " << link->Get<
string>(
"name") << endl;
389 link = link->GetNextElement(
"link");
391 #endif // NPS_SIMULATE_MT9F002
396 string world_filename = sdf::findFile(world_uri,
false);
397 if (world_filename.empty()) {
398 cout <<
"ERROR, could not find world " + world_uri << endl;
401 cout <<
"Load world: " << world_filename << endl;
402 sdf::SDFPtr world_sdf(
new sdf::SDF());
404 if (!sdf::readFile(world_filename, world_sdf)) {
405 cout <<
"ERROR, could not read world " + world_filename << endl;
410 world_sdf->Root()->GetFirstElement()->InsertElement(vehicle_sdf->Root()->GetFirstElement());
412 world_sdf->Write(pprz_home +
"/var/gazebo.world");
414 gazebo::physics::WorldPtr world = gazebo::loadWorld(pprz_home +
"/var/gazebo.world");
416 cout <<
"Failed to open world, exiting." << endl;
429 gazebo::sensors::run_once(
true);
430 gazebo::sensors::run_threads();
431 gazebo::runWorld(world, 1);
432 cout <<
"Sensors initialized..." << endl;
435 gazebo::sensors::SensorManager *mgr = gazebo::sensors::SensorManager::Instance();
436 ct = static_pointer_cast < gazebo::sensors::ContactSensor > (mgr->GetSensor(
"contactsensor"));
440 #ifdef MOTOR_MIXING_YAW_COEF
441 const double yaw_coef[] = MOTOR_MIXING_YAW_COEF;
444 gazebo_actuators.
torques[i] = -fabs(gazebo_actuators.
torques[i]) * yaw_coef[i] / fabs(yaw_coef[i]);
448 cout <<
"Gazebo initialized successfully!" << endl;
461 static ignition::math::Vector3d vel_prev;
462 static double time_prev;
464 gazebo::physics::WorldPtr world =
model->GetWorld();
465 ignition::math::Pose3d pose =
model->WorldPose();
466 ignition::math::Vector3d vel =
model->WorldLinearVel();
467 ignition::math::Vector3d ang_vel =
model->WorldAngularVel();
468 gazebo::common::SphericalCoordinatesPtr sphere = world->SphericalCoords();
469 ignition::math::Quaterniond local_to_global_quat(0, 0, -sphere->HeadingOffset().Radian());
472 fdm.
time = world->SimTime().Double();
478 double dt =
fdm.
time - time_prev;
479 ignition::math::Vector3d accel = (vel - vel_prev) / dt;
490 gazebo::common::SphericalCoordinates::ECEF));
492 gazebo::common::SphericalCoordinates::GLOBAL));
493 fdm.
lla_pos =
to_pprz_lla(sphere->PositionTransform(pose.Pos(), gazebo::common::SphericalCoordinates::LOCAL,
494 gazebo::common::SphericalCoordinates::SPHERICAL));
505 gazebo::common::SphericalCoordinates::ECEF));
508 gazebo::common::SphericalCoordinates::GLOBAL));
513 gazebo::common::SphericalCoordinates::ECEF));
516 gazebo::common::SphericalCoordinates::GLOBAL));
536 fdm.
ltp_g =
to_pprz_ltp(sphere->VelocityTransform(-1 * world->Gravity(), gazebo::common::SphericalCoordinates::LOCAL,
537 gazebo::common::SphericalCoordinates::GLOBAL));
538 fdm.
ltp_h =
to_pprz_ltp(sphere->VelocityTransform(world->MagneticField(), gazebo::common::SphericalCoordinates::LOCAL,
539 gazebo::common::SphericalCoordinates::GLOBAL));
542 #if GAZEBO_MAJOR_VERSION >= 8 && 0 // TODO implement
586 for (
int i = 0; i < commands_nb; ++i) {
591 #ifdef NPS_ACTUATOR_TIME_CONSTANTS
597 double thrust = gazebo_actuators.
thrusts[i] * u;
598 double torque = gazebo_actuators.
torques[i] * u;
600 #ifdef NPS_ACTUATOR_MAX_ANGULAR_MOMENTUM
603 double spinup_torque = gazebo_actuators.
max_ang_momentum[i] / (2.0 * sqrt(u > 0.05 ? u : 0.05)) * udot;
604 torque += spinup_torque;
608 gazebo::physics::LinkPtr link =
model->GetLink(gazebo_actuators.
names[i]);
609 link->AddRelativeForce(ignition::math::Vector3d(0, 0, thrust));
610 link->AddRelativeTorque(ignition::math::Vector3d(0, 0, torque));
614 #if NPS_SIMULATE_VIDEO
629 static void init_gazebo_video(
void)
631 gazebo::sensors::SensorManager *mgr =
632 gazebo::sensors::SensorManager::Instance();
634 cout <<
"Initializing cameras..." << endl;
639 gazebo::physics::LinkPtr link =
model->GetLink(
cameras[i]->dev_name);
647 if (link->GetSensorCount() != 1) {
648 cout <<
"ERROR: Link '" << link->GetName()
649 <<
"' should only contain 1 sensor!" << endl;
652 string name = link->GetSensorName(0);
653 gazebo::sensors::CameraSensorPtr cam = static_pointer_cast
654 < gazebo::sensors::CameraSensor > (mgr->GetSensor(name));
656 cout <<
"ERROR: Could not get pointer to '" << name <<
"'!" << endl;
660 cam->SetActive(
true);
662 gazebo_cams[i].cam = cam;
663 gazebo_cams[i].last_measurement_time = cam->LastMeasurementTime();
675 #if NPS_SIMULATE_MT9F002
677 if (cam->Name() ==
"front_camera") {
694 cout <<
"ok" << endl;
706 static void gazebo_read_video(
void)
709 gazebo::sensors::CameraSensorPtr &cam = gazebo_cams[i].cam;
711 if (cam == NULL) {
continue; }
714 if ((cam->LastMeasurementTime() - gazebo_cams[i].last_measurement_time).Float() < 0.005
715 || cam->LastMeasurementTime() == 0) {
continue; }
718 read_image(&img, cam);
721 cv::Mat RGB_cam(cam->ImageHeight(), cam->ImageWidth(), CV_8UC3, (
uint8_t *)cam->ImageData());
722 cv::cvtColor(RGB_cam, RGB_cam, cv::COLOR_RGB2BGR);
723 cv::namedWindow(
cameras[i]->dev_name, cv::WINDOW_AUTOSIZE);
724 cv::imshow(
cameras[i]->dev_name, RGB_cam);
732 gazebo_cams[i].last_measurement_time = cam->LastMeasurementTime();
746 static void read_image(
748 gazebo::sensors::CameraSensorPtr cam)
752 #if NPS_SIMULATE_MT9F002
753 if (cam->Name() ==
"front_camera") {
764 const uint8_t *data_rgb = cam->ImageData();
766 for (
int x = 0; x < img->
w; ++x) {
767 for (
int y = 0; y < img->
h; ++y) {
768 int idx_rgb = 3 * (cam->ImageWidth() * (y + ystart) + (x + xstart));
769 int idx_yuv = 2 * (img->
w * y + x);
770 int idx_px = img->
w * y + x;
771 if (idx_px % 2 == 0) {
772 data_yuv[idx_yuv] = - 0.148 * data_rgb[idx_rgb]
773 - 0.291 * data_rgb[idx_rgb + 1]
774 + 0.439 * data_rgb[idx_rgb + 2] + 128;
776 data_yuv[idx_yuv] = 0.439 * data_rgb[idx_rgb]
777 - 0.368 * data_rgb[idx_rgb + 1]
778 - 0.071 * data_rgb[idx_rgb + 2] + 128;
780 data_yuv[idx_yuv + 1] = 0.257 * data_rgb[idx_rgb]
781 + 0.504 * data_rgb[idx_rgb + 1]
782 + 0.098 * data_rgb[idx_rgb + 2] + 16;
786 gazebo::common::Time
ts = cam->LastMeasurementTime();
787 img->
ts.tv_sec = ts.sec;
788 img->
ts.tv_usec = ts.nsec / 1000.0;
789 img->
pprz_ts = ts.Double() * 1e6;
792 #endif // NPS_SIMULATE_VIDEO
794 #if NPS_SIMULATE_LASER_RANGE_ARRAY
817 struct gazebo_ray_t {
818 gazebo::sensors::RaySensorPtr sensor;
819 gazebo::common::Time last_measurement_time;
822 static struct gazebo_ray_t rays[LASER_RANGE_ARRAY_NUM_SENSORS] = {{NULL, 0}};
823 static float range_orientation[] = LASER_RANGE_ARRAY_ORIENTATIONS;
824 static uint8_t ray_sensor_agl_index = 255;
826 #define VL53L0_MAX_VAL 8.191f
828 static void gazebo_init_range_sensors(
void)
830 gazebo::sensors::SensorManager *mgr = gazebo::sensors::SensorManager::Instance();
831 gazebo::sensors::Sensor_V
sensors = mgr->GetSensors();
835 gazebo::sensors::RaySensorPtr ray_sensor;
836 uint8_t ray_sensor_count_selected = 0;
839 for (
uint16_t i = 0; i < sensor_count; i++) {
840 if (ray_sensor_count_selected > LASER_RANGE_ARRAY_NUM_SENSORS) {
844 if (sensors.at(i)->Type() ==
"ray") {
845 ray_sensor = static_pointer_cast<gazebo::sensors::RaySensor>(sensors.at(i));
848 cout <<
"ERROR: Could not get pointer to raysensor " << i <<
"!" << endl;
861 for (
int j = 0; j < LASER_RANGE_ARRAY_NUM_SENSORS; j++) {
862 struct DoubleEulers def = {0, range_orientation[j * 2], range_orientation[j * 2 + 1]};
867 if (fabs(angle) < RadOfDeg(5)) {
868 ray_sensor_count_selected++;
869 rays[j].sensor = ray_sensor;
870 rays[j].sensor->SetActive(
true);
872 #if LASER_RANGE_ARRAY_SEND_AGL
874 if (fabs(range_orientation[j * 2] + M_PI_2) < RadOfDeg(5)) {
875 ray_sensor_agl_index = j;
884 if (ray_sensor_count_selected != LASER_RANGE_ARRAY_NUM_SENSORS) {
885 cout <<
"ERROR: you have defined " << LASER_RANGE_ARRAY_NUM_SENSORS <<
" sensors in your airframe file, but only "
886 << ray_sensor_count_selected <<
" sensors have been found in the gazebo simulator, "
887 "with the same orientation as in the airframe file " << endl;
890 cout <<
"Initialized laser range array" << endl;
893 static void gazebo_read_range_sensors(
void)
898 for (
int i = 0; i < LASER_RANGE_ARRAY_NUM_SENSORS; i++) {
899 if ((rays[i].sensor->LastMeasurementTime() - rays[i].last_measurement_time).Float() < 0.005
900 || rays[i].sensor->LastMeasurementTime() == 0) {
continue; }
902 if (rays[i].sensor->Range(0) < 1e-5 || rays[i].sensor->Range(0) >
VL53L0_MAX_VAL) {
905 range = rays[i].sensor->Range(0);
908 range_orientation[i * 2 + 1]);
910 if (i == ray_sensor_agl_index) {
911 float agl = rays[i].sensor->Range(0);
913 if (agl > 1e-5 && !isinf(agl)) {
917 rays[i].last_measurement_time = rays[i].sensor->LastMeasurementTime();
920 #endif // NPS_SIMULATE_LASER_RANGE_ARRAY
922 #pragma GCC diagnostic pop // Ignore -Wdeprecated-declarations
struct NedCoor_d to_pprz_ned(ignition::math::Vector3d global)
vector in North East Down coordinates Units: meters
struct NedCoor_d ltpprz_ecef_accel
accel in ltppprz frame, wrt ECEF frame
struct LlaCoor_d lla_pos_geoc
void nps_fdm_set_temperature(double temp, double h)
Set temperature in degrees Celcius at given height h above MSL.
struct DoubleVect3 body_inertial_accel
acceleration in body frame, wrt ECI inertial frame
float focal_x
focal length in the x-direction in pixels
struct crop_t crop
Cropped area definition.
struct gazebo_actuators_t gazebo_actuators
struct DoubleRates body_ecef_rotvel
#define QUAT_DOT_PRODUCT(_qa, _qb)
uint16_t h
height of the cropped area
static void gazebo_write(double act_commands[], int commands_nb)
Write actuator commands to Gazebo.
struct img_size_t output_size
Output image size.
#define OBS_DETECTION_RANGE_ARRAY_NPS_ID
static gazebo::physics::ModelPtr model
#define NPS_COMMANDS_NB
Number of commands sent to the FDM of NPS.
#define MT9F002_OUTPUT_HEIGHT
Simple first order low pass filter with bilinear transform.
struct EcefCoor_d to_pprz_ecef(ignition::math::Vector3d ecef_i)
void image_free(struct image_t *img)
Free the image.
#define MT9F002_INITIAL_OFFSET_X
struct NedCoor_d ltp_ecef_accel
acceleration in LTP frame, wrt ECEF frame
double alt
in meters above WGS84 reference ellipsoid
static float pprz_isa_pressure_of_height(float height, float ref_p)
Get pressure in Pa from height (using simplified equation).
struct NpsFdm fdm
Holds all necessary NPS FDM state information.
Main include for ABI (AirBorneInterface).
static struct video_config_t * cameras[VIDEO_THREAD_MAX_CAMERAS]
void image_create(struct image_t *img, uint16_t width, uint16_t height, enum image_type type)
Create a new image.
double thrusts[NPS_COMMANDS_NB]
struct LlaCoor_d lla_pos_pprz
#define MT9F002_INITIAL_OFFSET_Y
First order low pass filter structure.
vector in Latitude, Longitude and Altitude
#define AGL_RAY_SENSOR_GAZEBO_ID
char * dev_name
path to device
struct DoubleRates body_inertial_rotvel
void nps_fdm_init(double dt)
Initialize actuator dynamics, set unused fields in fdm.
static void init_first_order_high_pass(struct FirstOrderHighPass *filter, float tau, float sample_time, float value)
Init first order high pass filter.
void nps_fdm_set_wind_ned(double wind_north, double wind_east, double wind_down)
uint32_t pprz_ts
The timestamp in us since system startup.
#define MT9F002_OUTPUT_SCALER
Our output is only OUTPUT_SCALER of the pixels we take of the sensor It is programmable in 1/16 steps...
struct DoubleEulers ltp_to_body_eulers
static float update_first_order_high_pass(struct FirstOrderHighPass *filter, float value)
Update first order high pass filter state with a new value.
struct NedCoor_d ltp_ecef_vel
velocity in LTP frame, wrt ECEF frame
struct pprz_autopilot autopilot
Global autopilot structure.
double pressure_sl
pressure at sea level in Pascal
First order high pass filter structure.
struct NedCoor_d ltpprz_pos
uint16_t w
Width of the cropped area.
struct LlaCoor_d to_pprz_lla(ignition::math::Vector3d lla_i)
struct EcefCoor_d ecef_ecef_vel
velocity in ECEF frame, wrt ECEF frame
uint8_t buf_idx
Buffer index for V4L2 freeing.
double airspeed
equivalent airspeed in m/s
Image helper functions like resizing, color filter, converters...
struct DoubleVect3 to_pprz_body(ignition::math::Vector3d body_g)
struct DoubleVect3 body_accel
acceleration in body frame as measured by an accelerometer (incl.
double pressure
current (static) atmospheric pressure in Pascal
void nps_fdm_set_turbulence(double wind_speed, int turbulence_severity)
string names[NPS_COMMANDS_NB]
Architecture independent timing functions.
void double_quat_of_eulers(struct DoubleQuat *q, struct DoubleEulers *e)
struct img_size_t sensor_size
Original sensor size.
Paparazzi atmospheric pressure conversion utilities.
Computer vision framework for onboard processing.
struct DoubleVect3 wind
velocity in m/s in NED
struct DoubleRates to_pprz_rates(ignition::math::Vector3d body_g)
void * buf
Image buffer (depending on the image_type)
struct LlaCoor_d lla_pos_geod
struct DoubleEulers to_global_pprz_eulers(ignition::math::Quaterniond quat)
double torques[NPS_COMMANDS_NB]
struct NpsSensors sensors
double dynamic_pressure
dynamic pressure in Pascal
void nps_fdm_run_step(bool launch, double *act_commands, int commands_nb)
Update the simulation state.
vector in EarthCenteredEarthFixed coordinates
This header gives NPS access to the list of added cameras.
#define NPS_GAZEBO_AC_NAME
#define MT9F002_OUTPUT_WIDTH
static const int32_t yaw_coef[MOTOR_MIXING_NB_MOTOR]
Core autopilot interface common to all firmwares.
Initialization and configuration of the MT9F002 CMOS Chip.
struct DoubleVect3 body_ecef_vel
velocity in body frame, wrt ECEF frame
double max_ang_momentum[NPS_COMMANDS_NB]
static void init_gazebo(void)
Set up a Gazebo server.
void cv_run_device(struct video_config_t *device, struct image_t *img)
static void h(const real32_T x[7], const real32_T q[4], real32_T y[6])
struct DoubleVect3 to_pprz_ltp(ignition::math::Vector3d xyz)
struct FirstOrderLowPass lowpass[NPS_COMMANDS_NB]
double temperature
current temperature in degrees Celcius
bool motors_on
arming status
struct timeval ts
The timestamp of creation.
struct DoubleEulers to_pprz_eulers(ignition::math::Quaterniond quat)
struct DoubleQuat ltpprz_to_body_quat
Simple high pass filter with double precision.
float focal_y
focal length in the y-direction in pixels
float center_y
center image coordinate in the y-direction
struct camera_intrinsics_t camera_intrinsics
Intrinsics of the camera; camera calibration parameters and distortion parameter(s) ...
struct EcefCoor_d ecef_pos
static void init_first_order_low_pass(struct FirstOrderLowPass *filter, float tau, float sample_time, float value)
Init first order low pass filter.
UYVY format (uint16 per pixel)
struct DoubleVect3 body_ecef_accel
acceleration in body frame, wrt ECEF frame
#define VIDEO_THREAD_MAX_CAMERAS
void nps_fdm_set_wind(double speed, double dir)
static void gazebo_read(void)
Read Gazebo's simulation state and store the results in the fdm struct used by NPS.
Paparazzi double precision floating point algebra.
struct NedCoor_d ltpprz_ecef_vel
velocity in ltppprz frame, wrt ECEF frame
static bool gazebo_initialized
#define MT9F002_TARGET_FPS
static gazebo::sensors::ContactSensorPtr ct
struct DoubleQuat ltp_to_body_quat
double sideslip
sideslip angle in rad
struct EcefCoor_d ecef_ecef_accel
acceleration in ECEF frame, wrt ECEF frame
Common Motor Mixing configuration types.
struct DoubleEulers ltpprz_to_body_eulers
struct FirstOrderHighPass highpass[NPS_COMMANDS_NB]
double aoa
angle of attack in rad
static float update_first_order_low_pass(struct FirstOrderLowPass *filter, float value)
Update first order low pass filter state with a new value.
float center_x
center image coordinate in the x-direction