YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches

SimulatedWorld_nwc_yarp: The client side of any ISimulatedWorld capable device. More...

#include <networkWrappers/simulatedWorld_nwc_yarp/SimulatedWorld_nwc_yarp.h>

+ Inheritance diagram for SimulatedWorld_nwc_yarp:

Public Member Functions

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::dev::ISimulatedWorld
virtual ~ISimulatedWorld ()
 Destructor.
 
- Public Member Functions inherited from SimulatedWorld_nwc_yarp_ParamsParser
 SimulatedWorld_nwc_yarp_ParamsParser ()
 
 ~SimulatedWorld_nwc_yarp_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 &paramName, std::string &paramValue) 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 ()
 

Protected Attributes

yarp::os::Port m_rpcPort
 
ISimulatedWorldMsgs m_sim_RPC
 
std::mutex m_mutex
 

Additional Inherited Members

- Public Attributes inherited from SimulatedWorld_nwc_yarp_ParamsParser
const std::string m_device_classname = {"SimulatedWorld_nwc_yarp"}
 
const std::string m_device_name = {"simulatedWorld_nwc_yarp"}
 
bool m_parser_is_strict = false
 
const parser_version_type m_parser_version = {}
 
std::string m_provided_configuration
 
const std::string m_local_defaultValue = {""}
 
const std::string m_remote_defaultValue = {""}
 
const std::string m_carrier_defaultValue = {"tcp"}
 
std::string m_local = {}
 
std::string m_remote = {}
 
std::string m_carrier = {"tcp"}
 

Detailed Description

SimulatedWorld_nwc_yarp: The client side of any ISimulatedWorld capable device.

Parameters required by this device are shown in class: SimulatedWorld_nwc_yarp_ParamsParser

Definition at line 31 of file SimulatedWorld_nwc_yarp.h.

Member Function Documentation

◆ attach()

ReturnValue SimulatedWorld_nwc_yarp::attach ( std::string  id,
std::string  link_name 
)
overridevirtual

Attach an object to a link of another object.

Parameters
idstring that identifies object in gazebo
link_namename of a link
Returns
returns true or false on success failure

Implements yarp::dev::ISimulatedWorld.

Definition at line 57 of file SimulatedWorld_nwc_yarp.cpp.

◆ changeColor()

ReturnValue SimulatedWorld_nwc_yarp::changeColor ( std::string  id,
yarp::sig::ColorRGB  color 
)
overridevirtual

Change the color of an object.

Parameters
idobject id
colorthe color of the frame
Returns
returns true or false on success failure

Implements yarp::dev::ISimulatedWorld.

Definition at line 112 of file SimulatedWorld_nwc_yarp.cpp.

◆ close()

bool SimulatedWorld_nwc_yarp::close ( )
overridevirtual

Close the DeviceDriver.

Returns
true/false on success/failure.

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 51 of file SimulatedWorld_nwc_yarp.cpp.

◆ deleteAll()

ReturnValue SimulatedWorld_nwc_yarp::deleteAll ( )
overridevirtual

Delete all objects in the world.

Returns
returns true or false on success failure

Implements yarp::dev::ISimulatedWorld.

Definition at line 201 of file SimulatedWorld_nwc_yarp.cpp.

◆ deleteObject()

ReturnValue SimulatedWorld_nwc_yarp::deleteObject ( std::string  id)
overridevirtual

Delete an object.

Parameters
idstring that identifies object in gazebo
Returns
returns true or false on success failure

Implements yarp::dev::ISimulatedWorld.

Definition at line 190 of file SimulatedWorld_nwc_yarp.cpp.

◆ detach()

ReturnValue SimulatedWorld_nwc_yarp::detach ( std::string  id)
overridevirtual

Detach a previously attached object.

Parameters
idstring that identifies object in gazebo
Returns
returns true or false on success failure

Implements yarp::dev::ISimulatedWorld.

Definition at line 225 of file SimulatedWorld_nwc_yarp.cpp.

◆ enableCollision()

ReturnValue SimulatedWorld_nwc_yarp::enableCollision ( std::string  id,
bool  enable 
)
overridevirtual

Enable/disables collision detection for an object.

Parameters
idobject id
enable1 to enable collision detection, 0 otherwise
Returns
returns true or false on success failure

Implements yarp::dev::ISimulatedWorld.

Definition at line 145 of file SimulatedWorld_nwc_yarp.cpp.

◆ enableGravity()

ReturnValue SimulatedWorld_nwc_yarp::enableGravity ( std::string  id,
bool  enable 
)
overridevirtual

Enable/disables gravity for an object.

Parameters
idobject id
enable1 to enable gravity, 0 otherwise
Returns
returns true or false on success failure

Implements yarp::dev::ISimulatedWorld.

Definition at line 134 of file SimulatedWorld_nwc_yarp.cpp.

◆ getList()

ReturnValue SimulatedWorld_nwc_yarp::getList ( std::vector< std::string > &  names)
overridevirtual

List id of all objects that have been added to the world.

Returns
returns true or false on success failure

Implements yarp::dev::ISimulatedWorld.

Definition at line 212 of file SimulatedWorld_nwc_yarp.cpp.

◆ getPose()

ReturnValue SimulatedWorld_nwc_yarp::getPose ( std::string  id,
yarp::sig::Pose6D &  pose,
std::string  frame_name 
)
overridevirtual

Get object pose.

Parameters
idobject 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.
Returns
returns true or false on success failure

Implements yarp::dev::ISimulatedWorld.

Definition at line 156 of file SimulatedWorld_nwc_yarp.cpp.

◆ makeActor()

ReturnValue SimulatedWorld_nwc_yarp::makeActor ( std::string  id,
std::string  skin_filename,
std::string  animation_filename,
yarp::sig::Pose6D  pose 
)
overridevirtual

Create an actor.

Parameters
idthe name of the object to create
skin_filenamestring that specifies the name of the model to load
animation_filenamestring that specifies the name of the animation to load (e.g. walking, running, etc.)
posethe initial pose of the object [m]
Returns
returns true or false on success failure

Implements yarp::dev::ISimulatedWorld.

Definition at line 179 of file SimulatedWorld_nwc_yarp.cpp.

◆ makeBox()

ReturnValue SimulatedWorld_nwc_yarp::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 
)
overridevirtual

Make a box.

Parameters
idthe name of the object to create
widthbox width [m]
heightbox height[m]
thicknessbox thickness [m]
posethe pose of the box [m]
colorthe 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)
Returns
returns true or false on success failure

Implements yarp::dev::ISimulatedWorld.

Definition at line 79 of file SimulatedWorld_nwc_yarp.cpp.

◆ makeCylinder()

ReturnValue SimulatedWorld_nwc_yarp::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 
)
overridevirtual

Make a cylinder.

Parameters
idthe name of the object to create
radiusthe radius of the cylinder [m]
lengththe length of the cylinder [m]
posethe pose of the cylinder [m]
colorthe 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)
Returns
returns true or false on success failure

Implements yarp::dev::ISimulatedWorld.

Definition at line 90 of file SimulatedWorld_nwc_yarp.cpp.

◆ makeFrame()

ReturnValue SimulatedWorld_nwc_yarp::makeFrame ( std::string  id,
double  size,
yarp::sig::Pose6D  pose,
yarp::sig::ColorRGB  color,
std::string  frame_name,
bool  gravity_enable,
bool  collision_enable 
)
overridevirtual

Make a reference frame (a 3D model with 3 arrows representing the axes)

Parameters
idthe name of the object to create
sizethe size of the frame [m]
posethe pose of the frame [m]
colorthe 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)
Returns
returns true or false on success failure

Implements yarp::dev::ISimulatedWorld.

Definition at line 101 of file SimulatedWorld_nwc_yarp.cpp.

◆ makeModel()

ReturnValue SimulatedWorld_nwc_yarp::makeModel ( std::string  id,
std::string  filename,
yarp::sig::Pose6D  pose,
std::string  frame_name,
bool  gravity_enable,
bool  collision_enable 
)
overridevirtual

Create a model from a file.

Parameters
idthe name of the object to create
filenamestring that specifies the name of the model to load
posethe initial pose of the object [m]
Returns
returns true or false on success failure

Implements yarp::dev::ISimulatedWorld.

Definition at line 168 of file SimulatedWorld_nwc_yarp.cpp.

◆ makeSphere()

ReturnValue SimulatedWorld_nwc_yarp::makeSphere ( std::string  id,
double  radius,
yarp::sig::Pose6D  pose,
yarp::sig::ColorRGB  color,
std::string  frame_name,
bool  gravity_enable,
bool  collision_enable 
)
overridevirtual

Make a sphere.

Parameters
idthe name of the object to create
radiusthe radius of the sphere [m]
posethe pose of the sphere [m]
colorthe 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)
Returns
returns true or false on success failure

Implements yarp::dev::ISimulatedWorld.

Definition at line 68 of file SimulatedWorld_nwc_yarp.cpp.

◆ open()

bool SimulatedWorld_nwc_yarp::open ( yarp::os::Searchable &  config)
overridevirtual

Open the DeviceDriver.

Parameters
configis 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).
Returns
true/false upon success/failure

Reimplemented from yarp::dev::DeviceDriver.

Definition at line 21 of file SimulatedWorld_nwc_yarp.cpp.

◆ rename()

ReturnValue SimulatedWorld_nwc_yarp::rename ( std::string  old_name,
std::string  new_name 
)
overridevirtual

Change the names of an object.

Parameters
old_namestring that identifies object in gazebo
new_namestring that will be used as new name
Returns
returns true or false on success failure

Implements yarp::dev::ISimulatedWorld.

Definition at line 236 of file SimulatedWorld_nwc_yarp.cpp.

◆ setPose()

ReturnValue SimulatedWorld_nwc_yarp::setPose ( std::string  id,
yarp::sig::Pose6D  pose,
std::string  frame_name 
)
overridevirtual

Set new object pose.

Parameters
idobject id
posenew 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.
Returns
returns true or false on success failure

Implements yarp::dev::ISimulatedWorld.

Definition at line 123 of file SimulatedWorld_nwc_yarp.cpp.

Member Data Documentation

◆ m_mutex

std::mutex SimulatedWorld_nwc_yarp::m_mutex
protected

Definition at line 39 of file SimulatedWorld_nwc_yarp.h.

◆ m_rpcPort

yarp::os::Port SimulatedWorld_nwc_yarp::m_rpcPort
protected

Definition at line 37 of file SimulatedWorld_nwc_yarp.h.

◆ m_sim_RPC

ISimulatedWorldMsgs SimulatedWorld_nwc_yarp::m_sim_RPC
protected

Definition at line 38 of file SimulatedWorld_nwc_yarp.h.


The documentation for this class was generated from the following files: