09ubberboy90 / simple_ignition_ros2

This repository contains 2 tasks for Ignition fortress using ROS2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

simple_ignition_ros2

This repository contains 2 tasks for Ignition fortress

Stacking Task

Stacking Cube task This task involves one Franka Panda robotic arm randomly taking 5cm cubes from a table with 21 cubes arranged in a 7 * 3 grid and stacking them. It will stack them into 3 stacks of 5 cubes. The number of columns and the the heigt can be configured in moveit_controller.launch.py

Throw Task

Throw Task

For this, a Franka Panda arm will pick up a cube and throw it toward a pyramid made of 6 cubes. The arm will go as far back as it can and perform a throwing motion toward the ground in front of it. The ball will be released at 50% of the trajectory as it is the moment with the most amount of forces. The pyramid is placed such that a successful throw at full power will collapse it.

Instructions

Requirements

  • OS: Ubuntu 20.04 (Focal)
    • Other distributions might work (not tested).

Dependencies

These are the primary dependencies required to use this project.

Furthermore, the following packages are required.

  • ros_ign
    • Install/build a version based on the selected combination of ROS 2 release and Ignition version
  • ign_ros2_control
    • A working version has been added as a submodule. Newer version should work but are not tested.

Until ros2_controllers#225 is merged and released, ros2_controllers must be built from source in order to enable the use of effort command interface inside Ignition Gazebo. We are using ros2_controllers from SC-Robotics as a submodule

Building

Clone this repository and import submodules. Then install dependencies and build with colcon.

# Install pyquaternion
pip install pyquaternion
# Clone this repository and the submodules into your favourite ROS 2 workspace
git clone --recurse-submodules https://github.com/09ubberboy90/simple_ignition_ros2.git
# Install external dependencies via rosdep
rosdep install -r --from-paths src --ignore-src --rosdistro ${ROS_DISTRO}
# Export Ignition version
export IGNITION_VERSION=fortress
# Build with colcon
colcon build --merge-install --symlink-install --cmake-args "-DCMAKE_BUILD_TYPE=Release"

Sourcing

Before utilising this package, remember to source the ROS 2 workspace overlay.

source ${ROS2_WS}/install/local_setup.bash

Running

The following tasks can be either run as an independant launch or can be recorded

Stacking cube

ros2 launch simple_arm stack_cubes.launch.py

Throwing cube

ros2 launch simple_arm throw_cubes.launch.py

Recorder

The recorder can be launched with.

ros2 run sim_recorder run_recording 

It has some argument option to configure what the task will be

--help: Gives a list of arguments
-t, --throw: Start the Throwing Task
-i, --iteration: Number of run that should be performed
-s, --start: Start index in case some run need to be rerun after an interuption
--headless: runs without a GUI

The recorder will save the CPU and RAM usage in sim_recoder/data/{sim_name}. sim_name is created automatically based ont the simulation name ignition and on the arguments:

  • _gui is added if --headless is not passed
  • _throw is added if --throw is passed

An analysis of the run can be performed by running from the source of the repo

python ./sim_recorder/sim_recoder/grapher.py {name_of_folder}

With name of folder being the name of the folder you want to analyse

About

This repository contains 2 tasks for Ignition fortress using ROS2


Languages

Language:Python 64.3%Language:C++ 33.1%Language:CMake 2.6%