ViSP
2.6.2
|
#include <vpWireFrameSimulator.h>
Public Types | |
enum | vpSceneObject { THREE_PTS, CUBE, PLATE, SMALL_PLATE, RECTANGLE, SQUARE_10CM, DIAMOND, TRAPEZOID, THREE_LINES, ROAD, TIRE, PIPE, CIRCLE, SPHERE, CYLINDER, PLAN, POINT_CLOUD } |
enum | vpSceneDesiredObject { D_STANDARD, D_CIRCLE, D_TOOL } |
enum | vpCameraTrajectoryDisplayType { CT_LINE, CT_POINT } |
Protected Member Functions | |
void | display_scene (Matrix mat, Bound_scene &sc, vpImage< vpRGBa > &I, vpColor color) |
void | display_scene (Matrix mat, Bound_scene &sc, vpImage< unsigned char > &I, vpColor color) |
vpHomogeneousMatrix | navigation (vpImage< vpRGBa > &I, bool &changed) |
vpHomogeneousMatrix | navigation (vpImage< unsigned char > &I, bool &changed) |
vpImagePoint | projectCameraTrajectory (vpImage< vpRGBa > &I, vpHomogeneousMatrix cMo, vpHomogeneousMatrix fMo) |
vpImagePoint | projectCameraTrajectory (vpImage< unsigned char > &I, vpHomogeneousMatrix cMo, vpHomogeneousMatrix fMo) |
vpImagePoint | projectCameraTrajectory (vpImage< vpRGBa > &I, vpHomogeneousMatrix cMo, vpHomogeneousMatrix fMo, vpHomogeneousMatrix cMf) |
vpImagePoint | projectCameraTrajectory (vpImage< unsigned char > &I, vpHomogeneousMatrix cMo, vpHomogeneousMatrix fMo, vpHomogeneousMatrix cMf) |
Implementation of a wire frame simulator. Compared to the vpSimulator class, it does not require third party libraries to be used.
The simulator uses several frames to display the scene in the image. There are:
The most used homogeneous matrices which describes the displacement between two frames are :
The following picture summarize all the previous informations.
The simulator uses .bnd or .wrl files as 3D scene descriptors. Several scenes can be found in the data folder which is in the directory where you build ViSP.
You can move the main external view while clicking in the image. The left click enables to turn, the middle button enables to zoom and the left to translate along x and y.
The simulator is able to take into account to camera parameters. You can set the internal and external cameras parameters thanks to a vpCameraParameters.
The following example shows how it is easy to use.
Definition at line 186 of file vpWireFrameSimulator.h.
Enumerator | |
---|---|
CT_LINE | |
CT_POINT |
Definition at line 227 of file vpWireFrameSimulator.h.
Type of scene used to display the object at the desired pose (in the internal view).
Enumerator | |
---|---|
D_STANDARD | |
D_CIRCLE | |
D_TOOL |
Definition at line 220 of file vpWireFrameSimulator.h.
Type of scene used to display the object at the current position.
Enumerator | |
---|---|
THREE_PTS | |
CUBE | |
PLATE | |
SMALL_PLATE | |
RECTANGLE | |
SQUARE_10CM | |
DIAMOND | |
TRAPEZOID | |
THREE_LINES | |
ROAD | |
TIRE | |
PIPE | |
CIRCLE | |
SPHERE | |
CYLINDER | |
PLAN | |
POINT_CLOUD |
Definition at line 193 of file vpWireFrameSimulator.h.
vpWireFrameSimulator::vpWireFrameSimulator | ( | ) |
Basic constructor.
Set the path to the scene files (*.bnd and *.sln) used by the simulator. If the path set in vpConfig.h in VISP_SCENES_DIR macro is not valid, the path is set from the VISP_SCENES_DIR environment variable that the user has to set.
Definition at line 514 of file vpWireFrameSimulator.cpp.
References blocked, blockedr, blockedt, blockedz, vpColor::blue, vpHomogeneousMatrix::buildFrom(), camColor, cameraFactor, cameraTrajectory, camTrajColor, camTrajType, vpIoTools::checkDirectory(), CT_LINE, curColor, desColor, displayCamera, displayCameraTrajectory, displayDesiredObject, displayImageSimulator, displayObject, extCamChanged, fMo, fMoList, vpIoTools::getenv(), vpColor::green, nbrPtLimit, objectImage, old_iPr, old_iPt, old_iPz, poseList, px_ext, px_int, py_ext, py_int, vpMath::rad(), vpColor::red, rotz, sceneInitialized, and vpHomogeneousMatrix::setIdentity().
|
virtual |
Basic destructor
Definition at line 581 of file vpWireFrameSimulator.cpp.
References camera, cameraTrajectory, desiredScene, displayCamera, displayDesiredObject, displayObject, fMoList, poseList, scene, and sceneInitialized.
|
inline |
Delete the history of the main camera position which are displayed in the external views.
Definition at line 529 of file vpWireFrameSimulator.h.
|
protected |
Definition at line 408 of file vpWireFrameSimulator.cpp.
References vpDisplay::displayLine(), vpImage< Type >::getHeight(), and vpImage< Type >::getWidth().
Referenced by vpSimulatorAfma6::getExternalImage(), vpSimulatorViper850::getExternalImage(), getExternalImage(), getInternalImage(), and vpRobotSimulator::getInternalView().
|
protected |
Definition at line 458 of file vpWireFrameSimulator.cpp.
References vpDisplay::displayLine(), vpImage< Type >::getHeight(), and vpImage< Type >::getWidth().
void vpWireFrameSimulator::displayTrajectory | ( | vpImage< unsigned char > & | I, |
const std::list< vpHomogeneousMatrix > & | list_cMo, | ||
const std::list< vpHomogeneousMatrix > & | list_fMo, | ||
const vpHomogeneousMatrix & | cMf | ||
) |
Display a trajectory thanks to a list of homogeneous matrices which give the position of the camera relative to the object and the position of the object relative to the world refrence frame. The trajectory is projected into the view of an external camera whose position is given in parameter.
The two lists must have the same size of homogeneous matrices must have the same size.
I | : The image where the trajectory is displayed. |
list_cMo | : The homogeneous matrices list containing the position of the camera relative to the object. |
list_fMo | : The homogeneous matrices list containing the position of the object relative to the world reference frame. |
cMf | : A homogeneous matrix which gives the position of the external camera (used to project the trajectory) relative to the world refrence frame. |
Definition at line 1689 of file vpWireFrameSimulator.cpp.
References camTrajColor, camTrajType, CT_LINE, CT_POINT, vpException::dimensionError, vpDisplay::displayLine(), vpDisplay::displayPoint(), projectCameraTrajectory(), and rotz.
void vpWireFrameSimulator::displayTrajectory | ( | vpImage< vpRGBa > & | I, |
const std::list< vpHomogeneousMatrix > & | list_cMo, | ||
const std::list< vpHomogeneousMatrix > & | list_fMo, | ||
const vpHomogeneousMatrix & | cMf | ||
) |
Display a trajectory thanks to a list of homogeneous matrices which give the position of the camera relative to the object and the position of the object relative to the world refrence frame. The trajectory is projected into the view of an external camera whose position is given in parameter.
The two lists must have the same size of homogeneous matrices must have the same size.
I | : The image where the trajectory is displayed. |
list_cMo | : The homogeneous matrices list containing the position of the camera relative to the object. |
list_fMo | : The homogeneous matrices list containing the position of the object relative to the world reference frame. |
cMf | : A homogeneous matrix which gives the position of the external camera (used to project the trajectory) relative to the world refrence frame. |
Definition at line 1729 of file vpWireFrameSimulator.cpp.
References camTrajColor, camTrajType, CT_LINE, CT_POINT, vpException::dimensionError, vpDisplay::displayLine(), vpDisplay::displayPoint(), projectCameraTrajectory(), and rotz.
void vpWireFrameSimulator::displayTrajectory | ( | vpImage< unsigned char > & | I, |
vpList< vpHomogeneousMatrix > & | list_cMo, | ||
vpList< vpHomogeneousMatrix > & | list_fMo, | ||
vpHomogeneousMatrix | cMf | ||
) |
Display a trajectory thanks to a list of homogeneous matrices which give the position of the camera relative to the object and the position of the object relative to the world refrence frame. The trajectory is projected into the view of an external camera whose position is given in parameter.
The two lists must have the same size of homogeneous matrices must have the same size.
I | : The image where the trajectory is displayed. |
list_cMo | : The homogeneous matrices list containing the position of the camera relative to the object. |
list_fMo | : The homogeneous matrices list containing the position of the object relative to the world reference frame. |
cMf | : A homogeneous matrix which gives the position of the external camera (used to project the trajectory) relative to the world refrence frame. |
Definition at line 1607 of file vpWireFrameSimulator.cpp.
References camTrajColor, camTrajType, CT_LINE, CT_POINT, vpException::dimensionError, vpDisplay::displayLine(), vpDisplay::displayPoint(), vpList< type >::front(), vpList< type >::nbElements(), vpList< type >::next(), vpList< type >::outside(), projectCameraTrajectory(), rotz, and vpList< type >::value().
void vpWireFrameSimulator::displayTrajectory | ( | vpImage< vpRGBa > & | I, |
vpList< vpHomogeneousMatrix > & | list_cMo, | ||
vpList< vpHomogeneousMatrix > & | list_fMo, | ||
vpHomogeneousMatrix | cMf | ||
) |
Display a trajectory thanks to a list of homogeneous matrices which give the position of the camera relative to the object and the position of the object relative to the world refrence frame. The trajectory is projected into the view of an external camera whose position is given in parameter.
The two lists must have the same size of homogeneous matrices must have the same size.
I | : The image where the trajectory is displayed. |
list_cMo | : The homogeneous matrices list containing the position of the camera relative to the object. |
list_fMo | : The homogeneous matrices list containing the position of the object relative to the world reference frame. |
cMf | : A homogeneous matrix which gives the position of the external camera (used to project the trajectory) relative to the world refrence frame. |
Definition at line 1649 of file vpWireFrameSimulator.cpp.
References camTrajColor, camTrajType, CT_LINE, CT_POINT, vpException::dimensionError, vpDisplay::displayLine(), vpDisplay::displayPoint(), vpList< type >::front(), vpList< type >::nbElements(), vpList< type >::next(), vpList< type >::outside(), projectCameraTrajectory(), rotz, and vpList< type >::value().
|
inline |
Get the pose between the object and the camera.
Definition at line 490 of file vpWireFrameSimulator.h.
|
inline |
Get the homogeneous matrices cMo stored to display the camera trajectory.
cMo_history | : The list of the homogeneous matrices cMo. |
Definition at line 546 of file vpWireFrameSimulator.h.
|
inline |
Get the homogeneous matrices cMo stored to display the camera trajectory.
Definition at line 612 of file vpWireFrameSimulator.h.
References vpList< type >::addRight().
|
inline |
Get the pose between the object and the fixed world frame.
Definition at line 483 of file vpWireFrameSimulator.h.
|
inline |
Get the homogeneous matrices fMo stored to display the camera trajectory.
fMo_history | : The list of the homogeneous matrices fMo. |
Definition at line 558 of file vpWireFrameSimulator.h.
|
inline |
Get the homogeneous matrices fMo stored to display the camera trajectory.
Definition at line 597 of file vpWireFrameSimulator.h.
References vpList< type >::addRight().
|
inline |
Get the parameters of the virtual external camera.
I | : The image used to display the view of the camera. |
Definition at line 438 of file vpWireFrameSimulator.h.
References vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpMath::maximum(), and vpMath::minimum().
Referenced by projectCameraTrajectory().
|
inline |
Get the parameters of the virtual external camera.
I | : The image used to display the view of the camera. |
Definition at line 458 of file vpWireFrameSimulator.h.
References vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpMath::maximum(), and vpMath::minimum().
|
inline |
Get the main external camera's position relative to the the world reference frame.
Definition at line 352 of file vpWireFrameSimulator.h.
Referenced by vpRobotSimulator::getExternalCameraPosition().
Get the external view. It corresponds to the view of the scene from a reference frame you have to set.
I | : The image where the external view is displayed. |
Definition at line 1112 of file vpWireFrameSimulator.cpp.
References camColor, camera, cameraTrajectory, camMf, camMf2, camTrajColor, camTrajType, cMo, CT_LINE, CT_POINT, CUBE, curColor, vpImage< Type >::display, vpDisplay::display(), display_scene(), displayCamera, displayCameraTrajectory, displayImageSimulator, vpDisplay::displayLine(), displayObject, vpDisplay::displayPoint(), extCamChanged, f2Mf, fMc, fMo, fMoList, vpImage< Type >::getHeight(), vpImageSimulator::getImage(), getInternalCameraParameters(), vpImage< Type >::getWidth(), vpHomogeneousMatrix::inverse(), vpMath::maximum(), vpMath::minimum(), navigation(), nbrPtLimit, objectImage, poseList, projectCameraTrajectory(), px_ext, py_ext, rotz, scene, vpImageSimulator::setCameraPosition(), and SPHERE.
void vpWireFrameSimulator::getExternalImage | ( | vpImage< vpRGBa > & | I, |
vpHomogeneousMatrix | camMf | ||
) |
Get an external view. The point of view is set thanks to the pose between the camera camMf and the fixed world frame.
I | : The image where the external view is displayed. |
camMf | : The pose between the point of view and the fixed world frame. |
Definition at line 1255 of file vpWireFrameSimulator.cpp.
References camColor, camera, camMf, cMo, curColor, vpImage< Type >::display, vpDisplay::display(), display_scene(), displayCamera, displayImageSimulator, displayObject, fMo, vpImage< Type >::getHeight(), vpImageSimulator::getImage(), getInternalCameraParameters(), vpImage< Type >::getWidth(), vpHomogeneousMatrix::inverse(), vpMath::maximum(), vpMath::minimum(), objectImage, px_ext, py_ext, rotz, scene, and vpImageSimulator::setCameraPosition().
void vpWireFrameSimulator::getExternalImage | ( | vpImage< unsigned char > & | I | ) |
Get the external view. It corresponds to the view of the scene from a reference frame you have to set.
I | : The image where the external view is displayed. |
Definition at line 1397 of file vpWireFrameSimulator.cpp.
References camColor, camera, cameraTrajectory, camMf, camMf2, camTrajColor, camTrajType, cMo, CT_LINE, CT_POINT, CUBE, curColor, vpImage< Type >::display, vpDisplay::display(), display_scene(), displayCamera, displayCameraTrajectory, displayImageSimulator, vpDisplay::displayLine(), displayObject, vpDisplay::displayPoint(), extCamChanged, f2Mf, fMc, fMo, fMoList, vpImage< Type >::getHeight(), vpImageSimulator::getImage(), getInternalCameraParameters(), vpImage< Type >::getWidth(), vpHomogeneousMatrix::inverse(), vpMath::maximum(), vpMath::minimum(), navigation(), nbrPtLimit, objectImage, poseList, projectCameraTrajectory(), px_ext, py_ext, rotz, scene, vpImageSimulator::setCameraPosition(), and SPHERE.
void vpWireFrameSimulator::getExternalImage | ( | vpImage< unsigned char > & | I, |
vpHomogeneousMatrix | camMf | ||
) |
Get an external view. The point of view is set thanks to the pose between the camera camMf and the fixed world frame.
I | : The image where the external view is displayed. |
camMf | : The pose between the point of view and the fixed world frame. |
Definition at line 1538 of file vpWireFrameSimulator.cpp.
References camColor, camera, camMf, cMo, curColor, vpImage< Type >::display, vpDisplay::display(), display_scene(), displayCamera, displayImageSimulator, displayObject, fMo, vpImage< Type >::getHeight(), vpImageSimulator::getImage(), getInternalCameraParameters(), vpImage< Type >::getWidth(), vpHomogeneousMatrix::inverse(), vpMath::maximum(), vpMath::minimum(), objectImage, px_ext, py_ext, rotz, scene, and vpImageSimulator::setCameraPosition().
|
inline |
Get the parameters of the virtual internal camera.
I | : The image used to display the view of the camera. |
Definition at line 398 of file vpWireFrameSimulator.h.
References vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpMath::maximum(), and vpMath::minimum().
Referenced by getExternalImage(), and getInternalImage().
|
inline |
Get the parameters of the virtual internal camera.
I | : The image used to display the view of the camera. |
Definition at line 418 of file vpWireFrameSimulator.h.
References vpImage< Type >::getHeight(), vpImage< Type >::getWidth(), vpMath::maximum(), and vpMath::minimum().
Get the internal view ie the view of the camera.
I | : The image where the internal view is displayed. |
Definition at line 1034 of file vpWireFrameSimulator.cpp.
References cdMo, cMo, curColor, D_TOOL, desColor, desiredObject, desiredScene, vpImage< Type >::display, vpDisplay::display(), display_scene(), displayDesiredObject, displayImageSimulator, displayObject, vpImage< Type >::getHeight(), vpImageSimulator::getImage(), getInternalCameraParameters(), vpImage< Type >::getWidth(), vpHomogeneousMatrix::inverse(), vpMath::maximum(), vpMath::minimum(), vpSimulatorException::notInitializedError, objectImage, px_int, py_int, vpColor::red, rotz, scene, sceneInitialized, and vpImageSimulator::setCameraPosition().
void vpWireFrameSimulator::getInternalImage | ( | vpImage< unsigned char > & | I | ) |
Get the internal view ie the view of the camera.
I | : The image where the internal view is displayed. |
Definition at line 1319 of file vpWireFrameSimulator.cpp.
References camMf, cdMo, cMo, curColor, D_TOOL, desColor, desiredObject, desiredScene, vpImage< Type >::display, vpDisplay::display(), display_scene(), displayDesiredObject, displayImageSimulator, displayObject, fMo, vpImage< Type >::getHeight(), vpImageSimulator::getImage(), getInternalCameraParameters(), vpImage< Type >::getWidth(), vpHomogeneousMatrix::inverse(), vpMath::maximum(), vpMath::minimum(), vpSimulatorException::notInitializedError, objectImage, px_int, py_int, vpColor::red, rotz, scene, sceneInitialized, and vpImageSimulator::setCameraPosition().
void vpWireFrameSimulator::initScene | ( | vpSceneObject | obj, |
vpSceneDesiredObject | desiredObject | ||
) |
Initialize the simulator. It enables to choose the type of scene which will be used to display the object at the current position and at the desired position.
It exists several default scenes you can use. Use the vpSceneObject and the vpSceneDesiredObject attributes to use them in this method. The corresponding files are stored in the "data" folder which is in the ViSP build directory.
obj | : Type of scene used to display the object at the current position. |
desiredObject | : Type of scene used to display the object at the desired pose (in the internal view). |
Definition at line 612 of file vpWireFrameSimulator.cpp.
References camera, cameraFactor, CIRCLE, CUBE, CYLINDER, D_CIRCLE, D_STANDARD, D_TOOL, desiredObject, desiredScene, DIAMOND, displayCamera, displayDesiredObject, displayImageSimulator, displayObject, PIPE, PLAN, PLATE, POINT_CLOUD, RECTANGLE, ROAD, scene, sceneInitialized, SMALL_PLATE, SPHERE, SQUARE_10CM, THREE_LINES, THREE_PTS, TIRE, and TRAPEZOID.
Referenced by vpRobotSimulator::initScene(), and initScene().
void vpWireFrameSimulator::initScene | ( | const char * | obj, |
const char * | desiredObject | ||
) |
Initialize the simulator. It enables to choose the type of scene which will be used to display the object at the current position and at the desired position.
Here you can use the scene you want. You have to set the path to a .bnd or a .wrl file which is a 3D model file.
obj | : Path to the scene file you want to use. |
desiredObject | : Path to the scene file you want to use. |
Definition at line 743 of file vpWireFrameSimulator.cpp.
References camera, cameraFactor, D_STANDARD, desiredScene, displayCamera, displayDesiredObject, displayObject, scene, sceneInitialized, THREE_PTS, and vpERROR_TRACE.
void vpWireFrameSimulator::initScene | ( | vpSceneObject | obj | ) |
Initialize the simulator. It enables to choose the type of object which will be used to display the object at the current position. The object at the desired position is not displayed.
It exists several default scenes you can use. Use the vpSceneObject attributes to use them in this method. The corresponding files are stored in the "data" folder which is in the ViSP build directory.
obj | : Type of scene used to display the object at the current position. |
Definition at line 847 of file vpWireFrameSimulator.cpp.
References CIRCLE, CUBE, CYLINDER, DIAMOND, displayCamera, displayObject, PIPE, PLAN, PLATE, POINT_CLOUD, RECTANGLE, ROAD, scene, sceneInitialized, SMALL_PLATE, SPHERE, SQUARE_10CM, THREE_LINES, THREE_PTS, TIRE, and TRAPEZOID.
void vpWireFrameSimulator::initScene | ( | const char * | obj | ) |
Initialize the simulator. It enables to choose the type of scene which will be used to display the object at the current position. The object at the desired position is not displayed.
Here you can use the scene you want. You have to set the path to a .bnd or a .wrl file which is a 3D model file.
obj | : Path to the scene file you want to use. |
Definition at line 946 of file vpWireFrameSimulator.cpp.
References camera, cameraFactor, displayCamera, displayObject, scene, sceneInitialized, THREE_PTS, and vpERROR_TRACE.
void vpWireFrameSimulator::initScene | ( | vpSceneObject | obj, |
vpSceneDesiredObject | desiredObject, | ||
const std::list< vpImageSimulator > & | imObj | ||
) |
Initialize the simulator. It enables to choose the type of scene which will be used to display the object at the current position and at the desired position.
It exists several default scenes you can use. Use the vpSceneObject and the vpSceneDesiredObject attributes to use them in this method. The corresponding files are stored in the "data" folder which is in the ViSP build directory.
It is also possible to add a list of vpImageSimulator instances. They will be automatically projected into the image. The position of the four corners have to be given in the object frame.
obj | : Type of scene used to display the object at the current position. |
desiredObject | : Type of scene used to display the object at the desired pose (in the internal view). |
imObj | : A list of vpImageSimulator instances. |
Definition at line 725 of file vpWireFrameSimulator.cpp.
References displayImageSimulator, initScene(), and objectImage.
void vpWireFrameSimulator::initScene | ( | const char * | obj, |
const char * | desiredObject, | ||
const std::list< vpImageSimulator > & | imObj | ||
) |
Initialize the simulator. It enables to choose the type of scene which will be used to display the object at the current position and at the desired position.
Here you can use the scene you want. You have to set the path to a .bnd or a .wrl file which is a 3D model file.
It is also possible to add a list of vpImageSimulator instances. They will be automatically projected into the image. The position of the four corners have to be given in the object frame.
obj | : Path to the scene file you want to use. |
desiredObject | : Path to the scene file you want to use. |
imObj | : A list of vpImageSimulator instances. |
Definition at line 831 of file vpWireFrameSimulator.cpp.
References displayImageSimulator, initScene(), and objectImage.
void vpWireFrameSimulator::initScene | ( | vpSceneObject | obj, |
const std::list< vpImageSimulator > & | imObj | ||
) |
Initialize the simulator. It enables to choose the type of object which will be used to display the object at the current position. The object at the desired position is not displayed.
It exists several default scenes you can use. Use the vpSceneObject attributes to use them in this method. The corresponding files are stored in the "data" folder which is in the ViSP build directory.
It is also possible to add a list of vpImageSimulator instances. They will be automatically projected into the image. The position of the four corners have to be given in the object frame.
obj | : Type of scene used to display the object at the current position. |
imObj | : A list of vpImageSimulator instances. |
Definition at line 930 of file vpWireFrameSimulator.cpp.
References displayImageSimulator, initScene(), and objectImage.
void vpWireFrameSimulator::initScene | ( | const char * | obj, |
const std::list< vpImageSimulator > & | imObj | ||
) |
Initialize the simulator. It enables to choose the type of scene which will be used to display the object at the current position. The object at the desired position is not displayed.
Here you can use the scene you want. You have to set the path to a .bnd or a .wrl file which is a 3D model file.
It is also possible to add a list of vpImageSimulator instances. They will be automatically projected into the image. The position of the four corners have to be given in the object frame.
obj | : Path to the scene file you want to use. |
imObj | : A list of vpImageSimulator instances. |
Definition at line 1019 of file vpWireFrameSimulator.cpp.
References displayImageSimulator, initScene(), and objectImage.
void vpWireFrameSimulator::initScene | ( | vpSceneObject | obj, |
vpSceneDesiredObject | desiredObject, | ||
vpList< vpImageSimulator > & | imObj | ||
) |
Initialize the simulator. It enables to choose the type of scene which will be used to display the object at the current position and at the desired position.
It exists several default scenes you can use. Use the vpSceneObject and the vpSceneDesiredObject attributes to use them in this method. The corresponding files are stored in the "data" folder which is in the ViSP build directory.
It is also possible to add a list of vpImageSimulator instances. They will be automatically projected into the image. The position of the four corners have to be given in the object frame.
obj | : Type of scene used to display the object at the current position. |
desiredObject | : Type of scene used to display the object at the desired pose (in the internal view). |
imObj | : A list of vpImageSimulator instances. |
Definition at line 701 of file vpWireFrameSimulator.cpp.
References displayImageSimulator, vpList< type >::front(), initScene(), vpList< type >::next(), objectImage, vpList< type >::outside(), and vpList< type >::value().
void vpWireFrameSimulator::initScene | ( | const char * | obj, |
const char * | desiredObject, | ||
vpList< vpImageSimulator > & | imObj | ||
) |
Initialize the simulator. It enables to choose the type of scene which will be used to display the object at the current position and at the desired position.
Here you can use the scene you want. You have to set the path to a .bnd or a .wrl file which is a 3D model file.
It is also possible to add a list of vpImageSimulator instances. They will be automatically projected into the image. The position of the four corners have to be given in the object frame.
obj | : Path to the scene file you want to use. |
desiredObject | : Path to the scene file you want to use. |
imObj | : A list of vpImageSimulator instances. |
Definition at line 807 of file vpWireFrameSimulator.cpp.
References displayImageSimulator, vpList< type >::front(), initScene(), vpList< type >::next(), objectImage, vpList< type >::outside(), and vpList< type >::value().
void vpWireFrameSimulator::initScene | ( | vpSceneObject | obj, |
vpList< vpImageSimulator > & | imObj | ||
) |
Initialize the simulator. It enables to choose the type of object which will be used to display the object at the current position. The object at the desired position is not displayed.
It exists several default scenes you can use. Use the vpSceneObject attributes to use them in this method. The corresponding files are stored in the "data" folder which is in the ViSP build directory.
It is also possible to add a list of vpImageSimulator instances. They will be automatically projected into the image. The position of the four corners have to be given in the object frame.
obj | : Type of scene used to display the object at the current position. |
imObj | : A list of vpImageSimulator instances. |
Definition at line 907 of file vpWireFrameSimulator.cpp.
References displayImageSimulator, vpList< type >::front(), initScene(), vpList< type >::next(), objectImage, vpList< type >::outside(), and vpList< type >::value().
void vpWireFrameSimulator::initScene | ( | const char * | obj, |
vpList< vpImageSimulator > & | imObj | ||
) |
Initialize the simulator. It enables to choose the type of scene which will be used to display the object at the current position. The object at the desired position is not displayed.
Here you can use the scene you want. You have to set the path to a .bnd or a .wrl file which is a 3D model file.
It is also possible to add a list of vpImageSimulator instances. They will be automatically projected into the image. The position of the four corners have to be given in the object frame.
obj | : Path to the scene file you want to use. |
imObj | : A list of vpImageSimulator instances. |
Definition at line 996 of file vpWireFrameSimulator.cpp.
References displayImageSimulator, vpList< type >::front(), initScene(), vpList< type >::next(), objectImage, vpList< type >::outside(), and vpList< type >::value().
|
protected |
Enables to change the external camera position.
Definition at line 1763 of file vpWireFrameSimulator.cpp.
References blocked, blockedr, blockedt, blockedz, vpHomogeneousMatrix::buildFrom(), vpMouseButton::button1, vpMouseButton::button2, vpMouseButton::button3, vpImagePoint::get_i(), vpImagePoint::get_j(), vpDisplay::getClick(), vpDisplay::getClickUp(), vpImage< Type >::getHeight(), vpDisplay::getPointerPosition(), vpImage< Type >::getWidth(), vpMath::minimum(), old_iPr, old_iPt, old_iPz, and vpMath::rad().
Referenced by vpSimulatorAfma6::getExternalImage(), vpSimulatorViper850::getExternalImage(), and getExternalImage().
|
protected |
Enables to change the external camera position.
Definition at line 1857 of file vpWireFrameSimulator.cpp.
References blocked, blockedr, blockedt, blockedz, vpHomogeneousMatrix::buildFrom(), vpMouseButton::button1, vpMouseButton::button2, vpMouseButton::button3, vpImagePoint::get_i(), vpImagePoint::get_j(), vpDisplay::getClick(), vpDisplay::getClickUp(), vpImage< Type >::getHeight(), vpDisplay::getPointerPosition(), vpImage< Type >::getWidth(), vpMath::minimum(), old_iPr, old_iPt, old_iPz, and vpMath::rad().
|
protected |
Project the center of the internal camera into the external camera view.
Definition at line 1952 of file vpWireFrameSimulator.cpp.
References camMf, vpMeterPixelConversion::convertPoint(), vpPoint::get_x(), vpPoint::get_y(), getExternalCameraParameters(), vpHomogeneousMatrix::inverse(), rotz, vpPoint::setWorldCoordinates(), and vpForwardProjection::track().
Referenced by displayTrajectory(), and getExternalImage().
|
protected |
Project the center of the internal camera into the external camera view.
Definition at line 1970 of file vpWireFrameSimulator.cpp.
References camMf, vpMeterPixelConversion::convertPoint(), vpPoint::get_x(), vpPoint::get_y(), getExternalCameraParameters(), vpHomogeneousMatrix::inverse(), rotz, vpPoint::setWorldCoordinates(), and vpForwardProjection::track().
|
protected |
Project the center of the internal camera into the external camera view.
Definition at line 1988 of file vpWireFrameSimulator.cpp.
References vpMeterPixelConversion::convertPoint(), vpPoint::get_x(), vpPoint::get_y(), getExternalCameraParameters(), vpHomogeneousMatrix::inverse(), rotz, vpPoint::setWorldCoordinates(), and vpForwardProjection::track().
|
protected |
Project the center of the internal camera into the external camera view.
Definition at line 2006 of file vpWireFrameSimulator.cpp.
References vpMeterPixelConversion::convertPoint(), vpPoint::get_x(), vpPoint::get_y(), getExternalCameraParameters(), vpHomogeneousMatrix::inverse(), rotz, vpPoint::setWorldCoordinates(), and vpForwardProjection::track().
|
inline |
Set the pose between the object and the fixed world frame.
fMo | : The pose between the object and the fixed world frame. |
Definition at line 476 of file vpWireFrameSimulator.h.
References vpHomogeneousMatrix::inverse().
|
inline |
Set the color used to display the camera in the external view.
col | : The desired color. |
Definition at line 359 of file vpWireFrameSimulator.h.
|
inline |
Set the position of the camera relative to the object.
cMo | : The pose of the camera. |
Definition at line 316 of file vpWireFrameSimulator.h.
References vpHomogeneousMatrix::inverse().
|
inline |
Set the position of the the world reference frame relative to the camera.
fMc | : The pose of the camera. |
Definition at line 323 of file vpWireFrameSimulator.h.
References vpHomogeneousMatrix::inverse().
|
inline |
Set the parameter which enables to choose the size of the main camera in the external camera views. By default this parameter is set to 1.
factor | : The ration for the camera size. |
Definition at line 524 of file vpWireFrameSimulator.h.
|
inline |
Set the color used to display the camera trajectory in the external view.
col | : The desired color. |
Definition at line 366 of file vpWireFrameSimulator.h.
|
inline |
Set the way to display the history of the main camera trajectory in the main external view. The choice is given between displaying lines and points.
camTrajType | : The chosen way to display the camera trajectory. |
Definition at line 539 of file vpWireFrameSimulator.h.
|
inline |
Set the color used to display the object at the current position.
col | : The desired color. |
Definition at line 373 of file vpWireFrameSimulator.h.
|
inline |
Set the desired position of the camera relative to the object.
cdMo | : The desired pose of the camera. |
Definition at line 330 of file vpWireFrameSimulator.h.
Referenced by vpRobotSimulator::setDesiredCameraPosition().
|
inline |
Set the color used to display the object at the desired position.
col | : The desired color. |
Definition at line 380 of file vpWireFrameSimulator.h.
|
inline |
Enable or disable the displaying of the camera trajectory in the main external camera view.
By default the trajectory is displayed.
displayCameraTrajectory | : Set to true to display the camera trajectory. |
Definition at line 389 of file vpWireFrameSimulator.h.
|
inline |
Set the internal camera parameters.
cam | : The desired camera parameters. |
Definition at line 507 of file vpWireFrameSimulator.h.
References vpCameraParameters::get_px(), and vpCameraParameters::get_py().
Referenced by vpSimulatorAfma6::initDisplay(), and vpSimulatorViper850::initDisplay().
|
inline |
Set the external camera point of view.
camMf | : The pose of the external camera relative to the world reference frame. |
Definition at line 337 of file vpWireFrameSimulator.h.
References vpHomogeneousMatrix::buildFrom(), and vpHomogeneousMatrix::inverse().
Referenced by vpRobotSimulator::setExternalCameraPosition().
|
inline |
Set the internal camera parameters.
cam | : The desired camera parameters. |
Definition at line 497 of file vpWireFrameSimulator.h.
References vpCameraParameters::get_px(), and vpCameraParameters::get_py().
|
inline |
Set the maximum number of main camera's positions which are stored. Those position can be displayed in the external camera field of view. By default this parameter is set to 1000.
nbPt | : The desired number of position which are saved. |
Definition at line 517 of file vpWireFrameSimulator.h.
|
protected |
Definition at line 271 of file vpWireFrameSimulator.h.
Referenced by navigation(), and vpWireFrameSimulator().
|
protected |
Definition at line 268 of file vpWireFrameSimulator.h.
Referenced by navigation(), and vpWireFrameSimulator().
|
protected |
Definition at line 270 of file vpWireFrameSimulator.h.
Referenced by navigation(), and vpWireFrameSimulator().
|
protected |
Definition at line 269 of file vpWireFrameSimulator.h.
Referenced by navigation(), and vpWireFrameSimulator().
|
protected |
Definition at line 251 of file vpWireFrameSimulator.h.
Referenced by vpSimulatorAfma6::getExternalImage(), vpSimulatorViper850::getExternalImage(), getExternalImage(), and vpWireFrameSimulator().
|
protected |
Definition at line 237 of file vpWireFrameSimulator.h.
Referenced by vpSimulatorAfma6::getExternalImage(), vpSimulatorViper850::getExternalImage(), getExternalImage(), vpSimulatorAfma6::initArms(), vpSimulatorViper850::initArms(), vpRobotSimulator::initScene(), initScene(), and ~vpWireFrameSimulator().
|
protected |
Definition at line 286 of file vpWireFrameSimulator.h.
Referenced by vpSimulatorAfma6::initArms(), vpSimulatorViper850::initArms(), initScene(), and vpWireFrameSimulator().
|
protected |
Definition at line 259 of file vpWireFrameSimulator.h.
Referenced by getExternalImage(), vpWireFrameSimulator(), and ~vpWireFrameSimulator().
|
protected |
Definition at line 243 of file vpWireFrameSimulator.h.
Referenced by vpSimulatorAfma6::getExternalImage(), vpSimulatorViper850::getExternalImage(), getExternalImage(), getInternalImage(), and projectCameraTrajectory().
|
protected |
Definition at line 273 of file vpWireFrameSimulator.h.
Referenced by vpSimulatorAfma6::getExternalImage(), vpSimulatorViper850::getExternalImage(), and getExternalImage().
|
protected |
Definition at line 252 of file vpWireFrameSimulator.h.
Referenced by displayTrajectory(), getExternalImage(), and vpWireFrameSimulator().
|
protected |
Definition at line 288 of file vpWireFrameSimulator.h.
Referenced by displayTrajectory(), getExternalImage(), and vpWireFrameSimulator().
|
protected |
Definition at line 246 of file vpWireFrameSimulator.h.
Referenced by getInternalImage(), and vpRobotSimulator::getInternalView().
|
protected |
Definition at line 245 of file vpWireFrameSimulator.h.
Referenced by getExternalImage(), getInternalImage(), vpRobotSimulator::getInternalView(), vpSimulatorAfma6::initialiseObjectRelativeToCamera(), and vpSimulatorViper850::initialiseObjectRelativeToCamera().
|
protected |
Definition at line 253 of file vpWireFrameSimulator.h.
Referenced by vpSimulatorAfma6::getExternalImage(), vpSimulatorViper850::getExternalImage(), getExternalImage(), getInternalImage(), vpRobotSimulator::getInternalView(), and vpWireFrameSimulator().
|
protected |
Definition at line 254 of file vpWireFrameSimulator.h.
Referenced by getInternalImage(), vpRobotSimulator::getInternalView(), and vpWireFrameSimulator().
|
protected |
Definition at line 249 of file vpWireFrameSimulator.h.
Referenced by getInternalImage(), vpRobotSimulator::getInternalView(), and initScene().
|
protected |
Definition at line 236 of file vpWireFrameSimulator.h.
Referenced by getInternalImage(), vpRobotSimulator::getInternalView(), initScene(), and ~vpWireFrameSimulator().
|
protected |
Definition at line 283 of file vpWireFrameSimulator.h.
Referenced by vpSimulatorAfma6::getExternalImage(), vpSimulatorViper850::getExternalImage(), getExternalImage(), vpSimulatorAfma6::initArms(), vpSimulatorViper850::initArms(), vpRobotSimulator::initScene(), initScene(), vpWireFrameSimulator(), and ~vpWireFrameSimulator().
|
protected |
Definition at line 258 of file vpWireFrameSimulator.h.
Referenced by getExternalImage(), and vpWireFrameSimulator().
|
protected |
Definition at line 282 of file vpWireFrameSimulator.h.
Referenced by getInternalImage(), vpRobotSimulator::getInternalView(), initScene(), vpWireFrameSimulator(), and ~vpWireFrameSimulator().
|
protected |
Definition at line 284 of file vpWireFrameSimulator.h.
Referenced by getExternalImage(), getInternalImage(), initScene(), and vpWireFrameSimulator().
|
protected |
Definition at line 281 of file vpWireFrameSimulator.h.
Referenced by vpSimulatorAfma6::getExternalImage(), vpSimulatorViper850::getExternalImage(), getExternalImage(), getInternalImage(), vpRobotSimulator::getInternalView(), initScene(), vpWireFrameSimulator(), and ~vpWireFrameSimulator().
|
protected |
Definition at line 290 of file vpWireFrameSimulator.h.
Referenced by getExternalImage(), and vpWireFrameSimulator().
|
protected |
Definition at line 274 of file vpWireFrameSimulator.h.
Referenced by vpSimulatorAfma6::getExternalImage(), vpSimulatorViper850::getExternalImage(), and getExternalImage().
|
protected |
Definition at line 242 of file vpWireFrameSimulator.h.
Referenced by getExternalImage(), vpSimulatorAfma6::getPosition(), vpSimulatorViper850::getPosition(), vpSimulatorAfma6::initialiseCameraRelativeToObject(), vpSimulatorViper850::initialiseCameraRelativeToObject(), vpSimulatorAfma6::setPosition(), and vpSimulatorViper850::setPosition().
|
protected |
Definition at line 241 of file vpWireFrameSimulator.h.
Referenced by vpRobotSimulator::get_cMo(), vpRobotSimulator::get_fMo(), vpSimulatorAfma6::getExternalImage(), vpSimulatorViper850::getExternalImage(), getExternalImage(), getInternalImage(), vpRobotSimulator::getInternalView(), vpSimulatorAfma6::initialiseCameraRelativeToObject(), vpSimulatorViper850::initialiseCameraRelativeToObject(), vpSimulatorAfma6::initialiseObjectRelativeToCamera(), vpSimulatorViper850::initialiseObjectRelativeToCamera(), vpRobotSimulator::set_fMo(), and vpWireFrameSimulator().
|
protected |
Definition at line 261 of file vpWireFrameSimulator.h.
Referenced by getExternalImage(), vpWireFrameSimulator(), and ~vpWireFrameSimulator().
|
protected |
Definition at line 262 of file vpWireFrameSimulator.h.
Referenced by getExternalImage(), and vpWireFrameSimulator().
|
protected |
Definition at line 248 of file vpWireFrameSimulator.h.
|
protected |
Definition at line 238 of file vpWireFrameSimulator.h.
Referenced by getExternalImage(), getInternalImage(), initScene(), and vpWireFrameSimulator().
|
protected |
Definition at line 265 of file vpWireFrameSimulator.h.
Referenced by navigation(), and vpWireFrameSimulator().
|
protected |
Definition at line 267 of file vpWireFrameSimulator.h.
Referenced by navigation(), and vpWireFrameSimulator().
|
protected |
Definition at line 266 of file vpWireFrameSimulator.h.
Referenced by navigation(), and vpWireFrameSimulator().
|
protected |
Definition at line 260 of file vpWireFrameSimulator.h.
Referenced by getExternalImage(), vpWireFrameSimulator(), and ~vpWireFrameSimulator().
|
protected |
Definition at line 278 of file vpWireFrameSimulator.h.
Referenced by vpSimulatorAfma6::getExternalImage(), vpSimulatorViper850::getExternalImage(), getExternalImage(), and vpWireFrameSimulator().
|
protected |
Definition at line 276 of file vpWireFrameSimulator.h.
Referenced by vpSimulatorAfma6::getCameraParameters(), vpSimulatorViper850::getCameraParameters(), getInternalImage(), vpRobotSimulator::getInternalView(), vpSimulatorAfma6::initDisplay(), vpSimulatorViper850::initDisplay(), vpSimulatorAfma6::setCameraParameters(), vpSimulatorViper850::setCameraParameters(), and vpWireFrameSimulator().
|
protected |
Definition at line 279 of file vpWireFrameSimulator.h.
Referenced by vpSimulatorAfma6::getExternalImage(), vpSimulatorViper850::getExternalImage(), getExternalImage(), and vpWireFrameSimulator().
|
protected |
Definition at line 277 of file vpWireFrameSimulator.h.
Referenced by vpSimulatorAfma6::getCameraParameters(), vpSimulatorViper850::getCameraParameters(), getInternalImage(), vpRobotSimulator::getInternalView(), vpSimulatorAfma6::initDisplay(), vpSimulatorViper850::initDisplay(), vpSimulatorAfma6::setCameraParameters(), vpSimulatorViper850::setCameraParameters(), and vpWireFrameSimulator().
|
protected |
Definition at line 244 of file vpWireFrameSimulator.h.
|
protected |
Definition at line 292 of file vpWireFrameSimulator.h.
Referenced by displayTrajectory(), getExternalImage(), getInternalImage(), vpRobotSimulator::getInternalView(), projectCameraTrajectory(), and vpWireFrameSimulator().
|
protected |
Definition at line 235 of file vpWireFrameSimulator.h.
Referenced by vpSimulatorAfma6::getExternalImage(), vpSimulatorViper850::getExternalImage(), getExternalImage(), getInternalImage(), vpRobotSimulator::getInternalView(), initScene(), and ~vpWireFrameSimulator().
|
protected |
Definition at line 256 of file vpWireFrameSimulator.h.
Referenced by getInternalImage(), vpRobotSimulator::getInternalView(), vpSimulatorAfma6::initDisplay(), vpSimulatorViper850::initDisplay(), initScene(), vpWireFrameSimulator(), and ~vpWireFrameSimulator().