gazebo-yarp-plugins
Gazebo Plugins exposing YARP interfaces.
Loading...
Searching...
No Matches
WorldInterfaceServerImpl Class Reference

#include <worldinterfaceserverimpl.h>

Inheritance diagram for WorldInterfaceServerImpl:
Collaboration diagram for WorldInterfaceServerImpl:

Public Member Functions

 WorldInterfaceServerImpl ()
 
 ~WorldInterfaceServerImpl ()
 
virtual std::string makeSphere (const double radius, const GazeboYarpPlugins::Pose &pose, const GazeboYarpPlugins::Color &color, const std::string &frame_name="", const std::string &object_name="", const bool gravity_enable=0, const bool collision_enable=1)
 Make a shpere.
 
virtual std::string makeBox (const double width, const double height, const double thickness, const GazeboYarpPlugins::Pose &pose, const GazeboYarpPlugins::Color &color, const std::string &frame_name="", const std::string &object_name="", const bool gravity_enable=0, const bool collision_enable=1)
 Make a shpere.
 
virtual std::string makeCylinder (const double radius, const double length, const GazeboYarpPlugins::Pose &pose, const GazeboYarpPlugins::Color &color, const std::string &frame_name="", const std::string &object_name="", const bool gravity_enable=0, const bool collision_enable=1)
 Make a cylinder.
 
virtual bool setPose (const std::string &id, const GazeboYarpPlugins::Pose &pose, const std::string &frame_name="")
 Set new object pose.
 
virtual GazeboYarpPlugins::Pose getPose (const std::string &id, const std::string &frame_name="")
 Get object pose.
 
virtual bool enableGravity (const std::string &id, const bool enable)
 Enable/disables gravity for an object.
 
virtual bool enableCollision (const std::string &id, const bool enable)
 Enable/disables collision detection for an object.
 
virtual bool loadModelFromFile (const std::string &filename)
 Load a model from file.
 
virtual std::string loadModelFromFileWithPose (const std::string &filename, const GazeboYarpPlugins::Pose &pose, const std::string &object_name="", const double timeout=2.0)
 Load a model from file.
 
virtual std::string makeFrame (const double size, const GazeboYarpPlugins::Pose &pose, const GazeboYarpPlugins::Color &color, const std::string &frame_name="", const std::string &object_name="", const bool gravity_enable=0, const bool collision_enable=1)
 Make a reference frame.
 
virtual bool changeColor (const std::string &id, const GazeboYarpPlugins::Color &color)
 Change the color of an object.
 
virtual bool deleteObject (const std::string &id)
 Delete an object.
 
virtual bool deleteAll ()
 Delete all objects in the world.
 
virtual std::vector< std::string > getList ()
 List id of all objects that have been added to the world.
 
virtual bool attach (const std::string &id, const std::string &link_name)
 Get attach an object to a link of the robot.
 
virtual bool detach (const std::string &id)
 Detach a previously attached object.
 
virtual bool rename (const std::string &old_name, const std::string &new_name)
 Change the names of an object.
 
void attachWorldProxy (WorldProxy *p)
 
virtual std::vector< std::string > help (const std::string &functionName="--all")
 
virtual std::vector< std::string > help (const std::string &functionName="--all")
 
bool read (yarp::os::ConnectionReader &connection) override
 
bool read (yarp::os::ConnectionReader &connection) override
 

Constructor & Destructor Documentation

◆ WorldInterfaceServerImpl()

WorldInterfaceServerImpl::WorldInterfaceServerImpl ( )

◆ ~WorldInterfaceServerImpl()

WorldInterfaceServerImpl::~WorldInterfaceServerImpl ( )

Member Function Documentation

◆ makeSphere()

std::string WorldInterfaceServerImpl::makeSphere ( const double radius,
const GazeboYarpPlugins::Pose & pose,
const GazeboYarpPlugins::Color & color,
const std::string & frame_name = "",
const std::string & object_name = "",
const bool gravity_enable = 0,
const bool collision_enable = 1 )
virtual

Make a shpere.

Parameters
radiusradius of the sphere [m]
posepose of the sphere [m]
colorcolor of the sphere
Returns
returns a string that contains the name of the object in the world or empty string on error

Reimplemented from GazeboYarpPlugins::WorldInterfaceServer.

◆ makeBox()

std::string WorldInterfaceServerImpl::makeBox ( const double width,
const double height,
const double thickness,
const GazeboYarpPlugins::Pose & pose,
const GazeboYarpPlugins::Color & color,
const std::string & frame_name = "",
const std::string & object_name = "",
const bool gravity_enable = 0,
const bool collision_enable = 1 )
virtual

Make a shpere.

Parameters
widthbox width [m]
heightbox height[m]
thicknessbox thickness [m]
posepose of the box [m]
colorcolor of the box
Returns
returns a string that contains the name of the object in the world or empty string on error

Reimplemented from GazeboYarpPlugins::WorldInterfaceServer.

◆ makeCylinder()

std::string WorldInterfaceServerImpl::makeCylinder ( const double radius,
const double length,
const GazeboYarpPlugins::Pose & pose,
const GazeboYarpPlugins::Color & color,
const std::string & frame_name = "",
const std::string & object_name = "",
const bool gravity_enable = 0,
const bool collision_enable = 1 )
virtual

Make a cylinder.

Parameters
radiusradius of the cylinder [m]
lengthlength of the cylinder [m]
posepose of the cylinder [m]
colorcolor of the cylinder
Returns
returns a string that contains the name of the object in the world or empty string on error

Reimplemented from GazeboYarpPlugins::WorldInterfaceServer.

◆ setPose()

bool WorldInterfaceServerImpl::setPose ( const std::string & id,
const GazeboYarpPlugins::Pose & pose,
const std::string & frame_name = "" )
virtual

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

Reimplemented from GazeboYarpPlugins::WorldInterfaceServer.

◆ getPose()

GazeboYarpPlugins::Pose WorldInterfaceServerImpl::getPose ( const std::string & id,
const std::string & frame_name = "" )
virtual

Get object pose.

Parameters
idstring that identifies object in gazebo (returned after creation)
frame_name(optional) is specified, the pose will be relative to the specified fully scoped frame (e.g. MODEL1::link). Otherwise, world it will be used.
Returns
returns value of the pose in the world reference frame

Reimplemented from GazeboYarpPlugins::WorldInterfaceServer.

◆ enableGravity()

bool WorldInterfaceServerImpl::enableGravity ( const std::string & id,
const bool enable )
virtual

Enable/disables gravity for an object.

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

Reimplemented from GazeboYarpPlugins::WorldInterfaceServer.

◆ enableCollision()

bool WorldInterfaceServerImpl::enableCollision ( const std::string & id,
const bool enable )
virtual

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

Reimplemented from GazeboYarpPlugins::WorldInterfaceServer.

◆ loadModelFromFile()

bool WorldInterfaceServerImpl::loadModelFromFile ( const std::string & filename)
virtual

Load a model from file.

Parameters
filenamestring that specifies the filename of the model
Returns
returns true/false on success failure.

Reimplemented from GazeboYarpPlugins::WorldInterfaceServer.

◆ loadModelFromFileWithPose()

std::string WorldInterfaceServerImpl::loadModelFromFileWithPose ( const std::string & filename,
const GazeboYarpPlugins::Pose & pose,
const std::string & object_name = "",
const double timeout = 2.0 )
virtual

Load a model from file.

Parameters
filenamestring that specifies the filename of the model
posepose to place the model at [m]
object_name(optional) assigns a name to the object.
timeout(optional) time for the creation of the model [s]
Returns
returns a string that contains the name of the object in the world or empty string on error

Reimplemented from GazeboYarpPlugins::WorldInterfaceServer.

◆ makeFrame()

std::string WorldInterfaceServerImpl::makeFrame ( const double size,
const GazeboYarpPlugins::Pose & pose,
const GazeboYarpPlugins::Color & color,
const std::string & frame_name = "",
const std::string & object_name = "",
const bool gravity_enable = 0,
const bool collision_enable = 1 )
virtual

Make a reference frame.

Parameters
sizesize of the frame [m]
posepose of the frame [m]
colorcolor of the frame
Returns
returns a string that contains the name of the object in the world or empty string on error

Reimplemented from GazeboYarpPlugins::WorldInterfaceServer.

◆ changeColor()

bool WorldInterfaceServerImpl::changeColor ( const std::string & id,
const GazeboYarpPlugins::Color & color )
virtual

Change the color of an object.

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

Reimplemented from GazeboYarpPlugins::WorldInterfaceServer.

◆ deleteObject()

bool WorldInterfaceServerImpl::deleteObject ( const std::string & id)
virtual

Delete an object.

Parameters
idstring that identifies object in gazebo (returned after creation)
Returns
returns true/false on success failure.

Reimplemented from GazeboYarpPlugins::WorldInterfaceServer.

◆ deleteAll()

bool WorldInterfaceServerImpl::deleteAll ( )
virtual

Delete all objects in the world.

Reimplemented from GazeboYarpPlugins::WorldInterfaceServer.

◆ getList()

std::vector< std::string > WorldInterfaceServerImpl::getList ( )
virtual

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

Returns
return a list of string containing the id of the objects

Reimplemented from GazeboYarpPlugins::WorldInterfaceServer.

◆ attach()

bool WorldInterfaceServerImpl::attach ( const std::string & id,
const std::string & link_name )
virtual

Get attach an object to a link of the robot.

Parameters
idstring that identifies object in gazebo (returned after creation)
link_namename of a link of the robot
Returns
true if success, false otherwise

Reimplemented from GazeboYarpPlugins::WorldInterfaceServer.

◆ detach()

bool WorldInterfaceServerImpl::detach ( const std::string & id)
virtual

Detach a previously attached object.

Parameters
idstring that identifies object in gazebo (returned after creation)
Returns
true if success, false otherwise

Reimplemented from GazeboYarpPlugins::WorldInterfaceServer.

◆ rename()

bool WorldInterfaceServerImpl::rename ( const std::string & old_name,
const std::string & new_name )
virtual

Change the names of an object.

Parameters
old_namestring that identifies object in gazebo
new_namestring that will be used as new name
Returns
true if success, false otherwise

Reimplemented from GazeboYarpPlugins::WorldInterfaceServer.

◆ attachWorldProxy()

void WorldInterfaceServerImpl::attachWorldProxy ( WorldProxy * p)
inline

◆ help() [1/2]

std::vector< std::string > GazeboYarpPlugins::WorldInterfaceServer::help ( const std::string & functionName = "--all")
virtualinherited

◆ help() [2/2]

virtual std::vector< std::string > GazeboYarpPlugins::WorldInterfaceServer::help ( const std::string & functionName = "--all")
virtualinherited

◆ read() [1/2]

bool GazeboYarpPlugins::WorldInterfaceServer::read ( yarp::os::ConnectionReader & connection)
overrideinherited

◆ read() [2/2]

bool GazeboYarpPlugins::WorldInterfaceServer::read ( yarp::os::ConnectionReader & connection)
overrideinherited

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