Skip to content

xiaosnowqiang/Matlab_ROS_PickPlace

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Matlab_ROS_PickPlace

Pick & Place application by integrating Matlab & ROS

You can also access the summary of the application from MATLAB File Exchange.

Demo Video

スクリーンショット 2019-07-18 01 12 01 )

Configuration Overview

Overview

Usage

  1. Turn off all anti-virus software and firewalls before running
  2. Install ROS Kinetic Kame + Gazebo v7 on Ubuntu Linux 16.04 (or VMware etc)
  3. Create catkin workspace in home directory etc
$ mkdir ~/catkin_ws_motomini
$ mkdir ~/catkin_ws_motomini/src
$ cd ~/catkin_ws_motomini/src
$ catkin_init_workspace
$ git clone https://github.com/ntl-ros-pkg/motoman_apps.git
$ cd motoman_apps
$ sh install.sh
$ source ~/catkin_ws_motomini/devel/setup.bash
  1. Execute XACRO to generate URDF (convert COLLADA (.dae) to STL)
$ cd ~/catkin_ws_motomini/src/motoman_pkgs/motoman_robot/motoman_description
$ rosrun xacro xacro --inorder motomini_with_gripper.urdf.xacro > ~/motomini_with_gripper.urdf
$ sudo apt install openctm-tools
$ find . -name '*.dae' | sed 's/.dae$//' | xargs -i ctmconv {}.dae {}.stl    
 # (However, since some COLLADA files are not converted correctly, those with a capacity of 0 are converted manually to STL using Blender etc.) 
$ sed -i 's/.dae/.stl/g' ~/motomini_with_gripper.urdf 
  1. Copy one file and one folder under the ROSFiles folder for MATLAB (If you get files from Ubuntu to Windows, use WinSCP etc.)
    • ~/motomini_with_gripper.urdf
    • ~/catkin_ws_motomini/src/motoman_pkgs/motoman_robot/motoman_description
  2. Launch the Motomini simulation environment
$ source ~/catkin_ws_motomini/devel/setup.bash
$ roslaunch motoman_mathworks_apps motomini_picking_demo_gazebo_autorun.launch
  1. Start MATLAB R2019a or later
  2. Replaced the built-in Indigo message with Kinetic
    1. Install "Robotics System Toolbox Interface for Custom Messages" from Add-on Explorer.
      • Add-on Explorer is started with the following command.
        >> roboticsAddons
    2. Download the gazebo_msgs package from below
    3. Extract to custommsg under the ROSFiles folder
      • ROSFiles/custommsg/gazebo_msgs
      • ROSFiles/custommsg/gazebo_msgs/msg
      • ROSFiles/custommsg/gazebo_msgs/srv
      • ROSFiles/custommsg/gazebo_msgs/package.xml
    4. Run rosgenmsg in MATLAB
      >> rosgenmsg(fullfile(pwd,'ROSFiles','custommsg'))
    5. Edit the javaclasspath.txt file according to the message displayed on the command line.
      • Put a "before" token at the beginning of the line to use the new one instead of the existing JAR file.
        <before>
        c:\Yaskawa_MotoMini\ROSFiles\custommsg\matlab_gen\jar\gazebo_msgs-2.5.8.jar
      • Add to MATLAB path as below
        >> addpath(fullfile(pwd,'ROSFiles','custommsg','matlab_gen','msggen'))
        >> savepath
    6. Restart MATLAB
    7. Delete the previously generated file and regenerate it
      >> rmdir(fullfile(pwd,'ROSFiles','custommsg','matlab_gen','msggen','+robotics','+ros','+custom','+msggen','+gazebo_msgs'), 's')
      >> rosgenmsg(fullfile(pwd,'ROSFiles','custommsg'))
  3. Run startupDemo.m in demo folder (PickAndPlaceDemo)
  4. Click "MATLAB / Simulink: Pick & Place Application" in the browser
  5. When showCompleteDemo.m opens, change the IP address on line 14 to the IP address of the machine on which Ubuntu 16.04 is installed
  6. Open the mainController Simulink model below in the command window
>> open_system('mainController');
  1. Run showCompleteDemo.m
  2. Execute with Simulink execution button of mainController, which invoke pick and place

Required Toolbox

  • MATLAB R2019a
  • Robotics System Toolbox
  • Image Acquisition Toolbox
  • Image Processing Toolbox
  • Computer Vision Toolbox
  • Statistics and Machine Learning Toolbox
  • Deep Learning Toolbox
  • Reinforcement Learning Toolbox
  • Simulink
  • Stateflow
  • Simscape
  • Simscape Multibody
  • Optimization Toolbox
  • Global Optimization Toolbox
  • Parallel Computing Toolbox
  • MATLAB Coder
  • GPU Coder
  • Simulink Coder
  • Embedded Coder
  • Aerospace Toolbox
  • Aerospace Blockset
  • Audio Toolbox

About

Pick & Place application by integrating Matlab & ROS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • MATLAB 82.3%
  • HTML 16.3%
  • CMake 1.3%
  • M 0.1%