Skip to content

Latest commit

 

History

History
115 lines (96 loc) · 5.29 KB

README.md

File metadata and controls

115 lines (96 loc) · 5.29 KB

RobotDataCollectionFramework

This repository contains all file needed to run a framework to do data collection using ROS and Gazebo

System Requirements

Software Version
OS Ubuntu 20.04
ROS Noetic Ninjemys
Python 3.8.10
Gazebo 11.10.2

Installation

Install ROS

Following the ubuntu install of ROS Noetic

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt install curl -y
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
sudo apt update
sudo apt install ros-noetic-ros-base -y
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential -y
sudo rosdep init && rosdep update

Install catkin tools

wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
sudo apt update
sudo apt-get install python3-catkin-tools -y

Install this package and requirements

sudo apt install ros-noetic-moveit ros-noetic-controller-interface ros-noetic-control-toolbox ros-noetic-eigen-conversions ros-noetic-gazebo-ros ros-noetic-controller-manager ros-noetic-tf-conversions ros-noetic-robot-state-publisher ros-noetic-rqt ros-noetic-rqt-controller-manager ros-noetic-rqt-publisher ros-noetic-rqt-image-view ros-noetic-rqt-graph ros-noetic-gazebo-plugins ros-noetic-gazebo-ros-control ros-noetic-gazebo-ros-pkgs ros-noetic-robot-mechanism-controllers ros-noetic-joint-state-publisher ros-noetic-joint-state-controller ros-noetic-transmission-interface ros-noetic-position-controllers ros-noetic-joint-trajectory-controller ros-noetic-franka-description -y
mkdir -p ~/catkin_ws/src 
cd ~/catkin_ws/src
git clone https://github.com/ros-industrial/universal_robot.git 
git clone https://github.com/fzi-forschungszentrum-informatik/cartesian_controllers.git
git clone https://github.com/JenniferBuehler/gazebo-pkgs.git
git clone https://github.com/JenniferBuehler/general-message-pkgs.git
git clone https://github.com/shadow-robot/smart_grasping_sandbox.git
git clone https://github.com/cu-asl/robot_data_collection_framework.git
cd ~/catkin_ws
catkin build
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc
roscd ur5_data_collect_fw/scripts
chmod +x *

Install python3 library

sudo apt install python3-pip -y
pip3 install pandas psutil urdfpy

Demo

Use run_loop.py with the following arguments

-task : selecting robot, robot's task and controller

        1 (default) - UR5 peg in hole with joint trajectory controller

        2 - UR5 peg in hole with cartesian compliance controller

        3 - UR5 pick and place with joint trakectory controller

        4 - Panda peg in hole with joint trajectory controller

-open : path (relative to ur5_data_collect_fw) to the location of xml file of items to spawn

        default - config/item_spawn.xml

-num_open : number of xml files to open from folder in -open

        default - 0 (all config)

-timeout : time to stop one loop in seconds

        default - 300

Ex.1 UR5 Peg in Hole with Joint Trajectory Controller

Execute the following Commands

roscd ur5_data_collect_fw/scripts
python3 run_loop.py -task 1 -open config/world_random_peg/1 -timeout 60 -num_open 3

Result while running

Gazebo will be opened and the simulation of peg inserting to a hole will run

Result after the program is finished

35 files should be created in the newest folder (highest number) in ur5_data_collect_fw/rec

Ex.2 UR5 Pick and Place with Joint Trajectory Controller

Execute the following Commands

roscd ur5_data_collect_fw/scripts
python3 run_loop.py -task 3 -open config/world_random_pick/1 -timeout 240 -num_open 3

Result while running

Gazebo will be opened and the simulation of picking and placing objects will run

Result after the program is finished

34 files should be created in the newest folder (highest number) in ur5_data_collect_fw/rec

Expected Error

There are 10% chance that output as video or snapshot might not be generated due to the error of the recording program

If want to stop the program

  1. ctrl + z at the terminal running run_loop.py
  2. In terminal, type ps aux | grep roslaunch
  3. Kill the second process from the last