SCJ and EV3 Robots Leadership Election. Background Safety Critical Java – A safety critical...
-
Upload
kerry-hancock -
Category
Documents
-
view
215 -
download
0
Transcript of SCJ and EV3 Robots Leadership Election. Background Safety Critical Java – A safety critical...
![Page 1: SCJ and EV3 Robots Leadership Election. Background Safety Critical Java – A safety critical programming model in Java EV3 mindstorms Lego Robot – A robot.](https://reader036.fdocuments.us/reader036/viewer/2022082713/5697bfdf1a28abf838cb27ce/html5/thumbnails/1.jpg)
SCJ and EV3 Robots
Leadership Election
![Page 2: SCJ and EV3 Robots Leadership Election. Background Safety Critical Java – A safety critical programming model in Java EV3 mindstorms Lego Robot – A robot.](https://reader036.fdocuments.us/reader036/viewer/2022082713/5697bfdf1a28abf838cb27ce/html5/thumbnails/2.jpg)
Background
• Safety Critical Java– A safety critical programming model in Java
• EV3 mindstorms Lego Robot– A robot toy that has a Linux running on it.
• Leadership Election Algorithm– An algorithm that applies to distributed systems and aims to elect a
stable leader.
![Page 3: SCJ and EV3 Robots Leadership Election. Background Safety Critical Java – A safety critical programming model in Java EV3 mindstorms Lego Robot – A robot.](https://reader036.fdocuments.us/reader036/viewer/2022082713/5697bfdf1a28abf838cb27ce/html5/thumbnails/3.jpg)
To implement the algorithm, we need
• A Robot Layer (provided by icecap)– Contains a set of interfaces to control the robot i.e. the motors.
• A Network Layer (we implemented it)– One or more sets (e.g. TCP and UDP) of interfaces to provide the
network facilities. • A protocol layer – Contains the implementation of the leader election protocol.
![Page 4: SCJ and EV3 Robots Leadership Election. Background Safety Critical Java – A safety critical programming model in Java EV3 mindstorms Lego Robot – A robot.](https://reader036.fdocuments.us/reader036/viewer/2022082713/5697bfdf1a28abf838cb27ce/html5/thumbnails/4.jpg)
Implementation
We carried out:– 2 soft architecture solutions
• Sequential• Concurrent
– 2 network protocols• TCP (connection oriented, reliable network)• UDP (connectionless)
– 3 programming models• Single mission• Multi missions• Nested missions
![Page 5: SCJ and EV3 Robots Leadership Election. Background Safety Critical Java – A safety critical programming model in Java EV3 mindstorms Lego Robot – A robot.](https://reader036.fdocuments.us/reader036/viewer/2022082713/5697bfdf1a28abf838cb27ce/html5/thumbnails/5.jpg)
Different Software Architecture Solutions
• “Sequential” Architecture– Application consists of a single periodic event handler to implement the protocol– But needs multiple managed threads to handle the network connection– Single Mission– TCP
• Concurrent Architecture– Each thread is responsible for a specific task (e.g. send/receive state, execute the
election protocol).– Multi missions and nested missions. – TCP and UDP
![Page 6: SCJ and EV3 Robots Leadership Election. Background Safety Critical Java – A safety critical programming model in Java EV3 mindstorms Lego Robot – A robot.](https://reader036.fdocuments.us/reader036/viewer/2022082713/5697bfdf1a28abf838cb27ce/html5/thumbnails/6.jpg)
Sequential Architecture Code Explanation
![Page 7: SCJ and EV3 Robots Leadership Election. Background Safety Critical Java – A safety critical programming model in Java EV3 mindstorms Lego Robot – A robot.](https://reader036.fdocuments.us/reader036/viewer/2022082713/5697bfdf1a28abf838cb27ce/html5/thumbnails/7.jpg)
Connector
![Page 8: SCJ and EV3 Robots Leadership Election. Background Safety Critical Java – A safety critical programming model in Java EV3 mindstorms Lego Robot – A robot.](https://reader036.fdocuments.us/reader036/viewer/2022082713/5697bfdf1a28abf838cb27ce/html5/thumbnails/8.jpg)
Listener
![Page 9: SCJ and EV3 Robots Leadership Election. Background Safety Critical Java – A safety critical programming model in Java EV3 mindstorms Lego Robot – A robot.](https://reader036.fdocuments.us/reader036/viewer/2022082713/5697bfdf1a28abf838cb27ce/html5/thumbnails/9.jpg)
Elector – The Sequential election procedure
![Page 10: SCJ and EV3 Robots Leadership Election. Background Safety Critical Java – A safety critical programming model in Java EV3 mindstorms Lego Robot – A robot.](https://reader036.fdocuments.us/reader036/viewer/2022082713/5697bfdf1a28abf838cb27ce/html5/thumbnails/10.jpg)
Demonstration 1
The Sequential Architecture with 3 robots– Robot Behavior:• Step forward if a robot becomes a leader• Step backward if a robot becomes a follower or be turned off• Do nothing if its state is not changed• Shut down (a simulation of turn off) the program if its “Back” button is
pressed
![Page 11: SCJ and EV3 Robots Leadership Election. Background Safety Critical Java – A safety critical programming model in Java EV3 mindstorms Lego Robot – A robot.](https://reader036.fdocuments.us/reader036/viewer/2022082713/5697bfdf1a28abf838cb27ce/html5/thumbnails/11.jpg)
However, the robots looks like zombies in Such movements )-: …
![Page 12: SCJ and EV3 Robots Leadership Election. Background Safety Critical Java – A safety critical programming model in Java EV3 mindstorms Lego Robot – A robot.](https://reader036.fdocuments.us/reader036/viewer/2022082713/5697bfdf1a28abf838cb27ce/html5/thumbnails/12.jpg)
EV3 Command and Follow Feature
• A EV3 command protocol is introduced• A command decoder is implemented.
• Each robot has a EV3 command decoder– The leader will send commands to followers– Followers decode the commands and then execute them.
• Two Architectures are implemented with this feature– The concurrent single mission architecture– The “sequential” architecture
![Page 13: SCJ and EV3 Robots Leadership Election. Background Safety Critical Java – A safety critical programming model in Java EV3 mindstorms Lego Robot – A robot.](https://reader036.fdocuments.us/reader036/viewer/2022082713/5697bfdf1a28abf838cb27ce/html5/thumbnails/13.jpg)
Demonstration 2
The Concurrent Architecture with “command and follow” feature– Mission: Imitate the leader• Each robot may have a heart of leader .
– Robot Behavior:• The leader has a set of movements.• After each movement, all the followers will move exactly as the leader did.
![Page 14: SCJ and EV3 Robots Leadership Election. Background Safety Critical Java – A safety critical programming model in Java EV3 mindstorms Lego Robot – A robot.](https://reader036.fdocuments.us/reader036/viewer/2022082713/5697bfdf1a28abf838cb27ce/html5/thumbnails/14.jpg)
Thank you!