forked from Archive/PX4-Autopilot
Merge pull request #107 from PX4/gyros_parallel
Made MPU-6000 gyro optional
This commit is contained in:
commit
d5aa763118
|
@ -446,8 +446,12 @@ MPU6000::init()
|
||||||
// write_reg(MPUREG_PWR_MGMT_1,MPU_CLK_SEL_PLLGYROZ);
|
// write_reg(MPUREG_PWR_MGMT_1,MPU_CLK_SEL_PLLGYROZ);
|
||||||
usleep(1000);
|
usleep(1000);
|
||||||
|
|
||||||
/* do CDev init for the gyro device node */
|
/* do CDev init for the gyro device node, keep it optional */
|
||||||
ret = _gyro->init();
|
int gyro_ret = _gyro->init();
|
||||||
|
|
||||||
|
if (gyro_ret != OK) {
|
||||||
|
_gyro_topic = -1;
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -938,7 +942,9 @@ MPU6000::measure()
|
||||||
|
|
||||||
/* and publish for subscribers */
|
/* and publish for subscribers */
|
||||||
orb_publish(ORB_ID(sensor_accel), _accel_topic, &_accel_report);
|
orb_publish(ORB_ID(sensor_accel), _accel_topic, &_accel_report);
|
||||||
|
if (_gyro_topic != -1) {
|
||||||
orb_publish(ORB_ID(sensor_gyro), _gyro_topic, &_gyro_report);
|
orb_publish(ORB_ID(sensor_gyro), _gyro_topic, &_gyro_report);
|
||||||
|
}
|
||||||
|
|
||||||
/* stop measuring */
|
/* stop measuring */
|
||||||
perf_end(_sample_perf);
|
perf_end(_sample_perf);
|
||||||
|
|
Loading…
Reference in New Issue