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

#include <worldproxy.h>

Inheritance diagram for WorldProxy:
Collaboration diagram for WorldProxy:

Public Member Functions

 WorldProxy ()
 
 ~WorldProxy ()
 
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, const bool collision_enable)
 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, const bool collision_enable)
 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, const bool collision_enable)
 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 deleteObject (const std::string &id)
 Delete an object.
 
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, const bool collision_enable)
 Make a reference frame.
 
virtual bool changeColor (const std::string &id, const GazeboYarpPlugins::Color &color)
 Change the color of 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 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)
 Load a model from file.
 
virtual bool attach (const std::string &id, const std::string &link_name)
 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 attachWorldPointer (gazebo::physics::WorldPtr p)
 
void attachModelPointer (gazebo::physics::ModelPtr p)
 
void update (const gazebo::common::UpdateInfo &)
 
void waitForEngine ()
 Wait for engine to perform update step.
 
void signalEngine ()
 Signal engine has performed one step.
 
bool isSynchronous ()
 Check if we have need to synchronize with the engine.
 
void setSynchronousMode (bool f)
 Set if requests synchronize with the engine update or not.
 
gazebo::physics::LinkPtr HELPER_getLinkInModel (gazebo::physics::ModelPtr model, std::string link_name)
 
gazebo::physics::LinkPtr HELPER_getLink (std::string full_scoped_link_name)
 
bool HELPER_hasEnding (std::string const &fullString, std::string const &ending)
 
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

◆ WorldProxy()

WorldProxy::WorldProxy ( )

◆ ~WorldProxy()

WorldProxy::~WorldProxy ( )

Member Function Documentation

◆ makeSphere()

std::string WorldProxy::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,
const bool collision_enable )
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

Reimplemented from GazeboYarpPlugins::WorldInterfaceServer.

◆ makeBox()

string WorldProxy::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,
const bool collision_enable )
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

Reimplemented from GazeboYarpPlugins::WorldInterfaceServer.

◆ makeCylinder()

string WorldProxy::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,
const bool collision_enable )
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

Reimplemented from GazeboYarpPlugins::WorldInterfaceServer.

◆ setPose()

bool WorldProxy::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. MODEL1::link). Otherwise, world it will be used.
Returns
returns true or false on success failure

Reimplemented from GazeboYarpPlugins::WorldInterfaceServer.

◆ getPose()

GazeboYarpPlugins::Pose WorldProxy::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 expressed in the world reference frame

Reimplemented from GazeboYarpPlugins::WorldInterfaceServer.

◆ enableGravity()

bool WorldProxy::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 WorldProxy::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.

◆ deleteObject()

bool WorldProxy::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.

◆ makeFrame()

std::string WorldProxy::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,
const bool collision_enable )
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

Reimplemented from GazeboYarpPlugins::WorldInterfaceServer.

◆ changeColor()

bool WorldProxy::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.

◆ deleteAll()

bool WorldProxy::deleteAll ( )
virtual

Delete all objects in the world.

Reimplemented from GazeboYarpPlugins::WorldInterfaceServer.

◆ getList()

std::vector< std::string > WorldProxy::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.

◆ loadModelFromFile()

bool WorldProxy::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 WorldProxy::loadModelFromFileWithPose ( const std::string & filename,
const GazeboYarpPlugins::Pose & pose,
const std::string & object_name,
const double timeout )
virtual

Load a model from file.

Parameters
filenamestring that specifies the filename of the model
posepose to place the model at [m]
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.

◆ attach()

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

Attach an object to a link of the robot.

Parameters
idstring that identifies object in gazebo (returned after creation)
link_namename of a fully scoped link (e.g. MODEL1::link)
Returns
true if success, false otherwise

Reimplemented from GazeboYarpPlugins::WorldInterfaceServer.

◆ detach()

bool WorldProxy::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 WorldProxy::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.

◆ attachWorldPointer()

void WorldProxy::attachWorldPointer ( gazebo::physics::WorldPtr p)
inline

◆ attachModelPointer()

void WorldProxy::attachModelPointer ( gazebo::physics::ModelPtr p)
inline

◆ update()

void WorldProxy::update ( const gazebo::common::UpdateInfo & )

◆ waitForEngine()

void WorldProxy::waitForEngine ( )

Wait for engine to perform update step.

◆ signalEngine()

void WorldProxy::signalEngine ( )

Signal engine has performed one step.

Use internally within update

◆ isSynchronous()

bool WorldProxy::isSynchronous ( )
inline

Check if we have need to synchronize with the engine.

◆ setSynchronousMode()

void WorldProxy::setSynchronousMode ( bool f)
inline

Set if requests synchronize with the engine update or not.

◆ HELPER_getLinkInModel()

gazebo::physics::LinkPtr WorldProxy::HELPER_getLinkInModel ( gazebo::physics::ModelPtr model,
std::string link_name )

◆ HELPER_getLink()

gazebo::physics::LinkPtr WorldProxy::HELPER_getLink ( std::string full_scoped_link_name)

◆ HELPER_hasEnding()

bool WorldProxy::HELPER_hasEnding ( std::string const & fullString,
std::string const & ending )

◆ 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: