Skip to content

Code for the RoboCup Autonomous Robot Manipulation(ARM) Challenge, which consist in the implementation of perception and control algorithms in MATLAB and Simulink to grasp and manipulate bottles and cans within a table to classify them into two bins.

License

Notifications You must be signed in to change notification settings

cychitivav/robocup_arm_challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RoboCup Autonomous Robot Manipulation Challenge

This repository contains the development of the RoboCup Autonomous Robot Manipulation(ARM) Challenge, which consist in the implementation of perception and control algorithms in MATLAB and Simulink to grasp and manipulate bottles and cans within a table to classify them into two bins. 1

Set-up

To start with the challenge it is necessary to install the ROS packages of the robot and the world of gazebo, this can be done in two ways:

Virtual machine If the configuration is done from Windows or you don't want to install ROS on Ubuntu (or other Linux distros), you can use the virtual machine provided by Robocup and Mathworks.
  • VMWare

    1. Download the VMWare Workstation version for your OS and install it. Don't forget to select the use non comercial version when installing.
    2. Download the file with the virtual machine and unzip.
    3. Finally, open the virtual machine and start it. When a window appears asking if you copied or moved the virtual machine, select I copied it.
  • VirtualBox

    1. Download Virtual Box version for your OS and install it (to use virtual box in full screen, install Guest additions.
    2. Follow the same step for VMWare.
    3. Set the network as NAT.
    4. Open the virtual machine and start it.

For a complete installation guide, see Mathworks page.

vm

When the virtual machine is started, you can start ROS open the file Example World 1.desktop (or Example World 2.desktop to run the second world) in the RoboCup Challenge folder located in the desktop, or launch the nodes with the following commands:

cd ~
./start-robocup-example-world-1.sh # or ...world-2.sh
Native installation In order to use the host computer resources in a better way, it is possible to install ROS(melodic or noetic) and the necessary packages to run the challenge simulation.
  1. Create a new ROS workspace or use a previous.
  2. Clone ros kortex packages in the src folder:
    cd src
    git clone https://github.com/Kinovarobotics/ros_kortex -b kinetic-devel
    git reset --hard 6970f5b

    It is necessary to clone the repository in the branch kinetic-devel and this version because the Robocup's packages are not compatible with the latest versions of this packages.

  3. Remove packages that are not needed and can cause conflicts:
    rm -rfv !("kortex_control"|"kortex_description"|"kortex_gazebo") # Remove all packages except kortex_control, kortex_description and kortex_gazebo
  4. Get the robocup packages from virtual machine file.
    1. Extract the file.
    2. Download and install VMWare Workstation.
    3. Open the virtual machine and sharing the files between host and guess, or use vmware-mount
      sudo mkdir /mnt/vmdkfile
      sudo vmware-mount <vm_folder_path>/ros_melodic_dashing_gazebov9.vmdk 1 /mnt/vmdkfile/

      Don't forget shutdown the virtual machine (do not suspend it) and have libaio or libaio1 installed.

    4. Copy the following folders from mnt/vmdkfile/home/user/catkin_ws/src to the src folder in your ROS workspace.
      • kortex_gazebo_camera
      • kortex_gazebo_depth
    5. Unmount the .vmdk file
      sudo vmware-mount -X
      sudo rm -rf /mnt/vmdkfile
  5. Install all the necessary dependencies with the next command:
    rosdep install --from-paths src --ignore-src -y
  6. Build the packages (catkin build if use catkin tools).

    Don't forget source the devel/setup.bash file in the ROS workspace.

  7. Run the launch file with the following command:
    roslaunch kortex_gazebo_depth pickplace.launch world:=RoboCup_1.world # or RoboCup_2.world

    If you have ROS noetic, you probably have problems with --in-order option in xacro when run the launch file, to fix it remove --in-order option in the line 40 of pickplace.launch in the kortex_gazebo_depth package.

native roslaunch

To launch ROS inside matlab inside you can use 'system' to run shell commands but ROS requieres some libraries so you need to link them as shown here status,cmdout] = system(['export LD_LIBRARY_PATH="LD_path";' 'roslaunch xyz.launch &' 'echo $!']); where the LD_path is a place holder for the path of the library that can be found by running in shell echo $LD_LIBRARY_PATH 2

be sure to kill all the ROS process that are running in the background you can use system('kill', cmdout) in matlab or the shell command killall -9 rosmaster

Warning: be weary that this last command can kill all other ROS instances

Notes

Algorith

sense -> estimate enviroment -> segment -> identify->decide-> move -> repeat

motion

get position

  • subscribe to rostopic: my_gen3/joint_states

set movement commands

  • rosaction: /my_gen3/gen3_joint_trajectory_controller/follow_joint_trajectory
  • message type: control_msgs/FollowJointTrajectory

image processing

img

  • message type: sensor_msgs/Image

depth

  • /camera/depth/points

Image Labeler Matlab App

first aproach consist in 3

To visualize the robot you can use rviz. changes were made to the kortex_realsense.xacro inside the package kortex_gazebo_depth in order to change the orientation and correctly display the point cloud.

export ROS_NAMESPACE=/my_gen3
rosrun rviz rviz -d  rviz/config.rviz

KINOVA Gen3 manipulator

robot manipulation function list

pointcloud

robot

References

Footnotes

  1. Robocup github Template

  2. roslaunch-on-matlab

  3. Matlab pick and place tutorial

About

Code for the RoboCup Autonomous Robot Manipulation(ARM) Challenge, which consist in the implementation of perception and control algorithms in MATLAB and Simulink to grasp and manipulate bottles and cans within a table to classify them into two bins.

Topics

Resources

License

Stars

Watchers

Forks

Languages