Simulation of different kind of Robots in a 3D visualisation scene under Borland Developement Studio 2006 and OpenGL
How to Simulate Robot using a physical model and act on them using an user friendly 3D visulaisation tool. Executable and some sources are provided.
Let's start for presenting a screen capture of the application :
We ca see diffents robots, named : Robot4, RobotK, Monocycle, Bicycle, MRVlin...) and act on them by selecting the robot in the drop list than use the numerical pad.
Each robot has its own commands.
A yellow triangle (with its shadow on the ground) represents the target view point. This view point can be moved in the 3 directions and we can rotate the camera up and down, left and right around it.
The camera view can be changed using 2 modes:
Mouse right button mode (when clicked):
UP zpos-=CameraMoveStep; get away from the scene.
DOWN zpos+=CameraMoveStep; get closer to the scene.
LEFT xpos-=CameraMoveStep; lateral moves.
RIGHT xpos+=CameraMoveStep;
PRIOR ypos-=CameraMoveStep;
NEXT ypos+=CameraMoveStep;
W CameraMoveStep*=1.5f; increase camera move step.
X CameraMoveStep/=1.5f; decrease camera move step (allows getting closer to objects).
Mouse move rotation up, down, left and right.
Mouse weel get closer to / away from the scene.
Normal mode (whithout clicking the mouse right button, clicking toggles between modes):
UP zpos-=CameraMoveStep; get away from the scene.
DOWN zpos+=CameraMoveStep; get closer to the scene.
LEFT xpos-=CameraMoveStep; lateral moves.
RIGHT xpos+=CameraMoveStep;
PRIOR ypos-=CameraMoveStep;
NEXT ypos+=CameraMoveStep;
W CameraMoveStep*=1.5f; increase camera move step.
X CameraMoveStep/=1.5f; decrease camera move step (allows getting closer to objects).
Z rotation up {
xrot+= 2.0f;
if (xrot>180) xrot-= 360.0f;
}
S rotation down {
xrot-= 2.0f;
if (xrot<-180.0) xrot+= 360.0f;
}
Q rotation left {
yrot+= 2.0f;
if (yrot>180) yrot-= 360.0f;
}
D rotation right {
yrot-= 2.0f;
if (yrot<-180) yrot+= 360.0f;
Other tasks:
A Animate : Start / Stop the animation which will show the evolution of robots through time.
The animation speed can be changed using the scroller. With the second scroller, we can fix coil powering switch frequency of the MRVlin robot.
CTRL-D Toggles between Demo mode and normal mode.
CTRL-M Toggles between manuel mode and Automatic drive for ALL the robots.
From menu Reset default View.
From menu Display a view option window.
From menu Start a video capture of the animation in compressed format.
This robot is a model of the Khepera. We can act on the speed of each wheel (forward and reverse).
The arrows represent the wheel speed (blue) and the robot speed (green) of the khepera.
Right wheel:
'9' Increase the speed of the right wheel.
'3' Decrease the speed of the right wheel.
'6' Stop the right wheel.
left wheel:
'7' Increase the speed of the left wheel.
'1' Decrease the speed of the left wheel.
'4' Stop the left wheel.
M Toggles between manuel mode and Automatic drive.