main content

differential wheeled robot in a maze -凯发k8网页登录

the vrmaze example shows how the collision detection in simulink® 3d animation™ can be used to simulate a differential wheeled robot solving the maze challenge. the robot control algorithm uses information from virtual ultrasonic sensors that sense distance to surrounding objects.

a simple differential wheeled robot is equipped with 2 virtual ultrasonic sensors, one of the sensors looks ahead, one is directed to the left of the robot. sensors are simplified, their active range is represented by green lines.

the sensors are implemented as x3d linepicksensor nodes. these sensors detect approximate collisions of rays (modeled as indexedlineset) with arbitrary geometries in the scene. in case of geometric primitives, exact collisions are detected. one of the linepicksensor output fields is the isactive field, which becomes true as soon as the collision between its ray and surrounding scene objects is detected.

when activated, the sensor lines change their color from green to red using the script written directly in the virtual world.

in the model, there are both vr sink and vr source blocks defined, associated with the same virtual scene. vr source is used to read the sensors isactive signals. vr sink is used to set the robot position / rotation in the virtual world.

robot control algorithm is implemented using a stateflow® chart.

in the virtual world, there are several viewpoints defined. change to the "follow robot" viewpoint to see the scene from a different perspective.

网站地图