Giter VIP home page Giter VIP logo

operation_control's Introduction

operation_control

This is operation package in Ground Control Station (GCS) which is one of 6 packages in the ros2 evaluation workingspace. This experiment aims to evaluate the Quality of Service (QoS) in ROS2.

QoS_ROS2_2

List of packages

  1. px4_ros_com: is forked from PX4-ROS2 bridge and then add/edit to adapt the experiments.
  2. px4_msgs: is forked from ROS2 message definitions of the PX4 Pro ecosystem.
  3. bridge_msgs: includes bridge messages for communication between the companion computer and the Ground Control Station.
  4. operation_control: is the main package for GCS.
  5. image_tools: is forked from ROS2 foxy source code and then edit to adapt the experiments.
  6. launch_bringup: includes launch files in order to run required nodes in the companion computer and the Ground Control Station.

How to build

  • Install ROS2 Foxy
  • Install PX4
  • Install Fast DDS
  • Building ros2 evaluation working space
    1. Create a workspace directory using:
    mkdir -p ~/ros2_evaluation/src
    
    1. Clone 6 packages above px4_ros_com, px4_msgs, bridge_msgs, operation_control, image_tools, launch_bringup to the /src directory (the master branch is cloned by default):
    cd ~/ros2_evaluation/src
    git clone https://github.com/LeQuangHien/px4_ros_com
    git clone https://github.com/LeQuangHien/px4_msgs
    git clone https://github.com/LeQuangHien/bridge_msgs
    git clone https://github.com/LeQuangHien/operation_control
    git clone https://github.com/LeQuangHien/image_tools
    git clone https://github.com/LeQuangHien/launch_bringup
    
    1. Build the ros2_evaluation workingspace, remember source ros2 ws
    cd ..
    . ~/ros2_foxy/install/local_setup.bash
    colcon build --symlink-install --event-handlers console_direct+
    
    1. Sanity Check the Installation

How to run

Two PCs are needed to run this experiment. One for the companion computer and one for Ground Control Station(GCS). Above section "How to build" should be completed in both PCs. Both PCs should be in the same wireless network.

  1. In the companion computer
# Open a new terminal in the root of the PX4 Autopilot project, and then start a PX4 Gazebo simulation using:
make px4_sitl_rtps gazebo

# On a new terminal, source the ROS 2 workspace and then start the micrortps_agent daemon with UDP as the transport protocol:
source ~/ros2_evaluation/install/setup.bash
micrortps_agent -t UDP

# On the original terminal (System console of PX4 Gazebo) start the micrortps_client daemon with UDP:
micrortps_client start -t UDP

# Open a new terminal to launch drone nodes including offboard_control node and two nodes publishing images and sensor data (pick one of two below):
 source ~/ros2_evaluation/install/setup.bash
 
# The failsafe mode of the drone simulator is usually enabled in the beginning, so if you see the drone has not taken off, then Ctrl+C to end and then run the launch file again. Do it untill the drone has taken off. In my case, the drone will take off in the second time

# for default QoS polices
ros2 launch launch_bringup drone_default_qos.launch.py
# Or for best-effort QoS policies
ros2 launch launch_bringup drone_best_effort_qos.launch.py
  1. In the GCS
# Open a new terminal and start setpoint_advertiser node and two nodes receiving images and sensor data from drone using launch file (pick one of two below):
source ~/ros2_evaluation/install/setup.bash

# for default QoS polices
ros2 launch launch_bringup gcs_default_qos.launch.py
# Or for best-effort QoS policies
ros2 launch launch_bringup gcs_best_effort_qos.launch.py
  1. In the GCS
# Open a new terminal to observe published statistic data for "Setpoint":
ros2 topic echo /statistics_setpoint
# Open a new terminal to observe published statistic data for "Sensor":
ros2 topic echo /statistics_sensor
# Open a new terminal to observe published statistic data for "Image":
ros2 topic echo /statistics_image

# For data type in the statistics, please see the lookup table belowUnits: milliseconds
# Units: milliseconds

data_type

  1. Run ifconfig to get the interface for communicating between devices in the local network, here is "wlp2s0". Then simulate 1%-5% packet loss using "tc" in both the companion computer and the GCS
sudo tc qdisc add dev wlp2s0 root netem loss 1%  

# Remember to delete this by using: 
sudo tc qdisc delete dev wlp2s0 root netem loss 1%
  1. Observe the outputs in the statistic's terminals. Compare the results with and without packet loss, with and without "best_effort" QoS policy.

References

operation_control's People

Contributors

lequanghien avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.