GripperManipulation Plug-in

GripperManipulation plug-in provides the pick-and-place motion planning for robot systems having parallel grippers. As for the grasp planning, we newly developed the grasp planner specialized for parallel grippers. The feature of this grasp planner is that the grasping posture can be calculated in real-time. Also, since we do not use the bounding box models, we can easily apply this method for complex shaped objects.

Basic Information

Planner Bar

If we introduce this plug-in, the Start button of Planner bar will be used for the grasp planning function of "this" plug-in "NOT" Grasp plug-in's one. Also, we have "INTENTION" tool bar. This bar is used to specify a part of the grasped object.

Tutorials

Planning Algorithm

To explain.

References

[1] K. Harada, T. Tsuji et al, "Grasp Planning for Parallel Grippers Considering Flexibility on its Grasping Surface", Proc. of IEEE Int. Conf. on Robotics and Biomimetics, 2011.

Modifying GripperManipulation Plugin to be an RT component

Attach a “receptacle” for the RT component to the plugin referred to as Choreonoid/extPlugin/graspPlugin/GripperManipulation.

Details on the original GripperManipulation

This is a graspPlugin plugin for the grasping plan intended for twin arm robots, with the following file configurations:
CMakeLists.txt: cmake definition file
GripperManipulationMain.cpp: Choreonoid plugin ManipPlugin class source
ManipBar.cpp: Choreonoid tool bar ManipBar class source
ManipBar.h: Choreonoid tool bar ManipBar class header
ManipController.cpp: grasping plan controller ManipController class source
ManipController.h: grasping plan controller ManipController class header
PRM: grasping plan data file directory

In order to make the structure of the program easier to see, GripperManipulationMain.cpp is renamed ManipPlugin. In addition, CMakeLists.txt is also modified and verified to ensure that it can be compiled.

Preparing the RT components skeleton with RTC Builder

In the preliminary preparation, the rtc directory is prepared under GripperManipulation, while GraspController.idl is also placed there.
Run Eclipse and set a new Eclipse project (a dummy project) in this rtc directory. Select “C++ Project” in the Wizard selection and set the respective items in the following manner.
Project name: GraspControllerRTC
Location (user’s working directory): /Choreonoid/extplugin/graspPlugin/GripperManipulation/rtc
Project type: Executable - Empty Project

Press the “Finish” button and a dialog box with the prompt, "Open C++ Perspective?" will be displayed. This can be closed.
The preliminary preparations are now complete. Open the RTC Builder Perspective with Eclipse. Click on the RT icon to open the RtcBuilder View and set the necessary information for each tab.
RTCBuilder_0.png

“Basic” tab

Module name: GripperManipulation
Module summary: Gripper Manipulation
Vendor name: AIST
Module category: TestInterface
Output Project GripperManipulationRTC (select the project that was prepared earlier).

Other items can be left with the default settings.
RTCBuilder-GripperManipulation.png

"Language and environment" tab

Select C++.

“Service port” tab

Press the Add Port button. A port called “sv_name” is created. Click on it with the mouse and display the Profile Setting screen on the right side. Set the port name to PlanStartPort and then press the Add Interface button to set the following information to the newly created interface.
PlanStart.png
Interface name: PlanStart
Direction: Required
IDL file: /home/asahi/workspace/Choreonoid/extplugin/graspPlugin/GripperManipulation/rtc/GraspController.idl
Interface type: GraspPlanStart (selectable item)
IDL path: /home/asahi/workspace/Choreonoid/extplugin/graspPlugin/GripperManipulation/rtc/
In the same way, create the port, ResultPort, and the interface, Result.
Interface name: Result
Direction: Provided
IDL file: /home/asahi/workspace/Choreonoid/extplugin/graspPlugin/GripperManipulation/rtc/GraspController.idl
Interface type: GraspPlanResult
IDL path: /home/asahi/workspace/Choreonoid/extplugin/graspPlugin/GripperManipulation/rtc/

Generate codes

The settings for the RTC Builder are now complete. Open the Basic tab again and press the Generate Code button to create the following files in Choreonoid/extPlugin/graspPlugin/GripperManipulation/rtc:
  • GraspControllerSVC_impl.cpp
  • GraspControllerSVC_impl.h
  • GripperManipulation.conf
  • GripperManipulation.cpp
  • GripperManipulation.h
  • GripperManipulationComp.cpp
  • GripperManipulationComp_vc8.vcproj
  • GripperManipulationComp_vc9.vcproj
  • GripperManipulation_vc8.sln
  • GripperManipulation_vc8.vcproj
  • GripperManipulation_vc9.sln
  • GripperManipulation_vc9.vcproj
  • Makefile.GripperManipulation
  • RTC.xml
  • copyprops.bat
  • user_config.vsprops
Follow the instructions on the screen and switch to C++ Perspective.
At this point, a series of settings are stored in RTC.xml and saved together. When changing the settings of the RT components, the import function of the Profile in the Basic tab of the RTC Builder can be used to recall these settings.

Compile rtc

Open the terminal, move to the GripperManipulation/rtc directory, then execute the following command.

 % omniidl -bcxx GraspController.idl 

GraspController.hh and GraspControllerSK.cc are generated. Next, execute make. It is necessary to specify the Makefile.
 % make -f Makefile.GripperManipulation

This generates GraspControllerSkel.cpp, GraspControllerStub.cpp, GraspControllerSkel.h, and GraspControllerStub.h (these do not go through the compilation process but can continue on unchanged).

Prepare the bridging class for the Choreonoid plugin and the RT components

Copy GraspRtcController.h and GraspRtcController.cpp from graspPlugin/GraspConsumer to GripperManipulation, then edit them.
Since it may be confused with ManipController.h(cpp), the file name is changed to ManipRtc.h(cpp).

Sample patch

A patch file that edits a series of files all at once was prepared as a sample.

 % svn co -r131 http://subaru.ait.kyushu-u.ac.jp/svn/grasp-plugin/trunk/graspPlugin/GripperManipulation

After checking out revision 131 of GripperManipulation, perform settings for RTC Builder and prepare ManipRtc.h(cpp), then download the patch file GripperManipulation_patch.txt, then execute the following command.
 % patch -p0 < GripperManipulation_patch.txt

This applies all changes simultaneously and the build can be performed immediately.
The following is a summary of the changes made using the patch file.

ManipRtc.h(cpp)

Changes the class name to ManipRtc (the refactoring function of Eclipse is useful, but care must be taken to ensure that the source, GraspConsumer, is not changed also!).
Change the part that includes GraspConsumer.h, GraspController.hh, and GripperManipulation.h under rtc. Change the type of comp from GraspConsumer * to ::GripperManipulation *. The parts that are the arguments of graspPlanResult and have become const GraspPlanResult, are all changed to ::GraspPlanResult. The identifier of the include guard is also changed to match the header and becomes MANIPRTC_H.
ManipPlugin.cpp
Add codes to start the RT components in the ManipPlugin::initialize method.
    virtual bool initialize() {
      //Robotics::SceneBodyManager* manager = Robotics::SceneBodyManager::instance();
      grasp::GraspController::instance(ManipController::instance());
      ManipRtc::instance()->RtcStart();
      //manage(manager->addSceneBodyFactory(create));

rtc/GripperManipulation.h

Change the class of grasp::ManipRtc to a friend class of GripperManipulation.
 using namespace RTC;
 namespace  grasp {
    class ManipRtc;
 }

 ...

 class GripperManipulation
  : public RTC::DataFlowComponentBase
 {
 public:
  friend class grasp::ManipRtc; 

rtc/GraspControlerSVC_impl.cpp/h

Since RTCBuilder outputs the arguments of the IDL data type as CORBA, but omniidl outputs the same data as ::CORBA, compiler errors occur when the types are different. For this reason, a declaration for the CORBA namespace-type argument is rewritten to ::CORBA, in order to match the output of omniidl. In addition, with regard to the argument for the method of GraspPlanResultSVC_impl class, the declaration for the GraspPlanStart name space-type argument is rewritten to GraspPlanResult (this may be a bug in RTCBuilder).

CMakeLists.txt

  • set(rtc-dir ./rtc) is added
  • include_directories(${rtc-dir}) is added
ManipRtc.cpp, ${rtc-dir}/GraspControllerSVC_impl.cpp, ${rtc-dir}/GripperManipulation.cpp, ${rtc­
dir}/GraspControllerSkel.cpp are added to sources.
  • ManipRtc.h, ${rtc-dir}/GraspController.hh, ${rtc-dir}/GraspControllerSVC_impl.h, ${rtc­dir}/GripperManipulation.h, ${rtc-dir}/GraspControllerSkel.h, ${rtc-dir}/GraspControllerStub.h are added to the headers.
  • -fPIC -O2 -I/usr/include -I/usr/include/rtm/idl -I. is added to add_definitions.
  • uuid dl pthread omniORB4 omnithread omniDynamic4 RTC coil is added to target_link_libraries.
  • Lines elseif(MSVC) to endif(UNIX), which are paired with if(UNIX), are deleted.

Build and verify movements

In the first instance, execute ccmake in the Choreonoid directory.

 % ccmake. 

Add GripperManipulation to GRASP_PLUGINS and execute configure and generate to prepare Makefile. Execute make and if lib/choreonoid-0.9/libCnoidGripperManipulationPlugin.so is built successfully, verify the movements.
Boot Choreonoid and the RT System Editor, then verify that GripperManipulation0|rtc exists under (host name)| host_cxt, which is under 127.0.0.1 in the NameServer tab. If this can be dragged and dropped into the System Diagram, the process has been completed successfully.
(However, if nothing happens when this is linked to other RT components, then continue on to the Section on Modify GripperManipulation to RT components and implement).
SystemDiagram_0.png