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
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
- Download the VMWare Workstation version for your OS and install it. Don't forget to select the use non comercial version when installing.
- Download the file with the virtual machine and unzip.
- 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
- Download Virtual Box version for your OS and install it (to use virtual box in full screen, install Guest additions.
- Follow the same step for VMWare.
- Set the network as NAT.
- Open the virtual machine and start it.
For a complete installation guide, see Mathworks page.
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.- Create a new ROS workspace or use a previous.
- 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.
- 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
- Get the robocup packages from virtual machine file.
- Extract the file.
- Download and install VMWare Workstation.
- 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
orlibaio1
installed. - 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
- Unmount the .vmdk file
sudo vmware-mount -X sudo rm -rf /mnt/vmdkfile
- Install all the necessary dependencies with the next command:
rosdep install --from-paths src --ignore-src -y
- Build the packages (
catkin build
if use catkin tools).Don't forget source the devel/setup.bash file in the ROS workspace.
- 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.
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
sense -> estimate enviroment -> segment -> identify->decide-> move -> repeat
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
- message type: sensor_msgs/Image
- /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