diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 50fb70ac..667c5247 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -148,7 +148,7 @@ jobs: needs: intro strategy: matrix: - environment: ["ConvoyLeaderTarget", "LineFollowerTarget", "RemoteControlTarget"] + environment: ["ConvoyLeaderTarget", "LineFollowerTarget", "RemoteControlTarget", "ConvoyLeaderSim", "LineFollowerSim", "RemoteControlSim"] steps: - name: Checkout repository @@ -186,3 +186,7 @@ jobs: with: working-directory: './doc/doxygen' doxyfile-path: './${{ matrix.environment }}Doxyfile' + + - name: Print doxygen warnings + if: ${{ failure() }} + run: cat ./doc/doxygen/doxygen_warnings.txt \ No newline at end of file diff --git a/lib/RemoteControl/App.cpp b/lib/RemoteControl/App.cpp index 11bbc951..b6fd2964 100644 --- a/lib/RemoteControl/App.cpp +++ b/lib/RemoteControl/App.cpp @@ -104,6 +104,8 @@ void App::setup() /* Providing line sensor data */ m_smpChannelIdLineSensors = m_smpServer.createChannel(CH_NAME_LINE_SENSORS, lineSensorChannelDlc); + + (void)m_smpServer.createChannel("DEBUG", (6U * sizeof(int16_t))); } void App::loop() @@ -168,26 +170,57 @@ void App::sendRemoteControlResponses() (void)m_smpServer.sendData(m_smpChannelIdRemoteCtrlRsp, payload, sizeof(remoteControlRspId)); m_lastRemoteControlRspId = remoteControlRspId; + + uint8_t payloadSize = (6U * sizeof(int16_t)); + uint8_t buffer[payloadSize] = {0U}; + Util::int16ToByteArray(&buffer[0U * sizeof(int16_t)], sizeof(int16_t), + DifferentialDrive::getInstance().getMaxMotorSpeed()); + (void)m_smpServer.sendData("DEBUG", buffer, payloadSize); } } void App::sendLineSensorsData() const { - ILineSensors& lineSensors = Board::getInstance().getLineSensors(); - uint8_t maxLineSensors = lineSensors.getNumLineSensors(); - const uint16_t* lineSensorValues = lineSensors.getSensorValues(); - uint8_t lineSensorIdx = 0U; - uint8_t payload[maxLineSensors * sizeof(uint16_t)]; - - while (maxLineSensors > lineSensorIdx) + // ILineSensors& lineSensors = Board::getInstance().getLineSensors(); + // uint8_t maxLineSensors = lineSensors.getNumLineSensors(); + // const uint16_t* lineSensorValues = lineSensors.getSensorValues(); + // uint8_t lineSensorIdx = 0U; + // uint8_t payload[maxLineSensors * sizeof(uint16_t)]; + + // while (maxLineSensors > lineSensorIdx) + // { + // Util::uint16ToByteArray(&payload[lineSensorIdx * sizeof(uint16_t)], sizeof(uint16_t), + // lineSensorValues[lineSensorIdx]); + + // ++lineSensorIdx; + // } + + // (void)m_smpServer.sendData(m_smpChannelIdLineSensors, payload, sizeof(payload)); + + uint8_t payloadSize = (12U); + uint8_t buffer[payloadSize] = {0U}; + + int16_t linearSetpointLeft; + int16_t linearSetpointRight; + + DifferentialDrive::getInstance().getLinearSpeed(linearSetpointLeft, linearSetpointRight); + + Util::int16ToByteArray(&buffer[0U * sizeof(int16_t)], sizeof(int16_t), + DifferentialDrive::getInstance().getLinearSpeed()); + Util::int16ToByteArray(&buffer[1U * sizeof(int16_t)], sizeof(int16_t), + Speedometer::getInstance().getLinearSpeedCenter()); + Util::int16ToByteArray(&buffer[2U * sizeof(int16_t)], sizeof(int16_t), linearSetpointLeft); + Util::int16ToByteArray(&buffer[3U * sizeof(int16_t)], sizeof(int16_t), + Speedometer::getInstance().getLinearSpeedLeft()); + Util::int16ToByteArray(&buffer[4U * sizeof(int16_t)], sizeof(int16_t), linearSetpointRight); + Util::int16ToByteArray(&buffer[5U * sizeof(int16_t)], sizeof(int16_t), + Speedometer::getInstance().getLinearSpeedRight()); + + IMotors& motors = Board::getInstance().getMotors(); + if (0 == motors.getLeftSpeed()) { - Util::uint16ToByteArray(&payload[lineSensorIdx * sizeof(uint16_t)], sizeof(uint16_t), - lineSensorValues[lineSensorIdx]); - - ++lineSensorIdx; + (void)m_smpServer.sendData("DEBUG", buffer, payloadSize); } - - (void)m_smpServer.sendData(m_smpChannelIdLineSensors, payload, sizeof(payload)); } /****************************************************************************** diff --git a/lib/RemoteControl/App.h b/lib/RemoteControl/App.h index 7e3c7813..b72abde5 100644 --- a/lib/RemoteControl/App.h +++ b/lib/RemoteControl/App.h @@ -97,7 +97,7 @@ class App static const uint32_t DIFFERENTIAL_DRIVE_CONTROL_PERIOD = 5; /** Sending Data period in ms. */ - static const uint32_t SEND_LINE_SENSORS_DATA_PERIOD = 20; + static const uint32_t SEND_LINE_SENSORS_DATA_PERIOD = 1000; /** SerialMuxProt channel name for receiving commands. */ static const char* CH_NAME_CMD;