Skip to content
Snippets Groups Projects
Commit 3a482ecb authored by Hoop77's avatar Hoop77
Browse files

-

parent b6d5d14b
No related merge requests found
......@@ -14,18 +14,18 @@
Run leader:
```cpp
// Create a leader vehicle instance.
LeaderVehicle leader(1); // 1 = vehicle id
// Starts the vehicle thread so this method returns instantly.
// All operations like createPlatoon(), leavePlatoon() are asynchronous operations.
// This means they either return instantly with return value "true" or are ignored with return value "false".
leader.run();
// Automatically tries to create a platoon with a vehicle specified in the method Vehicle::scanAvailableVehicles().
leader.createPlatoon();
// Do stuff ...
// No need to call leader.stop(), since destructor does all the disconnection and cleanup work automatically.
```
```cpp
// Create a leader vehicle instance.
LeaderVehicle leader(1); // 1 = vehicle id
// Starts the vehicle thread so this method returns instantly.
// All operations like createPlatoon(), leavePlatoon() are asynchronous operations.
// This means they either return instantly with return value "true" or are ignored with return value "false".
leader.run();
// Automatically tries to create a platoon with a vehicle specified in the method Vehicle::scanAvailableVehicles().
leader.createPlatoon();
// Do stuff ...
// No need to call leader.stop(), since destructor does all the disconnection and cleanup work automatically.
```
Run follower:
Just replace the class `LeaderVehicle` with `FollowerVehicle`.
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment