bluerobotics / ping-cpp

C++ API implementation of ping-protocol
12 stars 11 forks source link

Device #9

Closed jaxxzer closed 4 years ago

jaxxzer commented 4 years ago

A ping1d device class for ping1d.

Note the test works only with 3.27, legacy requests are not implemented/supported.

This depends on https://github.com/bluerobotics/ping-protocol/pull/167

jaxxzer commented 4 years ago

ping-port.h and ping-time.h are the abstract interfaces that require system-dependent implementations. In this PR I have only implemented linux because that was fastest for me. It should be straightforward to add arduino, mac, windows and stm32 in the future.

(self-review) I think we should put these files in another directory from device.

jaxxzer commented 4 years ago

There is something this that I believe that we should fix, this appears to be based in the python code and this is a c++ project, some things can be improved in a different topology.

Please make your suggestion. This is based off ping-arduino and ping-python.

jaxxzer commented 4 years ago

I'm also unable to compile the repository here:

check travis ci script. The files need to be generated. We can add a cmake hook maybe.

jaxxzer commented 4 years ago

I'm also unable to compile the repository here:

check travis ci script. The files need to be generated. We can add a cmake hook maybe.

I added a cmake hook, so it should work with just make now.

jaxxzer commented 4 years ago

@patrickelectric I believe it's in a better state now after your review

patrickelectric commented 4 years ago

Also.. The development should be done in forks and not in BR remote.

patrickelectric commented 4 years ago

I added a cmake hook, so it should work with just make now.


cmake ..
-- The C compiler identification is GNU 9.1.0
-- The CXX compiler identification is GNU 9.1.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
CMake Error at CMakeLists.txt:14 (add_executable):
Cannot find source file:
src/device/ping-device-ping1d.cpp

Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx

CMake Error at CMakeLists.txt:14 (add_executable): No SOURCES given to target: test-device-ping1d

CMake Generate step failed. Build files cannot be regenerated correctly.


It's still failing here. 
jaxxzer commented 4 years ago

Cmake/local build is fixed to automatically generate the files.

I am leaving the pointer return because it matches our current implementation: http://docs.bluerobotics.com/ping-arduino/class_ping1_d.html. It will take some time to develop something else. I have improved the documentation to instruct the user how the pointer is managed.

I will follow this up with ping360 device class and update ping-arduino to use ping-cpp as a submodule.

patrickelectric commented 4 years ago

@jaxxzer this is failing the CI.

jaxxzer commented 4 years ago

@patrickelectric fixed, I just had to use c++14 instead of 11 :man_facepalming:

patrickelectric commented 4 years ago

Replaced by #25