Implemented Create reset method

This commit is contained in:
Bernhard Klauninger 2024-07-03 16:13:33 +02:00 committed by Konstantin Lampalzer
parent d3a714cc51
commit aaa7b5076e
3 changed files with 15 additions and 1 deletions

View file

@ -84,7 +84,7 @@ endforeach()
# Configuration #
#################
set(CMAKE_INSTALL_PREFIX "/usr/")
# set(CMAKE_INSTALL_PREFIX "/usr/") // complib needs this, riplib doesn't
# Install directories layout:
# * <prefix>/lib/

View file

@ -135,6 +135,11 @@ namespace create {
*/
~Create();
/**
* \brief Resets the create as if the battery was removed and reinserted.
*/
void reset();
/**
* \brief Make a serial connection to Create.
*

View file

@ -67,6 +67,15 @@ namespace create {
disconnect();
}
void Create::reset() {
if (!connected()) {
CERR("[create::Serial] ", "send failed, not connected.");
return;
}
serial->sendOpcode(OC_START);
serial->sendOpcode(OC_RESET);
}
Create::Matrix Create::addMatrices(const Matrix &A, const Matrix &B) const {
size_t rows = A.size1();
size_t cols = A.size2();