Skip to content

Designing your Scenario

Bruce Allen edited this page May 21, 2020 · 33 revisions

Your scenario consists of your network topology and the messages that communicate across this topology. To define your scenario, identify the ROS2 messages that flow between robots and the network configuration of your swarm. Then construct a CSV scenario file for configuring and modeling this scenario.

Scenario File

Your CSV scenario file defines publishers and subscribers by role, defines robots by role, and defines the stations, links, and other network properties for your swarm. The file is broken into sectioins, where each section has a section title, section header, and scenario information for that section. Publishers, Subscribers, and Robots define the ROS2 messages and the roles the robots in your swarm will take on. The other sections define your network configuration and settings for Mininet-WiFi.

ROS2 Properties

  • Publishers - Defines publisher subscriptions by role. Also defines the QoS policy for publishing the subscription. Publisher entries have this format:

    Publisher, Role, Subscription, Frequency, Size, History, Depth, Reliability, Durability
    
  • Subscribers - Defines subscriber subscriptions by role. Also defines the QoS policy for subscribing to the subscription. Subscriber entries have this format:

    Subscriber, Role, Subscription, History, Depth, Reliability, Durability
    
  • Robots - Defines robot names and the role the robots will take:

    Robot, Name, Role
    

History, depth, reliability, and durability define the QoS policy, see https://index.ros.org/doc/ros2/Concepts/About-Quality-of-Service-Settings/. Here is the QoS syntax for scenario files:

  • History controls history depth. Modes are keep_all and keep_last. For keep_last, use Depth.
  • Depth defines history depth when History mode is keep_last.
  • Reliability regulates reliability of data received. Modes are reliable and best_effort. For reliable, DDS will track transmissions and attempt to repair lost transmissions. For best_effort, DDS will not track transmissions and will not attempt to repair lost transmissions.
  • Durability provides durability by transmitting previously transmitted data to readers that join late. Modes are transient_local and volatile.

Network Properties

  • Stations - Station definitions for each robot such as location for fixed-location stations:

    Station, Name, param=value, ...
    

    For example settings, see addStation in the examples in the mininet-wifi repository.

  • Links - Radio link information for the network link on each robot:

    Link, Name, param=value, ...
    

    For example settings, see addLink in the examples in the mininet-wifi repository.

  • Propagation Model - The radio signal propagation model:

    Propagation Model, param=value, ...
    

    See setPropagationModel in the examples in the mininet-wifi repository.

  • Mobility Model - The mobility model:

    Mobility Model, param=value, ...
    

    See setMobilityModel in the examples in the mininet-wifi repository.

    Alternative to Mobility Model, we can define start and stop points for individual robots using Start Mobility, Mobility, and Stop Mobility, see example usage in the mininet-wifi repository.

  • Plot Graph - How to plot the real-time mobility graph:

    Plot Graph, param=value, ...
    

    See plotGraph in the examples in the mininet-wifi repository.

Example

Here is the mininet_testbed's example swarm defined at ~/gits/mininet_testbed/scenarios/example1.csv. It defines one ground station that publishes odometry data and four red team robots that subscribe to odometry data:

# Publisher, Role, Subscription, Frequency, Size, History, Depth, Reliability, Durability
Publisher, GS, odometry, 10, 500, keep_last, 0, reliable, volatile

# Subscribers, Role, Subscription, History, Depth, Reliability, Durability
Subscriber, red_team, odometry, keep_last, 0, reliable, volatile

# Robot, Name, Role
Robot, R1, GS
Robot, R2, red_team
Robot, R3, red_team
Robot, R4, red_team
Robot, R5, red_team

# Station, Name, param=value, ...
Station, R1, range=100, position=0;0;0
Station, R2, range=100, position=1;0;0
Station, R3, range=100, position=0;1;0
Station, R4, range=100, position=-1;0;0
Station, R5, range=100, position=0;-1;0

# Link, Name, param=value, ...
Link, R1, cls=adhoc, intf=R1-wlan0, ssid=adhocNet, mode=g, channel=5, ht_cap=HT40+
Link, R2, cls=adhoc, intf=R2-wlan0, ssid=adhocNet, mode=g, channel=5, ht_cap=HT40+
Link, R3, cls=adhoc, intf=R3-wlan0, ssid=adhocNet, mode=g, channel=5, ht_cap=HT40+
Link, R4, cls=adhoc, intf=R4-wlan0, ssid=adhocNet, mode=g, channel=5, ht_cap=HT40+
Link, R5, cls=adhoc, intf=R5-wlan0, ssid=adhocNet, mode=g, channel=5, ht_cap=HT40+

Propagation Model, model=logDistance, exp=4
Plot Graph, min_x=-2, min_y=-2, max_x=2, max_y=2