Skip to content

Commit

Permalink
Merge pull request #19 from BlueAndi/SerialMuxProt
Browse files Browse the repository at this point in the history
Closes #18
  • Loading branch information
BlueAndi authored Sep 13, 2023
2 parents ddf6e86 + bf33f9c commit ce96ed9
Show file tree
Hide file tree
Showing 23 changed files with 46 additions and 3,100 deletions.
202 changes: 0 additions & 202 deletions doc/YAP/README.md

This file was deleted.

41 changes: 0 additions & 41 deletions doc/YAP/SubscribeSequence.puml

This file was deleted.

40 changes: 0 additions & 40 deletions doc/YAP/SyncSequence.puml

This file was deleted.

6 changes: 3 additions & 3 deletions doc/architecture/REMOTECONTROL.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Radon Ulzer - Remote Control <!-- omit in toc -->

* [General](#general)
* [YAP Channels](#yap-channels)
* [SerialMuxProt Channels](#serialmuxprot-channels)
* [Rx channel "REMOTE\_CMD"](#rx-channel-remote_cmd)
* [Tx channel "REMOTE\_RSP"](#tx-channel-remote_rsp)
* [Rx channel "MOT\_SPEEDS"](#rx-channel-mot_speeds)
Expand All @@ -22,13 +22,13 @@

# General

The robot can be controlled remotely by using the YAP protocol.
The robot can be controlled remotely by using the SerialMuxProt protocol.

On target the physical communication uses the serial.

On simulation the physical communication uses a socket connection.

## YAP Channels
## SerialMuxProt Channels

### Rx channel "REMOTE_CMD"
This channel is used to receive commands, which will be executed by the application in RemoteCtrl state. A command related response will be sent via the "REMOTE_RSP" channel.
Expand Down
4 changes: 2 additions & 2 deletions doc/architecture/uml/LogicalView/Service.plantuml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ package "Service" as serviceLayer {
speed with PID controllers.
end note

class YAP <<service>>
class SerialMuxProt <<service>>

note top of YAP
note top of SerialMuxProt
Communication Protocol for transmitting
and receiving information to/from a remote
client using data channels
Expand Down
6 changes: 3 additions & 3 deletions doc/configuration/uml/RemoteControlSim.puml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ node "PC" {
component "DiffDrive" <<service>> as diffdrive
component "SocketServer" <<service>> as socketServer

component "YAP" <<service>> as yap
component "SerialMuxProt" <<service>> as smp
component "HAL" <<HAL>> as hal

app ..> yap: <<use>>
app ..> smp: <<use>>
app <.. odometry: <<flow>>
app <.. speedometer: <<flow>>
app ..> diffdrive: <<control>>

yap <..> socketServer: <<flow>>
smp <..> socketServer: <<flow>>

odometry ..> hal: <<use>>
speedometer ..> hal: <<use>>
Expand Down
8 changes: 4 additions & 4 deletions lib/ConvoyLeader/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ void App::setup()
Board::getInstance().init();
m_systemStateMachine.setState(&StartupState::getInstance());
m_controlInterval.start(DIFFERENTIAL_DRIVE_CONTROL_PERIOD);
m_yapServer.createChannel(POSITION_CHANNEL, POSITION_CHANNEL_DLC);
m_smpServer.createChannel(POSITION_CHANNEL, POSITION_CHANNEL_DLC);
}

void App::loop()
{
m_yapServer.process(millis());
m_smpServer.process(millis());
Speedometer::getInstance().process();

if (true == m_controlInterval.isTimeout())
Expand All @@ -95,7 +95,7 @@ void App::loop()
*/
Odometry::getInstance().process();

/* Send Position to YAP Client */
/* Send Position to SerialMuxProt Client */
reportPosition();

m_controlInterval.restart();
Expand Down Expand Up @@ -123,7 +123,7 @@ void App::reportPosition()
Util::int32ToByteArray(&outBuf[0U], (sizeof(outBuf) - sizeof(int32_t)), xPos);
Util::int32ToByteArray(&outBuf[4U], (sizeof(outBuf) - sizeof(int32_t)), yPos);

m_yapServer.sendData(POSITION_CHANNEL, outBuf, sizeof(outBuf));
m_smpServer.sendData(POSITION_CHANNEL, outBuf, sizeof(outBuf));
}

void App::positionCallback(const uint8_t* payload, const uint8_t payloadSize)
Expand Down
Loading

0 comments on commit ce96ed9

Please sign in to comment.