fakeSimulatedWorld : fake device implementing the ISimulatedWorld interface.
More...
#include <fake/fakeSimulatedWorld/FakeSimulatedWorld.h>
Inheritance diagram for FakeSimulatedWorld:Public Member Functions | |
| FakeSimulatedWorld () | |
| FakeSimulatedWorld (const FakeSimulatedWorld &)=delete | |
| FakeSimulatedWorld (FakeSimulatedWorld &&)=delete | |
| FakeSimulatedWorld & | operator= (const FakeSimulatedWorld &)=delete |
| FakeSimulatedWorld & | operator= (FakeSimulatedWorld &&)=delete |
| ~FakeSimulatedWorld () override | |
| bool | open (yarp::os::Searchable &config) override |
| Open the DeviceDriver. | |
| bool | close () override |
| Close the DeviceDriver. | |
| yarp::dev::ReturnValue | makeSphere (std::string id, double radius, yarp::sig::Pose6D pose, yarp::sig::ColorRGB color, std::string frame_name, bool gravity_enable, bool collision_enable) override |
| Make a sphere. | |
| yarp::dev::ReturnValue | makeBox (std::string id, double width, double height, double thickness, yarp::sig::Pose6D pose, yarp::sig::ColorRGB color, std::string frame_name, bool gravity_enable, bool collision_enable) override |
| Make a box. | |
| yarp::dev::ReturnValue | makeCylinder (std::string id, double radius, double length, yarp::sig::Pose6D pose, yarp::sig::ColorRGB color, std::string frame_name, bool gravity_enable, bool collision_enable) override |
| Make a cylinder. | |
| yarp::dev::ReturnValue | makeFrame (std::string id, double size, yarp::sig::Pose6D pose, yarp::sig::ColorRGB color, std::string frame_name, bool gravity_enable, bool collision_enable) override |
| Make a reference frame (a 3D model with 3 arrows representing the axes) | |
| yarp::dev::ReturnValue | makeModel (std::string id, std::string filename, yarp::sig::Pose6D pose, std::string frame_name, bool gravity_enable, bool collision_enable) override |
| Create a model from a file. | |
| yarp::dev::ReturnValue | makeActor (std::string id, std::string skin_filename, std::string animation_filename, yarp::sig::Pose6D pose) override |
| Create an actor. | |
| yarp::dev::ReturnValue | changeColor (std::string id, yarp::sig::ColorRGB color) override |
| Change the color of an object. | |
| yarp::dev::ReturnValue | setPose (std::string id, yarp::sig::Pose6D pose, std::string frame_name) override |
| Set new object pose. | |
| yarp::dev::ReturnValue | enableGravity (std::string id, bool enable) override |
| Enable/disables gravity for an object. | |
| yarp::dev::ReturnValue | enableCollision (std::string id, bool enable) override |
| Enable/disables collision detection for an object. | |
| yarp::dev::ReturnValue | getPose (std::string id, yarp::sig::Pose6D &pose, std::string frame_name) override |
| Get object pose. | |
| yarp::dev::ReturnValue | deleteObject (std::string id) override |
| Delete an object. | |
| yarp::dev::ReturnValue | deleteAll () override |
| Delete all objects in the world. | |
| yarp::dev::ReturnValue | getList (std::vector< std::string > &names) override |
| List id of all objects that have been added to the world. | |
| yarp::dev::ReturnValue | attach (std::string id, std::string link_name) override |
| Attach an object to a link of another object. | |
| yarp::dev::ReturnValue | detach (std::string id) override |
| Detach a previously attached object. | |
| yarp::dev::ReturnValue | rename (std::string old_name, std::string new_name) override |
| Change the names of an object. | |
Public Member Functions inherited from yarp::dev::DeviceDriver | |
| DeviceDriver () | |
| DeviceDriver (const DeviceDriver &other)=delete | |
| DeviceDriver (DeviceDriver &&other) noexcept=delete | |
| DeviceDriver & | operator= (const DeviceDriver &other)=delete |
| DeviceDriver & | operator= (DeviceDriver &&other) noexcept=delete |
| virtual | ~DeviceDriver () |
| virtual std::string | id () const |
| Return the id assigned to the PolyDriver. | |
| virtual void | setId (const std::string &id) |
| Set the id for this device. | |
| template<class T > | |
| bool | view (T *&x) |
| Get an interface to the device driver. | |
| virtual DeviceDriver * | getImplementation () |
| Some drivers are bureaucrats, pointing at others. | |
Public Member Functions inherited from yarp::os::PeriodicThread | |
| PeriodicThread (double period, ShouldUseSystemClock useSystemClock=ShouldUseSystemClock::No, PeriodicThreadClock clockAccuracy=PeriodicThreadClock::Relative) | |
| Constructor. | |
| PeriodicThread (double period, PeriodicThreadClock clockAccuracy) | |
| Constructor. | |
| virtual | ~PeriodicThread () |
| bool | start () |
| Call this to start the thread. | |
| void | step () |
| Call this to "step" the thread rather than starting it. | |
| void | stop () |
| Call this to stop the thread, this call blocks until the thread is terminated (and releaseThread() called). | |
| void | askToStop () |
| Stop the thread. | |
| bool | isRunning () const |
| Returns true when the thread is started, false otherwise. | |
| bool | isSuspended () const |
| Returns true when the thread is suspended, false otherwise. | |
| bool | setPeriod (double period) |
| Set the (new) period of the thread. | |
| double | getPeriod () const |
| Return the current period of the thread. | |
| void | suspend () |
| Suspend the thread, the thread keeps running by doLoop is never executed. | |
| void | resume () |
| Resume the thread if previously suspended. | |
| void | resetStat () |
| Reset thread statistics. | |
| double | getEstimatedPeriod () const |
| Return estimated period since last reset. | |
| void | getEstimatedPeriod (double &av, double &std) const |
| Return estimated period since last reset. | |
| unsigned int | getIterations () const |
| Return the number of iterations performed since last reset. | |
| double | getEstimatedUsed () const |
| Return the estimated duration of the run() function since last reset. | |
| void | getEstimatedUsed (double &av, double &std) const |
| Return estimated duration of the run() function since last reset. | |
| int | setPriority (int priority, int policy=-1) |
| Set the priority and scheduling policy of the thread, if the OS supports that. | |
| int | getPriority () const |
| Query the current priority of the thread, if the OS supports that. | |
| int | getPolicy () const |
| Query the current scheduling policy of the thread, if the OS supports that. | |
Public Member Functions inherited from yarp::dev::ISimulatedWorld | |
| virtual | ~ISimulatedWorld () |
| Destructor. | |
Public Member Functions inherited from FakeSimulatedWorld_ParamsParser | |
| FakeSimulatedWorld_ParamsParser () | |
| ~FakeSimulatedWorld_ParamsParser () override=default | |
| bool | parseParams (const yarp::os::Searchable &config) override |
| Parse the DeviceDriver parameters. | |
| std::string | getDeviceClassName () const override |
| Get the name of the DeviceDriver class. | |
| std::string | getDeviceName () const override |
| Get the name of the device (i.e. | |
| std::string | getDocumentationOfDeviceParams () const override |
| Get the documentation of the DeviceDriver's parameters. | |
| std::vector< std::string > | getListOfParams () const override |
| Return a list of all params used by the device. | |
| bool | getParamValue (const std::string ¶mName, std::string ¶mValue) const override |
| Return the value (represented as a string) of the requested parameter. | |
| std::string | getConfiguration () const override |
| Return the configuration of the device. | |
Public Member Functions inherited from yarp::dev::IDeviceDriverParams | |
| virtual | ~IDeviceDriverParams () |
Additional Inherited Members | |
Public Attributes inherited from FakeSimulatedWorld_ParamsParser | |
| const std::string | m_device_classname = {"FakeSimulatedWorld"} |
| const std::string | m_device_name = {"fakeSimulatedWorld"} |
| bool | m_parser_is_strict = false |
| const parser_version_type | m_parser_version = {} |
| std::string | m_provided_configuration |
| const std::string | m_period_defaultValue = {"10"} |
| int | m_period = {10} |
Protected Member Functions inherited from yarp::os::PeriodicThread | |
| virtual void | threadRelease () |
| Release method. | |
| virtual void | beforeStart () |
| Called just before a new thread starts. | |
| virtual void | afterStart (bool success) |
| Called just after a new thread starts (or fails to start), this is executed by the same thread that calls start(). | |
fakeSimulatedWorld : fake device implementing the ISimulatedWorld interface.
Parameters required by this device are shown in class: FakeSimulatedWorld_ParamsParser
Definition at line 20 of file FakeSimulatedWorld.h.
| FakeSimulatedWorld::FakeSimulatedWorld | ( | ) |
Definition at line 21 of file FakeSimulatedWorld.cpp.
|
delete |
|
delete |
|
override |
Definition at line 26 of file FakeSimulatedWorld.cpp.
|
overridevirtual |
Attach an object to a link of another object.
| id | string that identifies object in gazebo |
| link_name | name of a link |
Implements yarp::dev::ISimulatedWorld.
Definition at line 125 of file FakeSimulatedWorld.cpp.
|
overridevirtual |
Change the color of an object.
| id | object id |
| color | the color of the frame |
Implements yarp::dev::ISimulatedWorld.
Definition at line 75 of file FakeSimulatedWorld.cpp.
|
overridevirtual |
Close the DeviceDriver.
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 39 of file FakeSimulatedWorld.cpp.
|
overridevirtual |
Delete all objects in the world.
Implements yarp::dev::ISimulatedWorld.
Definition at line 115 of file FakeSimulatedWorld.cpp.
|
overridevirtual |
Delete an object.
| id | string that identifies object in gazebo |
Implements yarp::dev::ISimulatedWorld.
Definition at line 110 of file FakeSimulatedWorld.cpp.
|
overridevirtual |
Detach a previously attached object.
| id | string that identifies object in gazebo |
Implements yarp::dev::ISimulatedWorld.
Definition at line 130 of file FakeSimulatedWorld.cpp.
|
overridevirtual |
Enable/disables collision detection for an object.
| id | object id |
| enable | 1 to enable collision detection, 0 otherwise |
Implements yarp::dev::ISimulatedWorld.
Definition at line 90 of file FakeSimulatedWorld.cpp.
|
overridevirtual |
Enable/disables gravity for an object.
| id | object id |
| enable | 1 to enable gravity, 0 otherwise |
Implements yarp::dev::ISimulatedWorld.
Definition at line 85 of file FakeSimulatedWorld.cpp.
|
overridevirtual |
List id of all objects that have been added to the world.
Implements yarp::dev::ISimulatedWorld.
Definition at line 120 of file FakeSimulatedWorld.cpp.
|
overridevirtual |
Get object pose.
| id | object id |
| frame_name | (optional) is specified, the pose will be relative to the specified fully scoped frame (e.g. MODEL_ID::FRAME_ID). Otherwise, world it will be used. |
Implements yarp::dev::ISimulatedWorld.
Definition at line 95 of file FakeSimulatedWorld.cpp.
|
overridevirtual |
Create an actor.
| id | the name of the object to create |
| skin_filename | string that specifies the name of the model to load |
| animation_filename | string that specifies the name of the animation to load (e.g. walking, running, etc.) |
| pose | the initial pose of the object [m] |
Implements yarp::dev::ISimulatedWorld.
Definition at line 105 of file FakeSimulatedWorld.cpp.
|
overridevirtual |
Make a box.
| id | the name of the object to create |
| width | box width [m] |
| height | box height[m] |
| thickness | box thickness [m] |
| pose | the pose of the box [m] |
| color | the color of the box |
| frame_name | (optional) is specified, the pose will be relative to the specified fully scoped frame (e.g. MODEL_ID::FRAME_ID). Otherwise, world it will be used. |
| gravity_enable | (optional) enables gravity (default false) |
| collision_enable | (optional) enables collision (default true) |
Implements yarp::dev::ISimulatedWorld.
Definition at line 60 of file FakeSimulatedWorld.cpp.
|
overridevirtual |
Make a cylinder.
| id | the name of the object to create |
| radius | the radius of the cylinder [m] |
| length | the length of the cylinder [m] |
| pose | the pose of the cylinder [m] |
| color | the color of the cylinder |
| frame_name | (optional) is specified, the pose will be relative to the specified fully scoped frame (e.g. MODEL_ID::FRAME_ID). Otherwise, world it will be used. |
| object_name | (optional) assigns a name to the object. |
| gravity_enable | (optional) enables gravity (default false) |
| collision_enable | (optional) enables collision (default true) |
Implements yarp::dev::ISimulatedWorld.
Definition at line 65 of file FakeSimulatedWorld.cpp.
|
overridevirtual |
Make a reference frame (a 3D model with 3 arrows representing the axes)
| id | the name of the object to create |
| size | the size of the frame [m] |
| pose | the pose of the frame [m] |
| color | the color of the frame |
| frame_name | (optional) is specified, the pose will be relative to the specified fully scoped frame (e.g. MODEL_ID::FRAME_ID). Otherwise, world it will be used. |
| object_name | (optional) assigns a name to the object. |
| gravity_enable | (optional) enables gravity (default false) |
| collision_enable | (optional) enables collision (default true) |
Implements yarp::dev::ISimulatedWorld.
Definition at line 70 of file FakeSimulatedWorld.cpp.
|
overridevirtual |
Create a model from a file.
| id | the name of the object to create |
| filename | string that specifies the name of the model to load |
| pose | the initial pose of the object [m] |
Implements yarp::dev::ISimulatedWorld.
Definition at line 100 of file FakeSimulatedWorld.cpp.
|
overridevirtual |
Make a sphere.
| id | the name of the object to create |
| radius | the radius of the sphere [m] |
| pose | the pose of the sphere [m] |
| color | the color of the sphere |
| frame_name | (optional) is specified, the pose will be relative to the specified fully scoped frame (e.g. MODEL_ID::FRAME_ID). Otherwise, world it will be used. |
| gravity_enable | (optional) enables gravity (default false) |
| collision_enable | (optional) enables collision (default true) |
Implements yarp::dev::ISimulatedWorld.
Definition at line 55 of file FakeSimulatedWorld.cpp.
|
overridevirtual |
Open the DeviceDriver.
| config | is a list of parameters for the device. Which parameters are effective for your device can vary. If there is no example for your device, you can run the "yarpdev" program with the verbose flag set to probe what parameters the device is checking. If that fails too, you'll need to read the source code (please nag one of the yarp developers to add documentation for your device). |
Reimplemented from yarp::dev::DeviceDriver.
Definition at line 31 of file FakeSimulatedWorld.cpp.
|
delete |
|
delete |
|
overridevirtual |
Change the names of an object.
| old_name | string that identifies object in gazebo |
| new_name | string that will be used as new name |
Implements yarp::dev::ISimulatedWorld.
Definition at line 135 of file FakeSimulatedWorld.cpp.
|
overridevirtual |
Set new object pose.
| id | object id |
| pose | new pose |
| frame_name | (optional) is specified, the pose will be relative to the specified fully scoped frame (e.g. MODEL_ID::FRAME_ID). Otherwise, world it will be used. |
Implements yarp::dev::ISimulatedWorld.
Definition at line 80 of file FakeSimulatedWorld.cpp.