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
 Step Description Creating a HINGE joint (1 axe):Joints are created like other geometries. Show the Add panel the choose the Link sub panel, Click on Hinge button for activating the Create Mode. Start creating the join in the perspective view, on the right side of the robot. Second joint: From the Modify panel (joint must be selected), set Anchor Size property to 0.09. Copy/Paste the joint then move the new one on the left side of the robot. Rear joint: Show the Add-> Link panel and choose a Ball joint, 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. Select the left wheel's sphere then left joint in second (use Ctrl for multiple selection), Press P (Make Same Pos): the joint moves to wheel's position, Select the right wheel's sphere then the right joint in second, Press P : the joint moves to wheel's position Do the same operation for the ball joint. Rename joints: Set left hinge's name to hinge_left, 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.

 Step Description Connecting: Select the right joint, Show the Modify panel, Choose body_right in the joint"s property Body 1 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 2Note: Body 1 is the body witch is attached to the joint's axis. Check: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):

Creating zones and connecting it to the base.

 Step Description Creating the zone: Show the Add -> 3D and choose Zone, 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). Select the base's box then the zone in second, Press Ctrl + L for linking the two entities, A green link shows the link. Move the zone and duplicate it: Move the zone on the good position (front right), Copy/Paste it and move the new one on the front left, Select the first zone then the second and press Shift + Y in order to have the same Y (-), and X for same X. Attach the second zone to the robot's base, 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): Select the zone, then enter in Rotate Mode (R), Capture the blue tore (rotate around Z), 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.