Skip to content

Commit

Permalink
Updated CI Workflows for Doxygen documention.
Browse files Browse the repository at this point in the history
Closes #21
  • Loading branch information
gabryelreyes committed Oct 19, 2023
1 parent f3e44e5 commit f9d2e4c
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 15 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ jobs:
needs: intro
strategy:
matrix:
environment: ["ConvoyLeaderTarget", "LineFollowerTarget", "RemoteControlTarget"]
environment: ["ConvoyLeaderTarget", "LineFollowerTarget", "RemoteControlTarget", "ConvoyLeaderSim", "LineFollowerSim", "RemoteControlSim"]

steps:
- name: Checkout repository
Expand Down Expand Up @@ -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
59 changes: 46 additions & 13 deletions lib/RemoteControl/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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));
}

/******************************************************************************
Expand Down
2 changes: 1 addition & 1 deletion lib/RemoteControl/App.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f9d2e4c

Please sign in to comment.