Up:[[Tutorial]]

If you have any question, please contact yoann.dutel@outlook.fr

*Introduction [#l64cca14]

The aim of this tutorial is to explain how to use KDL with ROS in SIGVerse.

With KDL, you could use an inverse kinematic solver. So, you could control the arm of a robot. 
KDL is not very accurate. So you musn't use this exmample to grasp an object on a table. But you can use this to have an iteraction with an human.
An other Inverse Kinematic Solver is in process of integration for SigVerse : IKFast.

We will show you a demonstration with an example in SIGVerse.

*Requirements [#f3d604ef]

- Ubuntu 32/64 bit PC. (Ubuntu installed on virtual machine is also file)
- SIGServer 2.2.2 or later
- SIGViewer 2.2.0 or later
- ROS : refer to this tutorial [[ROS integration]]
- KDL : refer to this page : http://wiki.ros.org/kdl

* Use the package [#f3d604ef]

** Download the package [#xc8790c9]

Clone the ROS package from github in your ROS workspace.
You can clone the entire repository by running :
 $ git clone https://github.com/SIGVerse/samples.git
Or you can get the source code here on Github : https://github.com/SIGVerse/samples/tree/master/KDL_ROS
Or you can get the source code here on Github : https://github.com/SIGVerse/samples/tree/master/Kinem_Sig_Ros

** Insert the environment [#q07862eb]

Include this xml file in the devel/lib directory of your ROS workspace :

#highlight(xml){{
<?xml version="1.0" encoding="utf-8"?>
<world name="myworld1">
  <gravity x="0.0" y="-980.7" z="0.0"/>

<instanciate class="WheelRobot-nii-v1.xml" type="Robot">
		<set-attr-value name="name" value="robot_000"/>
		<set-attr-value name="language" value="c++"/>
		<set-attr-value name="implementation"
						value="./libSig_app_kinem.so"/>
		<set-attr-value name="dynamics" value="false"/>
		<set-attr-value name="x" value="00.0"/>
		<set-attr-value name="y" value="30.0"/>
		<set-attr-value name="z" value="0.0"/>
		<set-attr-value name="collision" value="true"/>
    <!--stereo camera right-->
	<camera id="1"
			link="REYE_LINK"
			direction="0.0 -1.0 1.0"
			position="0.0 0.0 3.0"/>
    <!--stereo camera left-->
	<camera id="2"
			link="LEYE_LINK"
			direction="0.0 -1.0 1.0"
			position="0.0 0.0 3.0"/>
    <!--distance sensor-->
	<camera id="3"
			link="WAIST_LINK0"
			direction="0.0 1.0 0.0"
			position="0.0 -5.0 20.0"
			fov="45"  
            aspectRatio="1.5"/>
    <!--monitoring camera-->
	<camera id="4"
			link="WAIST_LINK2"
			direction="0 0 1"
			quaternion="0.0 0.0 -0.966 0.259"
			position="0.0 40.0 120.0"/>
  </instanciate>

</world>
}}

** Build the project [#q07862eb]

Go in your ROS workspace and build your project. For example : 
 $ cd ~/catkin_ws
 $ catkin_make

Run this command to initialize KDL node in ROS : 
 $ source /opt/ros/groovy/setup.sh

** Testing the package [#q07862eb]

*** Run the simulation [#q07862eb]

Run three terminal.
- On the first, run the ROS system
 $ roscore
- On the second, run the node (here it's for KDL) in your ROS workspace
 $ cd ~/catkin_ws
 $ rosrun Kinem_Sig_Ros Arm_Control1
- On the third, run SIGServer
 $ cd ~/catkin_ws/devel/lib
 $ sigserver.sh -w ./RobotInMove.xml

*** How use the demonstrator [#q07862eb]

You must send a specific command to control the arm : 

- To move the arm :
--1) In SIGViewer, send the message "move_arm_kdl" to the robot
--2) In SIGServer, indicate the destination coordinate in robot basis (x,y,z and roll,pitch,yaw)

- To get information for the position of the hand : 
--1) In SIGViewer, send the message "get_hand" to the robot
--2) In SIGServer, you see the position in robot and world basis

- To get the position of each joint
--1) In SIGViewer, send the message "get" to the robot
--2) In SIGServer, you see the position of each joint in robot basis

Front page   Edit Diff Backup Upload Copy Rename Reload   New List of pages Search Recent changes   Help   RSS of recent changes