SlideShare a Scribd company logo
1 of 20
ARCHITECTURAL MODEL INFERENCE
FROM CODE
FOR ROS-BASED ROBOTICS SYSTEMS
Tobias Dürschmid, Christopher S.Timperley, David Garlan, Claire Le Goues
Carnegie Mellon University
Legend
05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems
Software
Component
Connector
Planning
Perception
Motor Controller
Port
Robotics Systems are Complex
Component-based Systems
2
Legend
05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems
Software
Component
Connector
Planning
Perception
Motor Controller
Port
Some Bugs Result from Incorrect
Composition of Software Components
[ready = true]
[ready = false]
10 Hz
[ready == true]
3
component waits
indefinitely
Good News: Model-BasedAnalysis can Find Bugs
05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems 4
b : C2
a : C2
d : C3
c : C1
𝒊𝟏
𝒊𝟐
Runtime Model
Queue size = 10
𝒐
+ +
C3
C2
C1
𝒊𝟏
𝒊𝟐
𝒐
Component Behavior Models Environment Model
Models the interface of
components (i.e., port) and
connectors
Models the states and
state transitions of
components, their input-
output relationship, and
timing properties
Models inputs from the
environment and how the
environment reacts to
actions of the system
Good News: Model-BasedAnalysis can Find Bugs
05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems 5
Model Checking / Simulation
(large amount of existing work and tools, e.g.,TLA+, Palladio, …)
inputs
b : C2
a : C2
d : C3
c : C1
𝒊𝟏
𝒊𝟐
Runtime Model
Queue size = 10
𝒐
+ +
C3
C2
C1
𝒊𝟏
𝒊𝟐
𝒐
Component Behavior Models Environment Model
C3
C2
C1
𝒊𝟏
𝒊𝟐
𝒐
Component Behavior Models
Bad News: Manual Model Inference is Expensive
05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems 6
Environment Model
b : C2
a : C2
d : C3
c : C1
𝒊𝟏
𝒊𝟐
Runtime Model
Queue size = 10
𝒐
+ +
“We are a big company.We really can’t do this for every project”
Dr. Ingo Lütkebohle (Bosch Research)
Problem Statement
05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems 7
How to automatically infer component models of components
Why is static architecture recovery hard?
Static recovery of architectural models is undecidable in general.
Architecture-defining code is scattered across the entire system.
written for the Robot Operating System (ROS)?
ros::Subscriber sub = nh.subscribe("t_sub", receive_initial);
ros::Publisher pub = nh.advertise("t_pub");
05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems 8
bool ready = false;
void receive_initial(const Message msg)
{ // subscriber callback
ready = true; // state transition
}
Observation: ROS Systems Implement
Component Ports using well-defined APIs
• subscribe creates a publish-subscribe input port
• advertise creates a publish-subscribe output port
• Key idea: Statically Recover API calls and their arguments
to reconstruct run-time architectural models
Our previous work ROSDiscover[1]
can Infer Run-Time Models Statically
05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems 9
Approach: Architectural recovery using static analysis of API calls +
rule checking
Tool available at GitHub: https://github.com/rosqual/rosdiscover
Results: >90% recovery of runtime architectural models
Detecting 8 of 19 of real-world bugs
[1] C. S.Timperley,T. Dürschmid, B. Schmerl, D. Garlan and C. Le Goues, "ROSDiscover: Statically
Detecting Run-TimeArchitecture Misconfigurations in Robotics Systems," ICSA 2022
Behavioral Models are Needed to Find
Many Architectural Composition Bugs
• Components waiting indefinitely for a message
• Deadlocks due to components being in incompatibles states
• Ignored inputs and message loss
• Publishing at unexpectedly high / low frequency
05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems 10
int main(int argc, char** argv)
{
ros::Subscriber sub = nh.subscribe("t_sub", receive_initial);
ros::Publisher pub = nh.advertise("t_pub");
const int local_LOOP_RATE = 10;
ros::Rate loop_rate(local_LOOP_RATE);
while (ros::ok()) // periodic loop
{
if (!ready)
{ // state condition
loop_rate.sleep();
continue;
}
pub.publish(msg); // message sending
loop_rate.sleep();
}
return 0;
}
05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems 11
bool ready = false;
void receive_initial(const Message msg)
{ // subscriber callback
ready = true; // state transition
}
Periodic Behavior
is Defined via
Rate Objects
Observation: ROS Systems Implement
Architectural Behavior using APIs & Idioms
Planning
[ready = true]
[ready = false]
10 Hz
[ready == true]
05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems 12
int main(int argc, char** argv)
{
ros::Subscriber sub = nh.subscribe("t_sub", receive_initial);
ros::Publisher pub = nh.advertise("t_pub");
const int local_LOOP_RATE = 10;
ros::Rate loop_rate(local_LOOP_RATE);
while (ros::ok()) // periodic loop
{
if (!ready)
{ // state condition
loop_rate.sleep();
continue;
}
pub.publish(msg); // message sending
loop_rate.sleep();
}
return 0;
}
bool ready = false;
void receive_initial(const Message msg)
{ // subscriber callback
ready = true; // state transition
}
State-based Behavior
is Defined via State
Variables
Observation: ROS Systems Implement
Architectural Behavior using APIs & Idioms
Observation: ROS Systems Implement
Architectural Behavior using APIs & Idioms
05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems 13
int main(int argc, char** argv)
{
ros::Subscriber sub = nh.subscribe("t_sub", receive_initial);
ros::Publisher pub = nh.advertise("t_pub");
const int local_LOOP_RATE = 10;
ros::Rate loop_rate(local_LOOP_RATE);
while (ros::ok()) // periodic loop
{
if (!ready)
{ // state condition
loop_rate.sleep();
continue;
}
pub.publish(msg); // message sending
loop_rate.sleep();
}
return 0;
}
bool ready = false;
void receive_initial(const Message msg)
{ // subscriber callback
ready = true; // state transition
}
Reactive Behavior is
Defined via Subscriber
Callbacks
Case Study Evaluation on Autoware.AI
• Autoware.AI is the largest open-source ROS system
and the most popular open-source framework for autonomous driving
05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems 14
API-Call-Guided Static Recovery can Have
High Accuracy for Behavioral Models
05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems 15
• Method: Compare to manually inferred handwritten models (106)
• Manually identify root cause of missed behaviors and classify as
engineering issue or limitation of the approach
• Results:
A Partial Model is BetterThan No Model
• Static Analysis can find known unknowns (“⊤”)
• Static Analysis points to the location in the code to recover
• Developers can replace ⊤ with correct value
05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems 16
State Conditions on Objects are Hard to
Infer Statically
Example of State-based Behavior ROSInfer cannot find:
lane_planner::vmap::VectorMap all_vmap;
void cache_point(const vector_map::PointArray& msg)
{
all_vmap.points = msg.data; // state change
update_values();
}
void update_values()
{
// complex state condition
if (all_vmap.points.empty() || all_vmap.lanes.empty() || all_vmap.nodes.empty())
return;
[...]
lane_planner::vmap::publish_add_marker([...]);
}
05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems 17
Summary
• Manual Model Inference is Expensive
• Assumptions about framework-specific APIs and idioms enable the
automatic inference of behavioral & structural component models for
ROS-based Robotics systems
• This work makes model-based analyses more accessible and practical
05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems 18
Planning
[ready = true]
[ready = false]
10 Hz
[ready == true]
Discussion Questions
• What other analyses are needed?
• What properties are important for roboticists?
• Do you use model-based analysis?
• If not:Why not?
• If so: How do you use it?
05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems 19
Lessons Learned
• Many components are designed to process input streams and publish processed
outputs like a pipes and filters architecture. These components are stateless and
usually produce a single output for each input that they receive.
• Components that maintain states are often components that start to publish
periodically after receiving a set of input messages that are used to initialize the
component
• Only a few components implement a complex state machine. Most explicit or implicit
state variables are booleans and only few components have more than three state
variables.
• While the state machines that model the behavior of the component might be less
complex, developers sometimes use more complex language features to express
them than would be necessary.This makes the code more extensible and easier to read
by human developers, but harder to analyze using static analysis.
05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems 20

More Related Content

Similar to Architectural Model Inference From Code For ROS-Based Robotics Systems

SAM-IoT: A Cross-Platform Communication Mechanism for ROS-Based Cyber-Physica...
SAM-IoT: A Cross-Platform Communication Mechanism for ROS-Based Cyber-Physica...SAM-IoT: A Cross-Platform Communication Mechanism for ROS-Based Cyber-Physica...
SAM-IoT: A Cross-Platform Communication Mechanism for ROS-Based Cyber-Physica...Brain IoT Project
 
An Integrated Prototyping Environment For Programmable Automation
An Integrated Prototyping Environment For Programmable AutomationAn Integrated Prototyping Environment For Programmable Automation
An Integrated Prototyping Environment For Programmable AutomationMeshDynamics
 
An ontology-based approach to improve the accessibility of ROS-based robotic ...
An ontology-based approach to improve the accessibility of ROS-based robotic ...An ontology-based approach to improve the accessibility of ROS-based robotic ...
An ontology-based approach to improve the accessibility of ROS-based robotic ...Vrije Universiteit Amsterdam
 
cReComp : Automated Design Tool for ROS-Compliant FPGA Component
cReComp : Automated Design Tool  for ROS-Compliant FPGA Component cReComp : Automated Design Tool  for ROS-Compliant FPGA Component
cReComp : Automated Design Tool for ROS-Compliant FPGA Component Kazushi Yamashina
 
Portfolio control version sn_v5
Portfolio control version sn_v5Portfolio control version sn_v5
Portfolio control version sn_v5Samuel Narcisse
 
Madeo - a CAD Tool for reconfigurable Hardware
Madeo - a CAD Tool for reconfigurable HardwareMadeo - a CAD Tool for reconfigurable Hardware
Madeo - a CAD Tool for reconfigurable HardwareESUG
 
The Download: Tech Talks by the HPCC Systems Community, Episode 16
The Download: Tech Talks by the HPCC Systems Community, Episode 16The Download: Tech Talks by the HPCC Systems Community, Episode 16
The Download: Tech Talks by the HPCC Systems Community, Episode 16HPCC Systems
 
MATLAB and Simulink for Communications System Design (Design Conference 2013)
MATLAB and Simulink for Communications System Design (Design Conference 2013)MATLAB and Simulink for Communications System Design (Design Conference 2013)
MATLAB and Simulink for Communications System Design (Design Conference 2013)Analog Devices, Inc.
 
Using advanced C# features in Sharepoint development
Using advanced C# features in Sharepoint developmentUsing advanced C# features in Sharepoint development
Using advanced C# features in Sharepoint developmentsadomovalex
 
Communication between matlab ros toolbox and ros network
Communication between matlab ros toolbox and ros networkCommunication between matlab ros toolbox and ros network
Communication between matlab ros toolbox and ros networkMuaHoaTieu
 
ROS - An open source platform for robotics software developers (lecture).pdf
ROS - An open source platform for robotics software developers (lecture).pdfROS - An open source platform for robotics software developers (lecture).pdf
ROS - An open source platform for robotics software developers (lecture).pdfAmine Bendahmane
 
Reactive Application Using METEOR
Reactive Application Using METEORReactive Application Using METEOR
Reactive Application Using METEORNodeXperts
 
Rpc Case Studies (Distributed computing)
Rpc Case Studies (Distributed computing)Rpc Case Studies (Distributed computing)
Rpc Case Studies (Distributed computing)Sri Prasanna
 
NGRX Apps in Depth
NGRX Apps in DepthNGRX Apps in Depth
NGRX Apps in DepthTrayan Iliev
 
Probe Debugging
Probe DebuggingProbe Debugging
Probe DebuggingESUG
 

Similar to Architectural Model Inference From Code For ROS-Based Robotics Systems (20)

SAM-IoT: A Cross-Platform Communication Mechanism for ROS-Based Cyber-Physica...
SAM-IoT: A Cross-Platform Communication Mechanism for ROS-Based Cyber-Physica...SAM-IoT: A Cross-Platform Communication Mechanism for ROS-Based Cyber-Physica...
SAM-IoT: A Cross-Platform Communication Mechanism for ROS-Based Cyber-Physica...
 
An Integrated Prototyping Environment For Programmable Automation
An Integrated Prototyping Environment For Programmable AutomationAn Integrated Prototyping Environment For Programmable Automation
An Integrated Prototyping Environment For Programmable Automation
 
An ontology-based approach to improve the accessibility of ROS-based robotic ...
An ontology-based approach to improve the accessibility of ROS-based robotic ...An ontology-based approach to improve the accessibility of ROS-based robotic ...
An ontology-based approach to improve the accessibility of ROS-based robotic ...
 
cReComp : Automated Design Tool for ROS-Compliant FPGA Component
cReComp : Automated Design Tool  for ROS-Compliant FPGA Component cReComp : Automated Design Tool  for ROS-Compliant FPGA Component
cReComp : Automated Design Tool for ROS-Compliant FPGA Component
 
Portfolio control version sn_v5
Portfolio control version sn_v5Portfolio control version sn_v5
Portfolio control version sn_v5
 
Madeo - a CAD Tool for reconfigurable Hardware
Madeo - a CAD Tool for reconfigurable HardwareMadeo - a CAD Tool for reconfigurable Hardware
Madeo - a CAD Tool for reconfigurable Hardware
 
The Download: Tech Talks by the HPCC Systems Community, Episode 16
The Download: Tech Talks by the HPCC Systems Community, Episode 16The Download: Tech Talks by the HPCC Systems Community, Episode 16
The Download: Tech Talks by the HPCC Systems Community, Episode 16
 
MATLAB and Simulink for Communications System Design (Design Conference 2013)
MATLAB and Simulink for Communications System Design (Design Conference 2013)MATLAB and Simulink for Communications System Design (Design Conference 2013)
MATLAB and Simulink for Communications System Design (Design Conference 2013)
 
Using advanced C# features in Sharepoint development
Using advanced C# features in Sharepoint developmentUsing advanced C# features in Sharepoint development
Using advanced C# features in Sharepoint development
 
Communication between matlab ros toolbox and ros network
Communication between matlab ros toolbox and ros networkCommunication between matlab ros toolbox and ros network
Communication between matlab ros toolbox and ros network
 
Defense
DefenseDefense
Defense
 
Defense
DefenseDefense
Defense
 
ROS - An open source platform for robotics software developers (lecture).pdf
ROS - An open source platform for robotics software developers (lecture).pdfROS - An open source platform for robotics software developers (lecture).pdf
ROS - An open source platform for robotics software developers (lecture).pdf
 
Reactive Application Using METEOR
Reactive Application Using METEORReactive Application Using METEOR
Reactive Application Using METEOR
 
Rpc Case Studies (Distributed computing)
Rpc Case Studies (Distributed computing)Rpc Case Studies (Distributed computing)
Rpc Case Studies (Distributed computing)
 
NGRX Apps in Depth
NGRX Apps in DepthNGRX Apps in Depth
NGRX Apps in Depth
 
Chembience
ChembienceChembience
Chembience
 
Mechatronics engineer
Mechatronics engineerMechatronics engineer
Mechatronics engineer
 
CityEngine-OpenDS
CityEngine-OpenDSCityEngine-OpenDS
CityEngine-OpenDS
 
Probe Debugging
Probe DebuggingProbe Debugging
Probe Debugging
 

Recently uploaded

EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 

Recently uploaded (20)

EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 

Architectural Model Inference From Code For ROS-Based Robotics Systems

  • 1. ARCHITECTURAL MODEL INFERENCE FROM CODE FOR ROS-BASED ROBOTICS SYSTEMS Tobias Dürschmid, Christopher S.Timperley, David Garlan, Claire Le Goues Carnegie Mellon University
  • 2. Legend 05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems Software Component Connector Planning Perception Motor Controller Port Robotics Systems are Complex Component-based Systems 2
  • 3. Legend 05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems Software Component Connector Planning Perception Motor Controller Port Some Bugs Result from Incorrect Composition of Software Components [ready = true] [ready = false] 10 Hz [ready == true] 3 component waits indefinitely
  • 4. Good News: Model-BasedAnalysis can Find Bugs 05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems 4 b : C2 a : C2 d : C3 c : C1 𝒊𝟏 𝒊𝟐 Runtime Model Queue size = 10 𝒐 + + C3 C2 C1 𝒊𝟏 𝒊𝟐 𝒐 Component Behavior Models Environment Model Models the interface of components (i.e., port) and connectors Models the states and state transitions of components, their input- output relationship, and timing properties Models inputs from the environment and how the environment reacts to actions of the system
  • 5. Good News: Model-BasedAnalysis can Find Bugs 05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems 5 Model Checking / Simulation (large amount of existing work and tools, e.g.,TLA+, Palladio, …) inputs b : C2 a : C2 d : C3 c : C1 𝒊𝟏 𝒊𝟐 Runtime Model Queue size = 10 𝒐 + + C3 C2 C1 𝒊𝟏 𝒊𝟐 𝒐 Component Behavior Models Environment Model
  • 6. C3 C2 C1 𝒊𝟏 𝒊𝟐 𝒐 Component Behavior Models Bad News: Manual Model Inference is Expensive 05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems 6 Environment Model b : C2 a : C2 d : C3 c : C1 𝒊𝟏 𝒊𝟐 Runtime Model Queue size = 10 𝒐 + + “We are a big company.We really can’t do this for every project” Dr. Ingo Lütkebohle (Bosch Research)
  • 7. Problem Statement 05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems 7 How to automatically infer component models of components Why is static architecture recovery hard? Static recovery of architectural models is undecidable in general. Architecture-defining code is scattered across the entire system. written for the Robot Operating System (ROS)?
  • 8. ros::Subscriber sub = nh.subscribe("t_sub", receive_initial); ros::Publisher pub = nh.advertise("t_pub"); 05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems 8 bool ready = false; void receive_initial(const Message msg) { // subscriber callback ready = true; // state transition } Observation: ROS Systems Implement Component Ports using well-defined APIs • subscribe creates a publish-subscribe input port • advertise creates a publish-subscribe output port • Key idea: Statically Recover API calls and their arguments to reconstruct run-time architectural models
  • 9. Our previous work ROSDiscover[1] can Infer Run-Time Models Statically 05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems 9 Approach: Architectural recovery using static analysis of API calls + rule checking Tool available at GitHub: https://github.com/rosqual/rosdiscover Results: >90% recovery of runtime architectural models Detecting 8 of 19 of real-world bugs [1] C. S.Timperley,T. Dürschmid, B. Schmerl, D. Garlan and C. Le Goues, "ROSDiscover: Statically Detecting Run-TimeArchitecture Misconfigurations in Robotics Systems," ICSA 2022
  • 10. Behavioral Models are Needed to Find Many Architectural Composition Bugs • Components waiting indefinitely for a message • Deadlocks due to components being in incompatibles states • Ignored inputs and message loss • Publishing at unexpectedly high / low frequency 05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems 10
  • 11. int main(int argc, char** argv) { ros::Subscriber sub = nh.subscribe("t_sub", receive_initial); ros::Publisher pub = nh.advertise("t_pub"); const int local_LOOP_RATE = 10; ros::Rate loop_rate(local_LOOP_RATE); while (ros::ok()) // periodic loop { if (!ready) { // state condition loop_rate.sleep(); continue; } pub.publish(msg); // message sending loop_rate.sleep(); } return 0; } 05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems 11 bool ready = false; void receive_initial(const Message msg) { // subscriber callback ready = true; // state transition } Periodic Behavior is Defined via Rate Objects Observation: ROS Systems Implement Architectural Behavior using APIs & Idioms Planning [ready = true] [ready = false] 10 Hz [ready == true]
  • 12. 05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems 12 int main(int argc, char** argv) { ros::Subscriber sub = nh.subscribe("t_sub", receive_initial); ros::Publisher pub = nh.advertise("t_pub"); const int local_LOOP_RATE = 10; ros::Rate loop_rate(local_LOOP_RATE); while (ros::ok()) // periodic loop { if (!ready) { // state condition loop_rate.sleep(); continue; } pub.publish(msg); // message sending loop_rate.sleep(); } return 0; } bool ready = false; void receive_initial(const Message msg) { // subscriber callback ready = true; // state transition } State-based Behavior is Defined via State Variables Observation: ROS Systems Implement Architectural Behavior using APIs & Idioms
  • 13. Observation: ROS Systems Implement Architectural Behavior using APIs & Idioms 05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems 13 int main(int argc, char** argv) { ros::Subscriber sub = nh.subscribe("t_sub", receive_initial); ros::Publisher pub = nh.advertise("t_pub"); const int local_LOOP_RATE = 10; ros::Rate loop_rate(local_LOOP_RATE); while (ros::ok()) // periodic loop { if (!ready) { // state condition loop_rate.sleep(); continue; } pub.publish(msg); // message sending loop_rate.sleep(); } return 0; } bool ready = false; void receive_initial(const Message msg) { // subscriber callback ready = true; // state transition } Reactive Behavior is Defined via Subscriber Callbacks
  • 14. Case Study Evaluation on Autoware.AI • Autoware.AI is the largest open-source ROS system and the most popular open-source framework for autonomous driving 05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems 14
  • 15. API-Call-Guided Static Recovery can Have High Accuracy for Behavioral Models 05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems 15 • Method: Compare to manually inferred handwritten models (106) • Manually identify root cause of missed behaviors and classify as engineering issue or limitation of the approach • Results:
  • 16. A Partial Model is BetterThan No Model • Static Analysis can find known unknowns (“⊤”) • Static Analysis points to the location in the code to recover • Developers can replace ⊤ with correct value 05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems 16
  • 17. State Conditions on Objects are Hard to Infer Statically Example of State-based Behavior ROSInfer cannot find: lane_planner::vmap::VectorMap all_vmap; void cache_point(const vector_map::PointArray& msg) { all_vmap.points = msg.data; // state change update_values(); } void update_values() { // complex state condition if (all_vmap.points.empty() || all_vmap.lanes.empty() || all_vmap.nodes.empty()) return; [...] lane_planner::vmap::publish_add_marker([...]); } 05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems 17
  • 18. Summary • Manual Model Inference is Expensive • Assumptions about framework-specific APIs and idioms enable the automatic inference of behavioral & structural component models for ROS-based Robotics systems • This work makes model-based analyses more accessible and practical 05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems 18 Planning [ready = true] [ready = false] 10 Hz [ready == true]
  • 19. Discussion Questions • What other analyses are needed? • What properties are important for roboticists? • Do you use model-based analysis? • If not:Why not? • If so: How do you use it? 05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems 19
  • 20. Lessons Learned • Many components are designed to process input streams and publish processed outputs like a pipes and filters architecture. These components are stateless and usually produce a single output for each input that they receive. • Components that maintain states are often components that start to publish periodically after receiving a set of input messages that are used to initialize the component • Only a few components implement a complex state machine. Most explicit or implicit state variables are booleans and only few components have more than three state variables. • While the state machines that model the behavior of the component might be less complex, developers sometimes use more complex language features to express them than would be necessary.This makes the code more extensible and easier to read by human developers, but harder to analyze using static analysis. 05/29/2023 Tobias Dürschmid:Architectural Model Inference from Code for ROS-based Robotics Systems 20

Editor's Notes

  1. Other kinds of bugs: deadlocks due to components being in incompatibles states, ignoring inputs, messages lost, wrong frequency Not a real bug Too much detail too early State change and initial state is confusing
  2. Dynamic approaches: Perfume, DiscoTect Env model doesn’t really have good access to ground truth Dr. Ingo Lütkebohle (Bosch Research): “We are a big company. We really can’t do this for every project”
  3. This problem is hard because: relationship between two unrelated ports
  4. Cut rosdiscover, add more on analyses
  5. Motivate periodic, reactive, and state=based behaviors More obviously grayed out Talk about this after state-based Move the component model to periodic
  6. Rq2 or claims on this slide
  7. Limitations of the approach are Shorten Eval and talk about ongoing work
  8. Croweded Increase adoption of model-based analysis
  9. Bugs in robotics systems such as autonomous cars, drones, or machines, can threated human life. Ensuring the safety of their behavior is critical to society9.1 crashes per million miles traveled
  10. Discuss the trade-off of implementing the analysis (pareto)