[[Tutorial]]

#contents

*Introduction [#l64cca14]

This sample consist at different function to control a robot in SIGVerse.

You can :
- Move the robot with a position control and speed just with destination coordinates. There are an option to move the robot with obstacle avoidance.
- Move the two arm with a position control for each joint just with final value of joints.
- Function to grasp and release an object.
- Determine a new coordinate to grasp an object on a table.
- Function to change of basis (world coordinate to robot coordinate)

*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

*Robot controller [#xc8790c9]

*** Download the source code from GitHub [#a58bb3c2]

Download the template from the Github using the link here

*** Build the project [#q07862eb]

Build the source code in your working directory.
 $ make


*** Run the program [#k54b69fc]

Chooze your <xml> file for the environment. 
Include in the package, the <xml> of  EGPSR  environment.

If you would change the environment, specifying the controller and its location within workspace directory.

#highlight(xml){{

<?xml version="1.0" encoding="utf8"?>

<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="./ControlRobot.so"/>
  <set-attr-value name="dynamics" value="false"/>
  <set-attr-value name="x" value="0.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 0.0 1.0"
          position="0.0 0.0 3.0"/>
    <!--stereo camera left-->
  <camera id="2"
          link="LEYE_LINK"
          direction="0.0 0.0 1.0"
          position="0.0 0.0 3.0"/>
    <!--distance sensor-->
  <camera id="3"
          link="WAIST_LINK0"
          direction="0.0 0.0 1.0"
          position="0.0 -5.0 20.0"/>
    <!--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>
}}

*** How use the template [#k54b69fc]

You can use a demonstrator for each function in this template. You must send a specific command for each function.

-To move the robot without obstacle avoidance
--1) In SIGViewer, send the message "move" to the robot
--2) In SIGServer, indicate the destination coordinate
--3) In SIGServer, indicate "2" for avoidance

-To move the robot with obstacle avoidance
--1) In SIGViewer, send the message "move" to the robot
--2) In SIGServer, indicate the destination coordinate
--3) In SIGServer, indicate "1" for avoidance
--Caution : the distance sensor is not completly operational

-To move the arm
--1) In SIGViewer, send the message "move_left_arm" or "move_right_arm" to the robot
--2) In SIGServer, indicate the angle for each joints (refer to [[JointDefinition]] for the names)

-To get the hand coordinate in robot basis
--1) In SIGViewer, send the message "get_LeftHand" or "get_RightHand" to the robot
--2) In SIGServer, you can see the coordinate of the hand.

-To grasp an object
--1) In SIGViewer, send the message "grasp_left" or "grasp_right" to the robot
--2) In SIGServer, indicate the object name.

-To release an object
--1) In SIGViewer, send the message "release_left" or "release_right" to the robot

* How use the different function in others task [#k54b69fc]

*** goTo [#k54b69fc]
-This function has need :
--getAngularXonVect
--getDist2D
--getRoll



*** goTo_AvoidObstacle [#k54b69fc]
-This function has need :
--goTo
--distance_sensor



*** moveLeftArm or moveRightArm [#k54b69fc]

These functions don't need others to run properly.

Write the value of each joint in the variable 


#counter

Front page   New List of pages Search Recent changes   Help   RSS of recent changes