anyKode Marilou
Step 2

Joints and Zones.

We will connect wheels to the robot's base using joints. Also, we will create the entities (zone) that are allowed toi embed distance sensors. Devices are created in the next chapter. 


Step 1: Create joints
Creating a HINGE joint (1 axe):

Joints are created like other geometries.

  1. Show the Add panel the choose the Link sub panel,
  2. Click on Hinge button for activating the Create Mode.
  3. Start creating the join in the perspective view, on the right side of the robot.


Second joint:

  1. From the Modify panel (joint must be selected), set Anchor Size property to 0.09.
  2. Copy/Paste the joint then move the new one on the left side of the robot.


Rear joint:

  1. Show the Add-> Link panel and choose a Ball joint,
  2. Create the joint at the rear of the robot.


Move the joints:
We have to set joints position in order to make a wheel can turn around joint's axis. For doing that, we just have to set joint's position exactly the same as wheel's position.

  1. Select the left wheel's sphere then left joint in second (use Ctrl for multiple selection),
  2. Press P (Make Same Pos): the joint moves to wheel's position,
  3. Select the right wheel's sphere then the right joint in second,
  4. Press P : the joint moves to wheel's position

Do the same operation for the ball joint. 

Rename joints:

  1. Set left hinge's name to hinge_left,
  2. Set right hinge's name to hinge_right,

(Because the Ball joint will not embed any device, its name is not important in this sample) 



Step 2: Connecting joints with Rigid Bodies

We will connect joints and rigid bodies. Wheels will be able to turn around joint axis.


  1. Select the right joint,
  2. Show the Modify panel,
  3. Choose body_right in the joint"s property Body 1
  4. Choose body_base in the joint"s property Body 2

Do this operation for the left joint and the ball joint using respectively body_left/body_rear as Body 1, and always body_base as Body 2

Note: Body 1 is the body witch is attached to the joint's axis. 

For checking that your joints are attached correctly, you can move it: two lines show the connected bodies.

(press Ctrl + Z) for undoing the joint's move ... 


Étape 1: Creating Zones (distance sensors support):

(See also Distance Sensors

Creating zones and connecting it to the base.

Creating the zone:

  1. Show the Add -> 3D and choose Zone,
  2. Create a Zone at the robot's front right.

Attache zone to the base:
In order to make the zone to move with the base, we have to attach it on the Box or on the Box's rigid body (body_base).

  1. Select the base's box then the zone in second,
  2. Press Ctrl + L for linking the two entities,
  3. A green link shows the link.


Move the zone and duplicate it:

  1. Move the zone on the good position (front right),
  2. Copy/Paste it and move the new one on the front left,
  3. Select the first zone then the second and press Shift + Y in order to have the same Y (-), and X for same X.
  4. Attach the second zone to the robot's base,
  5. Rename the left zone to zone_left, and the right one to zone_right.

The picture shows the model: you can see that zones tree-node are below the box0 node (attached to ...) 

Note: You can rotate the zone using the Rotate Mode (R):

  1. Select the zone, then enter in Rotate Mode (R),
  2. Capture the blue tore (rotate around Z),
  3. Move the mouse.

You can also set an angle directly in Z property below the window. 


In the previous chapter we explained that the entities would be ejected violently if we run the simulation, due to the interlocking wheels in the base since the start of the simulation. Now, because the rigid bodies are connected Solver will no longer try to resolve any contacts / efforts between the wheels and the base. To override this behavior (which is very useful in our example), just check the property 'Collides with connected bodies' of rigid bodies. Collision detection system (and therefore the calculation of effort) is activated if the option is checked on two rigid bodies in contact.

Documentation v4.7 (18/01/2015), Copyright (c) 2015 anyKode. All rights reserved.
What do you think about this topic? Send feedback!