Operational layer
Introduction
All processes in the operational layer are implemented in Cplusplus (C++). You can find the source code of the operational layer in the artof-core project.
Requirements
RTK GNSS localisation (with heading) : The framework includes a driver for the Septentrio Mosaic-H module.
Example components: SimpleRTK3B Heading
Computer: The computer runs the operational layer and the add-ons.
Tested on:
Brand |
Model |
CPU |
Memory |
---|---|---|---|
Asus® |
BRi5(H)-10210E |
Intel® Core™ i5-10210U CPU @ 1.60GHz |
8 GB |
Intel® |
NUC7i5BNH |
Intel® Core™ i5-7260U CPU @ 2,20GHz |
16 GB |
Intel® |
NUC10i5FNH |
Intel® Core™ i5-10210U CPU @ 1.60GHz |
8 GB |
Intel® |
NUC10i7FNH |
Intel® Core™ i7-10710U CPU @ 1.10GHz |
32 GB |
Operating system:
The operational layer is currently only compiled for Ubuntu 22.04.
The operational layer can run in a Docker® container, which is useful for testing and development. However, this is not recommended for operation as it has not yet been validated on inference.
Processes
VariableManager
All processes in the operational layer inherit the VariableManager
class.
During initialization, it loads a VariableMap::variableMap
of type std::map<std::string, VariablePtr> VariableMap
The pseudocode below illustrates its program cycle.
VariableManager
program cycle while (true) {
// start a clk cycle (f = 20 Hz => T = 50 ms)
clk.start();
// Read all Redis variables
readRedisVariables();
// Execute process specific code
serverTick();
// Write Redis variables (only those who were altered during the cycle)
writeRedisVariables();
// Communicate process health
toggleHeartBeatPulse();
publishProcessingTime(clk.poll());
// Stop the clk cycle (sleep for the remaining time)
clk.stop();
}
The
Clk::clk
member of theVariableManager
class supports process execution at a fixed frequency, which is by default configured to20 Hz
. When the program cycle executes more quickly, there is waited the additional time at thevoid Clk::stop()
statement; otherwise, the process is immediately continued.The
void readRedisVariables()
andvoid writeRedisVariables()
methods perform a block read and block write of the Redis variables described in the redis configuration file. For thevoid writeRedisVariables()
method only the variables that are changed during the program cycle are written. Whether these variables are changed or not is maintained in theVariableMap::variableMap
.The
void serverTick()
is a pure abstract function implemented in the child classes.The
void toggleHeartBeatPulse()
toggles a heartbeat boolean at a period500ms
. TheSystemManager
uses the heartbeat to monitor the health of the different real-time processes. TheSystemManager
recovers the process when it detects no heartbeat for5s
. The PLC in the mechatronic layer also monitors the heartbeat of theNavigation
process. The robot goes to error mode if it detects no heartbeat within2s
.The
void publishProcessingTime()
publishes the processing time to monitor if the process maintains its target frequency.
SystemManager
The SystemManager
process manages the other Jobs
, which are the processes in the operational layer and add-ons.
The Jobs
can be started, interrupted, reconfigured, and updated.
The system manager monitors the health of the operational layer processes by their heartbeats.
Operation
The Operation
process operates the implement, hitch, and sections during autonomous field operation using information from the implement configuration and current robot platform state.
The implement configuration files describe the dimensions and transformation of the different sections relative to hitch pens and their allowed task types, enabling the continuous position and geometry calculation of the implement sections in GNSS coordinates.
Gps
The Gps
process is the device driver for the GNSS Septentrio Mosaic-H module.
It continuously updates the robot state and the other GNSS-dependent variables and maintains the connection to the NTRIP server to receive the RTK connections.
Also drivers for other GNSS devices can be implemented in the Gps
class.
RobotPlc
The RobotPlc
process is the interface between the Redis variables in the operational layer and the robot PLC in the mechatronic layer.
The redis.json
configuration file describes the interface, also listing the Redis variables that must be read and written to the PLC. Communication was performed every process cycle by a read and write snap7 operation (Siemens S7-communication protocol).
For more information on the configuration, we refer to Basic concepts.
Simulation
The Simulation
process enables software integration- and hardware-in-the-loop (HIL) testing.
By setting the robot in simulation mode
, the robot’s navigation and implement operations are performed in a virtual environment by simulating the Gps
process from the operational layer and the kinematic models from the mechatronic layer.
HIL testing performs static implement operation and steering while the traction drives remain inhibited.