Skip to content

Latest commit

 

History

History
133 lines (101 loc) · 5.51 KB

File metadata and controls

133 lines (101 loc) · 5.51 KB

Track

Derived from Solid.

Track {
  MFNode  device           [ ]    # {LinearMotor, PositionSensor, Brake, PROTO}
  SFVec2f textureAnimation 0 0    # any vector
  SFNode  animatedGeometry NULL   # {Shape, CadShape, Group, Pose, Transform, Slot, PROTO}
  SFInt32 geometriesCount  10     # [0, inf)
}

The Track node defines a track object that could be used to model tracks for conveyor belts or tank robots.

Note that this works only in physics-based simulations. Therefore, the physics and boundingObject fields of the Track node and related Solid nodes must be non-NULL for the Track node to behave correctly. It is not a requirement that the boundingObject exactly matches the track belt shape; it is possible to use basic geometries such as boxes and cylinders to specify the external shape of the belt, especially the parts where it may touch the ground or obstacles. A simple example is shown in the following figure.

Additionally, in order to work correctly, the Track node has to fulfill these conditions:

  • the z-axis of the Track node is parallel to the world up vector.
  • the belt and wheels are aligned on a plane perpendicular to the Track node's y-axis.

%figure "Track's bounding object example"

track_bounding_object.png

%end

The device field optionally specifies a LinearMotor, a linear PositionSensor and a Brake device. The motor allows to control the motion of the track, and if not specified the track will behave like a fixed joint. Position, velocity or force control can be used but force feedback functions are not available.

The track system doesn't have any default wheel, but it is possible to insert a TrackWheel node in the children field to define an object that will automatically rotate based on the Track motor speed. Note that the TrackWheel node is an abstract wheel and the shape has to be defined by the user.

Other than the motion, it is also possible to define an animation to show graphically the movement of the track. Two different types of animation are available: texture animation and geometries animation.

Note that the track belt is only automatically generated and displayed in case the geometries animation is enabled. Otherwise it can be manually defined by adding the shape in the children field.

Texture Animation

The texture animation is the simplest option and consists in scrolling the texture object in the direction defined in the textureAnimation field. This scroll value is combined with the belt velocity in order to update the position of texture at each time step. If the value is [0 0] the texture will not move. Only the first child of the Track is taken into consideration for texture animation, and it has to be a Shape, a Group node or a Group descendant having a Shape node as its first child. Also note that the Appearance node of the Shape and its texture and textureTransform fields have to be explicitly defined.

Note that the TextureTransform node that is going to be automatically altered by the Track functionality cannot be a USE node.

Geometries Animation

The geometries animation consists of a set of pure graphical Shape objects without physics properties moving along a defined belt path.

The animatedGeometry field contains the specification of the appearance and geometry of the animated objects.

The geometriesCount field specifies the number of animated objects that will move along the belt path.

Note that the geometries animation is enabled only if the geometriesCount value is greater than 0 and the animatedGeometry field is defined.

The belt path along which the animated geometries move is shaped to the TrackWheel nodes contained in the children field. Each wheel contains the information about its center position, its radius and if it is inside or outside the belt. By convention the wheels are all aligned on a plane perpendicular to the Track node's y-axis and have to be defined in clockwise order starting from the one with the smallest x-axis position component.

The following code fragment shows the belt path definition for the convex track example shown in this figure:

children [
  TrackWheel {
   position -0.4 0.4
    radius 0.2
    inner TRUE
  }
  TrackWheel {
    position 0.4 0.4
    radius 0.2
    inner TRUE
  }
  TrackWheel {
    position 0.2 0.12
    radius 0.1
    inner TRUE
  }
  TrackWheel {
    position 0 0.12
    radius 0.1
    inner TRUE
  }
  TrackWheel {
    position -0.2 0.12
    radius 0.1
    inner TRUE
  }
]

%figure "Convex track's belt shape example"

track_belt_convex.png

%end

Then for a concave track belt shape like the one shown in this figure the following TrackWheel nodes have to be defined:

children [
  TrackWheel {
    position -0.4 0.0
    radius 0.2
    inner TRUE
  }
  TrackWheel {
    position -0.0 0.14
    radius 0.1
    inner FALSE
  }
  TrackWheel {
    position 0.4 0.0
    radius 0.2
    inner TRUE
  }
]

%figure "Concave track's belt shape example"

track_belt_concave.png

%end