Giter Club home page Giter Club logo

clutter_planning's Introduction

Robotic Manipulation Planning in Cluttered Environments

This repository contains the source code for the MECH3895 3rd year project "Robotic Manipulation Planning" at the University of Leeds.

Dependencies

Development was done using ROS Melodic on Ubuntu 18.04.

Required

  • Eigen3
  • OMPL (from source or ROS)
  • Flexible Collision Library (FCL)
  • Gazebo
  • TRAC_IK

NOTE: Other dependency ROS packages should already be available through a normal desktop install, but you may encounter a missing dependency error for the effort-joint-controller package. If so, then install it manually using:

$ sudo apt-get install ros-<distro>-effort-controllers

Replace <distro> with the ROS distro that is installed.

Optional

These are only for plotting the solution paths if needed.

  • gnu plot
    OR
  • Matplotlib

Parameters

There are two parameters files, one for Gazebo and one for the planner.

Gazebo Parameters

  • gazebo/static_objects - string array containing which objects are to be considered static, these will be displayed in red in Rviz.
  • gazebo/pub_arm_geom - bool to trigger visualisation of the Kinova's collision boxes in Rviz. (purely visual, doesn't affect anything)
  • gazebo/surface - the name of the surface that is being worked, this is set during launch. (Check the demo section for details on launching)

Planner Parameters

  • planner/name - name of the sampling motion planner to be used.
  • planner/global_timeout - total timeout for planning + execution time in clutter.
  • planner/timeout - timeout duration for the planner.
  • planner/path_states - number of states to be interpolated in generated paths.
  • planner/save_path - bool to trigger saving of solution paths in paths directory.
  • planner/propagate_push - bool to enable/disable validation of push actions by propagating arm and object states.
  • planner/use_grasping - bool to enable/disable grasping actions.
  • planner/fix_grasp_pose - bool to enable/disable changing of grasp orientation when needed.
  • kinematics_solver/type - solve type for the TRAC_IK solver.
  • kinematics_solver/timeout - solver timeout duration.

Visualisation

Rviz

An Rviz node is used to visualise the data that is being used (such as object geometries) and processed data (planner paths).

The paths are visualised by arrows. Each arrow indicates a waypoint in the path and its pose is the same as the end-effector pose for that waypoint (the arrows point in the z-axis direction of the end-effector as this is the axis that indicates the pointing direction).

When planning in clutter, the arrows have different colour due to the path being divided into sub-paths for different actions (move, push, reset etc.).

Additionally, the goal object is displayed in blue, and the final goal state for the path(s) is displayed with a black point.

NOTE: The markers will not appear again if unchecked in Rviz, this is because they are published once per plan.

An example is shown below.
rviz_gazebo_img

Gazebo Geometries Plugin

This is a world plugin that was made to obtain collision geometries of all the objects. The geometries are all obtained as box shapes even if the object itself is not a box, this is to simplify the collision detection process. The geometries are visualised in Rviz by this plugin.

The plugin attempts to get Object Oriented Bounding Boxes (OOBB), if it is unable to, Axis Aligned Bounding Boxes (AABB) are obtained instead.

Check the plugin folder for more information on its functionality.

Running a Demo

Building

To run a demo, first clone the repo into a catkin workspace, make sure your terminal is in the src directory:

$ git clone https://github.com/moustafa-m/clutter_planning.git

Now build:

$ cd .. && catkin_make && source devel/setup.bash

If using the Catkin Tools package:

$ catkin build planner_proj && source ../devel/setup.bash

Gazebo

To launch Gazebo, use:

$ roslaunch kinova_gazebo robot_launch.launch

A Gazebo and Rviz windows should popup.

If desired, you can pass in a world argument to launch a different scene from the worlds folder. The default is kinova_table.

$ roslaunch kinova_gazebo robot_launch.launch world:=kinova_cabinet surface:=cabinet_link_middle_plate

for more info on obtaining surface names from Gazebo, check the gazebo_scene_randomiser_plugin README.
As a starting point you can use the below surface names for each world file in this repo.

  • kinova_table - small_table_link_surface (this is the default)
  • kinova_shelf - bookshelf_link_low_shelf
  • kinova_cabinet - cabinet_link_middle_plate

NOTE: if Gazebo models need to be installed, Gazebo node may not launch correctly. Gazebo will take some time to load as it is downloading required models, once loaded the arm will probably just fall due to controller timeout. Resolved by relaunching after Gazebo finishes downloading models and loads up.

Planner

Finally, run the planner using:

$ roslaunch planner planner.launch

The arm will not do anything until a planning request for a specific target is sent. To start planning for a target, use:

$ rosservice call /start_plan "target: 'object_name'" 

Replace object_name with the name of an object in Gazebo. This must be a non-static object. As a start use cylinder which is the green cylinder in the world files in this repo.

Alternatively, you can use the testing node to perform multiple runs:

$ roslaunch planner tester.launch num_runs:=number

Replace number with the number of runs you want to do.

NOTE: There is an issue that occurs when the automated tester resets the joint configuration of the Kinova. There is currently no handling of errors from the joint trajectory controller. So, if the arm collides with an object that blocks its movement, the controller exits with an error while the Kinova is still in collision. This causes the tester to think that the Kinova is back at the desired configuration and then start a planning request. This will cause the planner to immediately return a failure most of the time since the Kinova is at an invalid state and hence, the runs are invalidated.

Third Party Packages

All third party licenses can be found in their respective folders in this repository and their original repositories linked below.

gazebo_grasp_plugin and gazebo_version_helpers

Cloned from gazebo-pkgs repo by Jennifer Buehler. The master branch was cloned, commit baf0f033475c3a592efb0862079f3ff8392cadf6.

The grasp_plugin package is used as a workaround to limitations in Gazebo for grasping operations (objects tend to slip/get pushed away when a grasp is attempted). Adding very high friction to the Kinova fingers is also a workaround, although objects may seem to "stick" to the fingers during interactions that are not necessarily grasps. Another change was done to the Kinova description files regarding the finger tips is explained in the next section.

Kinova packages

The kinova_control, kinova_description, and kinova_gazebo packages are from the official kinova-ros package by Kinova Robotics. The master branch was cloned, commit 99ac039028855eb9c1000a9c51b9c1544d5ef446.

Changes to Jaco2 Models

Finger Tips For All Models

The Kinova's finger tips in the description files have been changed to be a fixed joint and disabled in the controller configs.

The joints would sporadically move when a grasp is attempted and often resulted in the grasp plugin not working correctly and the object being pushed away regardless of set friction values.

A file was made to add custom friction values to both parts of the finger sets as well.

To use these friction values, launch Gazebo with the finger_friction argument as shown below:

$ roslaunch kinova_gazebo robot_launch.launch finger_friction:=true

6-DoF Spherical Wrist Jaco

The P gain for joint 6 on these models was reduced to 200 from 500. This is due to the joint shaking uncontrollably sometimes.

clutter_planning's People

Contributors

moustafa-m avatar

Watchers

 avatar

Forkers

nhiemth1985

clutter_planning's Issues

Refactoring class hierarchies

Currently controller class is the main class that interfaces with other classes however the planner class would benefit from having the manipulator to use the IK and FK methods in the state validity.

Passing the manipulator class by pointer would be messy. Making the planner class the main class and refactoring the controller class to be interfaced by the planner class might be a better option.

Spherical 6 DoF Jaco arm shaking uncontrollably

When the last 3 joints (J4, J5, J6) of the spherical 6 DoF Jaco (j2s6s300) are set to position {PI/2, PI/2, PI}, joint 6 shakes a lot.
Any trajectory sent to the arm is not executed when this happens.

/gazebo/model_states centre points are not the object centres

NOTE: This was encountered in early November. It is put here for future reference and documentation purposes.

The positions obtained from /gazebo/model_states are not the object's centres but are instead the position of the link which is not necessarily at the true object centre.

This results in the arm attempting to grasp the object from awkward positions like the bottom of a cup/can rather than the middle.

Grasping actions to relocate blocking objects

The planner is limited to open tabletop surfaces due to it only planning push actions. It will fail in a bookshelf/cabinet style surface due to it not being able to plan push actions near the inner walls.

A grasp action can be attempted to relocate the object and this will allow for clutter clearing in those surfaces.

Arm follows path point by point - motion not smooth

The current trajectory sent to the arm has zero velocity and acceleration at each waypoint, so the arm does not follow the path smoothly and stops at each waypoint.

A trajectory generation method will need to be implemented to compute the velocities and accelerations at each waypoint.

Object sliding off/pushed away when grasp is attempted

NOTE: This issue was first encountered in mid-late November. It is put here for future reference and documentation purposes.

Whenever the Kinova attempts to pick up an object, the object tends to slide off or get pushed away from gripper when the fingers close. Upon looking into this, I noticed it was a common issue in Gazebo and there were multiple suggestions on how to overcome it, with varying degrees of success.

Identification of suitable drop locations

Objects that are grasped are dropped off on the ground to clear a path. The planner should use information about the surface it is working on to find a suitable area to drop these objects rather than simply dropping them off.

Kinova joint angles out of -PI-PI range

NOTE: This issue was first encountered in early November during the project's start, it has not occurred again yet. It is put here for future reference and documentation purposes.

The Kinova's joint angles are stated to be at values out of the expected -PI-PI range (e.g. -157 rad was given for joint 7 for the j2s7s300). The joint states were monitored from /j2s7s300/joint_states although this was also observed with the 6 DoF Jaco arms.

These wrong joint angles would cause the arm to do multiple revolutions to get back in the correct range once the IK solution is found.

Cause of issue unknown, but resetting all the nodes as well as the ROS master fixes it.

Use of online planning for clutter clearing

Current implementation fails whenever the world state deviates from what it was during planning. Objects may not be pushed correctly, target may deviate from its original pose etc.

An online planning approach where each action planned and executed before the next will allow the planner to update its information about the world state and target object state and plan new tasks accordingly.

Planner should be able to change grasp orientation

Current constraint of keeping the gripper parallel to the operating surface limits the planner when working in confined spaces.

The planner should attempt to change the grasping pose if it is able to find a valid one.

Model collision not accessible - requires plugin

NOTE: This was encountered in early November. It is put here for future reference and documentation purposes.

To integrate obstacle avoidance into OMPL, the collision geometries for the models in the world are needed, however they are not attainable through the default topics and services that Gazebo provides. A plugin will be needed to obtained these.

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.