/csc7135_proj_sp24

Repository for CSC 7135 Software Engineering project taught by Professor Umar Farooq at LSU in Spring 2024

Primary LanguageC++

Architectural Bug Detection and Analysis in ROS-based Mobile Manipulator Projects Using ROSDiscover

This repository contains the ros workspace to emulate usage of ROSDiscover, a static analysis tool that builds upon ROS 1's core API and ACME style rule checking to detect architectural bugs in two C++ ROS 1 packages that builds upon various topics and messages commonly used in mobile manipulator projects. ROSDiscover depends upon ROSWire packaged to read and interact with ROS Systems packaged as a Docker image Script used for this experiment can be found here csc7135_rosdiscover_exp. A copy of ROSDiscover paper and our report writeup is available in the report_papers directory. References to some useful commands are compiled in the COMMANDS.md file

Summary

The two test packages and key results from this report are shown below

image

image1

Test equipment

  • Ubuntu 20.04 and ROS Noetic full desktop
  • Computer with Ryzen 5600X with 16Gb RAM

Setup

  • Install pipenv if you don't have it yet

ROSDiscover and ROSWire

  • cd ~/Documents and git clone rosdiscover

  • cd into rosdiscover and then git clone roswire

  • cd back ino rosdiscover and activate the shell with pipenv shell

  • Install rosdiscover with pip install -e .. This may cause failure with roswire.

  • Now cd into roswire and install it pip install roswire

  • cd back to rosdiscover and test installation with rosdiscover --help

  • Intall the following dependencies in the host machine

    • Docker for Ubuntu and optionally complete post-installation steps
    • Catkin build tools: https://catkin-tools.readthedocs.io/en/latest/installing.html
    • Java: sudo apt install default-jre

Dataset overview

Section 4 in the report details the experiment and dataset used. A brief summary of the two packages are as follows:

  • Pkg 1 Subscription to wrong data type: FetchSensor means to send IMU data but erroneous sends wrong data format. This causes causes a run-time crash.

  • Pkg 2 Danling connectors: The idea is, an user defines an object to be manupulated. FetchRobotController receives image data and object detection data but does not send ACK to the FetchSensor. Thus, FetchSensor keeps repeating the same data over and over again.

Experimental Setup

Before setting up the experiment, git clone csc7135_rosdiscover_exp into the /Documents directory

Step 1: Creating Docker image

  • cd into csc7135_project cd ~
  • git clone this repository: git clone https://github.com/Mechazo11/csc7135_proj_sp24
  • cd into the directory: cd /csc7135_proj_sp24
  • Initialize workspace: catkin init
  • Run the convenience script to build and source the two test packages: ./build_source_pkgs.sh
  • Now build the Docker image: sudo docker image build -t csc7135_proj .
  • Verify csc7135_proj image exsists: sudo docker image ls

Experiment 1: Subscription to wrong data type

  • Move into the csc7135_rosdiscover_exp/scripts directory: cd ~/Documents/csc7135_rosdiscover_exp/scripts

  • Activate pipenv from ROSDiscover that you installed previously. An example command: ```. /home/az/.local/share/virtualenvs/rosdiscover-2-DhvFio/bin/activate`` `

  • Step 1: Derive groundtruth architecture: python3 observe-system.py pkg1

  • Step 2: Check the architecture against ACME rules: python3 check-architecture.py observed pkg1

Experiment 2: Dangling connectors

  • Step 1: Derive groundtruth architecture: python3 observe-system.py pkg2
  • Step 2: Check the architecture against ACME rules: python3 check-architecture.py observed pkg2

Limitations:

  • We could not get the rosdiscover-cxx-recover to compile and run. Hence Steps from RQ2 in the ROSDiscover paper, as described in README_ROSDISCOVER.rst file in csc7135_rosdiscover_exp does to not work.

  • Thus, the experimental results only uses dynamic approach in recovering run time architecture which may have some limitations.

  • If you are able to solve the rosdiscover-cxx-recover issue, please open a pull-request.

Resources / References

  1. Replication package

  2. Create ROS 1 C++ packages with catkin tools

  3. Create launch file within the package

  4. C++ ROS node design notes

  5. ROS Services

  6. An example of a ROS C++ package conforming to LARICS C++ standard

  7. Publisher and subscriber in one cpp class

  8. Using Class Methods as callbacks

  9. Usefulness of Docker

  10. Remapping topic names in ROS 1