IntegratedMovement

master
javadoc

IntegratedMovement is a service that use inverse kinematic computation to control the position of a robot arms. So instead of moving each joints separatly, you give a position in a 3d space and the arm will take to position it need to reach that position.

The IntegratedMovement service also incorporate a collision detection and avoidance. That mean if the service detect a possible collision, it will take some action to move it's arm away of the collision point. The collision objects can be set to represent each part of the robot body, create by script or detect with sensor (only kinect for now)

The service can also use some basic AI like having an arm keep it's position while other part of the body moves, turn the head to look at the position he is moving (in progress) and other.

The concept of the service is based on InverseKinematics3D who did an awesome work that allow this service to work.

Setup: 

Using InMoov service

The integratedMovement service have been add to the inMoov service and will load default setting.

the command to start the service is 

InMoov.startIntegratedMovement()

If the range of your servo do not correspond to the default setting, you can adjust the limits using

InMoov.IntegratedMovement.setMinMaxAngle(partName, minAngle, maxAngle)... partName is the same name as the servo that move a part. 

 

Using IntegratedMovement as standalone service

The IntegratedMovement can be use for any robot. You will need to define the DH parameters for each joints before you can use it. 

The first thing you must do is to declare a new DHRobotArm with setNewDHRobotArm(armName). This will create a new thread class that will command the arm or the robot.

Then you must setup the DHLinks for each joints of the arm. The DHLinks will define how a joints moves relatively to the previous joints. The DH parameters are explained in this video

https://www.youtube.com/watch?v=rA9tm0gTln8

If you want the same coordinated for all of your arms, they must start all your arms with a common link originated at the same point

To set the DHLinks, you must use one of those methods

  • setDHLink(armName, linkName, d, theta, r, alpha)
  • setDHLink(armName, servo, d, theta, r, alpha)

    • d, theta, r and alpha are the DH parameters (see the video)
    • the first version use a string as linkName. It will make a static link that don't rotate, but still take in account for the inverse kinetic algorythm
    • the second version initialize the link with information found in the servo class, like the min/max limits. It will also establish communication between the DHRobotArm and the Servo so when the servo moves the DHRobotArm get updated about the movement.

Finally, you start the DHRobotArm thread with startEngine(armName)

 

You can also setup physicals objects that will be taken in account by the inverse kinetic engine to avoid collision between the defined objects.

To add an virtual object in the environnement of your robot, you must use

  • addObject(OriginX, OriginY, OriginZ, EndX, EndY, EndZ, objectName, radius, jmeRender)

    • Object are all considered as a cylinder, so you must define a Origin and a End point relative to your first DHLink origin and a radius. Units must be the same as use for defining the DH parameters
    • jmeRender is a boolean (True/False) that will make the object appear (render) into the JmeApp if you are using it
    • the objects set are static and cannot be moved

To set your DHLink as objects you must use

  • addObject(objectName, radius, jmeRender)

    • Object name must be the same name as the DHLink it's link to
    • jmeRender is a boolean (True/False) that will make the object appear (render) into the JmeApp if you are using it
    • the inverse kinetic engine will update the position of the object, so you dont have to give an Origin and End point

the method objectAddIgnored(objectName1, objectName2) will make the inverse kinetic engine ignore collision between the two object defined. This may be necessary if two objects are too close that the engine detect them as colliding.

The kinect can be use to 'see'  the objects in front of the robot. You can start the kinect with startOpenNI(). the kinect is not reading the environment in real time yet, you must ask it to take a snapshot with processKinectData()

 

example: 


#file : /service/IntegratedMovement.InMoov.py edit raw
#start the InMoov
i01 = Runtime.createAndStart("i01","InMoov")
i01.startAll("COM5","COM6")

#start IntegratedMovement()
i01.startIntegratedMovement()

#move arms at a specific point
i01.integratedMovement.moveTo("leftArm",300,400,500)

#start the kinect
i01.integratedMovement.startOpenNI()

#use the kinect to take a snapshot of the surrounding and process the data into the inMoov 3D space
i01.integratedMovement.processKinectData()

#use the SwingGui for easier interraction with objects

dom14's picture

Is it possible to have only

Is it possible to have only the kinect service because i d'ont use inmoov service ?

Thank you a lot.

 

calamity's picture

It is possible to use

It is possible to use IntegratedMovement service without using InMoov service

I have not done the documentation for it yet, but quickly you need to pass the DH parameter and objects (for collision) just as the InMoov.startIntegratedMovement do

https://github.com/MyRobotLab/myrobotlab/blob/develop/src/org/myrobotlab...

you can use python to pass the DH parameters and objects

you can start the kinect in IntegratedMovement service with IntegratedMovement.startOpenNI()

I know there is a lot of setting to do, that's why I hard code it in the InMoov service. If you have question, let me know