Support for a new TeraRanger Tower

Hi!

Apologies if I put this thread in a wrong place! I was hesitating between the hardware categories and Copter and thought this one might be more relevant.

At Terabee in the next couple of weeks we are planning to release a new TeraRanger Tower that will support the next generation of sensors and ideally it should nicely work with Copter.

I’m just about to start writing the driver and before proceeding I wanted to ask the community advice. Here is our current driver.

Support of the new Tower will require the following from the driver:

  1. Send bunch of byte frames and check the returned values < at sensor initialization
  2. The minimum and maximum ranges will need to change (at first min: 0.75m max: 8.0m, in the future we want to also support 0.5-60m version and another one that is currently in development).

The only part that I foresee to stay the same is how the frame with sensor readings will be parsed.

There are two approaches I’m considering:

  1. Create a completely new driver to handle the new tower
  2. Modify the existing driver, i.e. change the constructor to take sensor type (probably an enum) and if it’s a new sensor then go through startup procedure otherwise run it as usual

It seems that both of the approaches require a new Proximity Type (TeraRanger Tower Evo?). That doesn’t scale too well because it doesn’t allow handling the new sensor types that we will release in the future.

Would it make sense to create a set of parameters just for TeraRanger Tower type?

We would appreciate any input you might offer.

Best regards,
Mat