这篇教程C++ AP_Baro类代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中AP_Baro类的典型用法代码示例。如果您正苦于以下问题:C++ AP_Baro类的具体用法?C++ AP_Baro怎么用?C++ AP_Baro使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。 在下文中一共展示了AP_Baro类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: send_sensor_offsetsvoid GCS_MAVLINK::send_sensor_offsets(const AP_InertialSensor &ins, const Compass &compass, AP_Baro &barometer){ // run this message at a much lower rate - otherwise it // pointlessly wastes quite a lot of bandwidth static uint8_t counter; if (counter++ < 10) { return; } counter = 0; const Vector3f &mag_offsets = compass.get_offsets(0); const Vector3f &accel_offsets = ins.get_accel_offsets(0); const Vector3f &gyro_offsets = ins.get_gyro_offsets(0); mavlink_msg_sensor_offsets_send(chan, mag_offsets.x, mag_offsets.y, mag_offsets.z, compass.get_declination(), barometer.get_pressure(), barometer.get_temperature()*100, gyro_offsets.x, gyro_offsets.y, gyro_offsets.z, accel_offsets.x, accel_offsets.y, accel_offsets.z);}
开发者ID:walmis,项目名称:APMLib,代码行数:28,
示例2: send_scaled_pressurevoid GCS_MAVLINK::send_scaled_pressure(AP_Baro &barometer){ float pressure = barometer.get_pressure(); mavlink_msg_scaled_pressure_send( chan, hal.scheduler->millis(), pressure*0.01f, // hectopascal (pressure - barometer.get_ground_pressure())*0.01f, // hectopascal barometer.get_temperature()*100); // 0.01 degrees C}
开发者ID:Hweeping,项目名称:ardupilot,代码行数:10,
示例3: send_scaled_pressurevoid GCS_MAVLINK::send_scaled_pressure(AP_Baro &barometer){ uint32_t now = hal.scheduler->millis(); float pressure = barometer.get_pressure(0); mavlink_msg_scaled_pressure_send( chan, now, pressure*0.01f, // hectopascal (pressure - barometer.get_ground_pressure(0))*0.01f, // hectopascal barometer.get_temperature(0)*100); // 0.01 degrees C#if BARO_MAX_INSTANCES > 1 if (barometer.num_instances() > 1) { pressure = barometer.get_pressure(1); mavlink_msg_scaled_pressure2_send( chan, now, pressure*0.01f, // hectopascal (pressure - barometer.get_ground_pressure(1))*0.01f, // hectopascal barometer.get_temperature(1)*100); // 0.01 degrees C }#endif}
开发者ID:walmis,项目名称:APMLib,代码行数:22,
示例4: send_scaled_pressurevoid GCS_MAVLINK::send_scaled_pressure(AP_Baro &barometer){ uint32_t now = AP_HAL::millis(); float pressure = barometer.get_pressure(0); mavlink_msg_scaled_pressure_send( chan, now, pressure*0.01f, // hectopascal (pressure - barometer.get_ground_pressure(0))*0.01f, // hectopascal barometer.get_temperature(0)*100); // 0.01 degrees C if (barometer.num_instances() > 1) { pressure = barometer.get_pressure(1); mavlink_msg_scaled_pressure2_send( chan, now, pressure*0.01f, // hectopascal (pressure - barometer.get_ground_pressure(1))*0.01f, // hectopascal barometer.get_temperature(1)*100); // 0.01 degrees C } if (barometer.num_instances() > 2) { pressure = barometer.get_pressure(2); mavlink_msg_scaled_pressure3_send( chan, now, pressure*0.01f, // hectopascal (pressure - barometer.get_ground_pressure(2))*0.01f, // hectopascal barometer.get_temperature(2)*100); // 0.01 degrees C }}
开发者ID:VirtualRobotixItalia,项目名称:ardupilot,代码行数:31,
示例5: setupvoid ReplayVehicle::setup(void) { load_parameters(); // we pass zero log structures, as we will be outputting the log // structures we need manually, to prevent FMT duplicates dataflash.Init(log_structure, 0); dataflash.StartNewLog(); ahrs.set_compass(&compass); ahrs.set_fly_forward(true); ahrs.set_wind_estimation(true); ahrs.set_correct_centrifugal(true); ahrs.set_ekf_use(true); EKF2.set_enable(true); printf("Starting disarmed/n"); hal.util->set_soft_armed(false); barometer.init(); barometer.setHIL(0); barometer.update(); compass.init(); ins.set_hil_mode();}
开发者ID:BellX1,项目名称:ardupilot,代码行数:26,
示例6: setupvoid setup(){ hal.console->println("Barometer library test"); hal.scheduler->delay(1000); barometer.init(); barometer.calibrate(); timer = hal.scheduler->micros();}
开发者ID:geofrancis,项目名称:ardupilot,代码行数:11,
示例7: loopvoid loop(){ // run accumulate() at 50Hz and update() at 10Hz if((hal.scheduler->micros() - timer) > 20*1000UL) { timer = hal.scheduler->micros(); barometer.accumulate(); if (counter++ < 5) { return; } counter = 0; barometer.update(); uint32_t read_time = hal.scheduler->micros() - timer; float alt = barometer.get_altitude(); if (!barometer.healthy()) { hal.console->println("not healthy"); return; } hal.console->print("Pressure:"); hal.console->print(barometer.get_pressure()); hal.console->print(" Temperature:"); hal.console->print(barometer.get_temperature()); hal.console->print(" Altitude:"); hal.console->print(alt); hal.console->printf(" climb=%.2f t=%u", barometer.get_climb_rate(), (unsigned)read_time); hal.console->println(); } else { hal.scheduler->delay(1); }}
开发者ID:geofrancis,项目名称:ardupilot,代码行数:31,
示例8: setupvoid setup(void){ serial_manager.init(); ins.init(100); baro.init(); ahrs.init(); gps.init(NULL, serial_manager);}
开发者ID:ArmaJo,项目名称:ardupilot,代码行数:9,
示例9: setupvoid ReplayVehicle::setup(void) { dataflash.Init(log_structure, sizeof(log_structure)/sizeof(log_structure[0])); dataflash.StartNewLog(); ahrs.set_compass(&compass); ahrs.set_fly_forward(true); ahrs.set_wind_estimation(true); ahrs.set_correct_centrifugal(true); ahrs.set_ekf_use(true); printf("Starting disarmed/n"); hal.util->set_soft_armed(false); barometer.init(); barometer.setHIL(0); barometer.update(); compass.init(); ins.set_hil_mode();}
开发者ID:sutherlandm,项目名称:ardupilot,代码行数:19,
注:本文中的AP_Baro类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ AP_GPS类代码示例 C++ AP_AHRS类代码示例 |