Tutorial?

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

Introduction

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

  • 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

Download the source code from GitHub

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/RobotControl

Then place on the good directory :

$ cd samples/ControlRobot/

Build the project

Build the source code in your working directory.

$ make

Run the program

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

If you would change the environment, specify the ControlRobot.so and its location within workspace directory.

Starting the simulation

In your working directory :

$ sigserver.sh -w ./house_example.xml 

How use the template

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 grasp an object on a table automatically
    • 1) In SIGViewer, send the message "grasp_planning" to the robot
    • 2) In SIGServer, indicate the name of the table and the object that you would grasp
    • This function is a little demonstration how we can use all functions
  • To get hand coordinates 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

goTo(Vector3d pos, double rangeToPoint=0, double Robot_speed=3)

This function is to move the robot in his environment. The robot go in straight line and his trajectory is automatically corrected during the movement.

  • This function has need :
    • getAngularXonVect
    • getDist2D
    • getRoll
  • Parameters
    • pos : the destination coordinates
    • rangeToPoint : the distance between coordinates and real position
    • Robot_speed : speed of the robot (initially : 3)
  • Return true if the position is reached
  • This function must be used only in OnAction

goTo_AvoidObstacle(Vector3d pos, double rangeToPoint=0, double Robot_speed=3)

This function is to move the robot in his environment too but the trajectory is corrected if there is an obstacle in the front of the robot. Caution : this function is not totally finish. There are a bug with the distance sensor.

  • This function has need :
    • goTo
    • distance_sensor
  • Parameters
    • pos : the destination coordinates
    • rangeToPoint : the distance between coordinates and real position
    • Robot_speed : speed of the robot (initially : 3)
  • Return true if the position is reached
  • This function must be used only in OnAction

distance_sensor()

This function return the distance between the camera and an obstacle. For more informations, refer to the tutorial Distance sensor

  • This function has need to be connect at SIGViewer with a ViewService
  • Return : the distance

moveLeftArm() or moveRightArm()

These functions move the arm with a velocity in each joint.

  • These functions don't need others to run properly
  • Write the value of each joint in the global variable <m_joint_left[7]> or <m_joint_right[7]>
  • Return true if the angles value are reached
  • This function must be used only in OnAction

grasp_left_hand(std::string &object) or grasp_left_hand(std::string &object)

These functions grasp an object in the robot hand.

  • These functions don't need others to run properly
  • Parameter : the name of the object to be grasped
  • Writes in a global variable if an object is grasped or not
  • It's possible to use these functions when we want

release_left_hand() or release_right_hand()

These functions release an object.

  • These functions don't need others to run properly
  • It's possible to use these functions when we want

changeBasis_WorldToRobot(Vector3d pos)

This function transform a coordinate in world basis to a coordinate in robot basis.

  • This function has need only getRoll
  • Parameter : coordinate in world basis
  • Return : coordinate in robot basis
Counter: 3445, today: 1, yesterday: 0

Front page   Edit Freeze Diff Backup Upload Copy Rename Reload   New List of pages Search Recent changes   Help   RSS of recent changes
Last-modified: 2014-07-23 (Wed) 18:12:24 (3562d)