I’m having trouble to activate Maxbotix I2C sonar in this version.
It dose not even initialized (there is no sound from the sensor).
Works on 3.4.6.
I saw that in this branch (3.5) the rangefinder code is changed and there is no primary, just orientation.
Maybe it something to do with it?
The relevant parameters:
RNGFND_ADDR,0 (Relevant only for I2C Lightwere sensor)
RNGFND_FUNCTION,0
RNGFND_GAIN,0.8
RNGFND_GNDCLEAR,10
RNGFND_MAX_CM,700
RNGFND_MIN_CM,20
RNGFND_OFFSET,0
RNGFND_ORIENT,25 (Down - pitch 270)
RNGFND_PIN,-1
RNGFND_POS_X,0
RNGFND_POS_Y,0
RNGFND_POS_Z,0
RNGFND_PWRRNG,0
RNGFND_RMETRIC,1
RNGFND_SCALING,3
RNGFND_SETTLE,0
RNGFND_STOP_PIN,-1
RNGFND_TYPE,4
Disarmd log is attaced
00000035.BIN (140 KB)
I dont know if this is related and i’m not familiar with the code but I think something broke in 'rangefinder.cpp
Is it OK that ‘find_instance’ called once and returning multiple values?
bool RangeFinder::has_data_orient(enum Rotation orientation) const
{
uint8_t i;
if (find_instance(orientation, i)) {
return has_data(i);
}
return false;
}
bool RangeFinder::find_instance(enum Rotation orientation, uint8_t &instance) const
{
for (uint8_t i=0; i<num_instances; i++) {
if (_orientation[i] == orientation) {
instance = i;
return true;
}
}
return false;
}
OXINARF
(Francisco Ferreira)
April 6, 2017, 5:07pm
3
galdalali:
RNGFND_TYPE,4
This should be 2 I think. 4 doesn’t do anything.
You are right, this need to be fixed on Mission planner labels for rangefinder.
enum RangeFinder_Type {
RangeFinder_TYPE_NONE = 0,
RangeFinder_TYPE_ANALOG = 1,
RangeFinder_TYPE_MBI2C = 2,
RangeFinder_TYPE_PLI2C = 3,
RangeFinder_TYPE_PX4 = 4,
RangeFinder_TYPE_PX4_PWM= 5,
RangeFinder_TYPE_BBB_PRU= 6,
RangeFinder_TYPE_LWI2C = 7,
RangeFinder_TYPE_LWSER = 8,
RangeFinder_TYPE_BEBOP = 9,
RangeFinder_TYPE_MAVLink = 10,
RangeFinder_TYPE_ULANDING= 11,
RangeFinder_TYPE_LEDDARONE = 12,
RangeFinder_TYPE_MBSER = 13,
RangeFinder_TYPE_TRONE = 14,
RangeFinder_TYPE_PLI2CV3= 15,
};