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

#include <WorldInterfaceServer.h>

Inheritance diagram for GazeboYarpPlugins::WorldInterfaceServer:
Collaboration diagram for GazeboYarpPlugins::WorldInterfaceServer:

Public Member Functions

 WorldInterfaceServer ()
 
virtual std::string makeSphere (const double radius, const Pose &pose, const Color &color, const std::string &frame_name="", const std::string &object_name="", const bool gravity_enable=false, const bool collision_enable=true)
 Make a sphere.
 
virtual std::string makeBox (const double width, const double height, const double thickness, const Pose &pose, const Color &color, const std::string &frame_name="", const std::string &object_name="", const bool gravity_enable=false, const bool collision_enable=true)
 Make a box.
 
virtual std::string makeCylinder (const double radius, const double length, const Pose &pose, const Color &color, const std::string &frame_name="", const std::string &object_name="", const bool gravity_enable=false, const bool collision_enable=true)
 Make a cylinder.
 
virtual std::string makeFrame (const double size, const Pose &pose, const Color &color, const std::string &frame_name="", const std::string &object_name="", const bool gravity_enable=false, const bool collision_enable=true)
 Make a reference frame.
 
virtual bool changeColor (const std::string &id, const Color &color)
 Change the color of an object.
 
virtual bool setPose (const std::string &id, const Pose &pose, const std::string &frame_name="")
 Set new 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 Pose getPose (const std::string &id, const std::string &frame_name="")
 Get object pose.
 
virtual bool loadModelFromFile (const std::string &filename)
 Load a model from file.
 
virtual std::string loadModelFromFileWithPose (const std::string &filename, const Pose &pose, const std::string &object_name="", const double timeout=2.000000)
 Load a model from file.
 
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)
 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.
 
virtual std::vector< std::string > help (const std::string &functionName="--all")
 
bool read (yarp::os::ConnectionReader &connection) override
 
 WorldInterfaceServer ()
 
virtual std::string makeSphere (const double radius, const Pose &pose, const Color &color, const std::string &frame_name="", const std::string &object_name="", const bool gravity_enable=false, const bool collision_enable=true)
 Make a sphere.
 
virtual std::string makeBox (const double width, const double height, const double thickness, const Pose &pose, const Color &color, const std::string &frame_name="", const std::string &object_name="", const bool gravity_enable=false, const bool collision_enable=true)
 Make a box.
 
virtual std::string makeCylinder (const double radius, const double length, const Pose &pose, const Color &color, const std::string &frame_name="", const std::string &object_name="", const bool gravity_enable=false, const bool collision_enable=true)
 Make a cylinder.
 
virtual std::string makeFrame (const double size, const Pose &pose, const Color &color, const std::string &frame_name="", const std::string &object_name="", const bool gravity_enable=false, const bool collision_enable=true)
 Make a reference frame.
 
virtual bool changeColor (const std::string &id, const Color &color)
 Change the color of an object.
 
virtual bool setPose (const std::string &id, const Pose &pose, const std::string &frame_name="")
 Set new 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 Pose getPose (const std::string &id, const std::string &frame_name="")
 Get object pose.
 
virtual bool loadModelFromFile (const std::string &filename)
 Load a model from file.
 
virtual std::string loadModelFromFileWithPose (const std::string &filename, const Pose &pose, const std::string &object_name="", const double timeout=2.000000)
 Load a model from file.
 
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)
 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.
 
virtual std::vector< std::string > help (const std::string &functionName="--all")
 
bool read (yarp::os::ConnectionReader &connection) override
 

Constructor & Destructor Documentation

◆ WorldInterfaceServer() [1/2]

GazeboYarpPlugins::WorldInterfaceServer::WorldInterfaceServer ( )

◆ WorldInterfaceServer() [2/2]

GazeboYarpPlugins::WorldInterfaceServer::WorldInterfaceServer ( )

Member Function Documentation

◆ makeSphere() [1/2]

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

Make a sphere.

Parameters
radiusradius of the sphere [m]
posepose of the sphere [m]
colorcolor 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.
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 a string that contains the name of the object in the world

Reimplemented in WorldProxy, and WorldInterfaceServerImpl.

◆ makeBox() [1/2]

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

Make a box.

Parameters
widthbox width [m]
heightbox height[m]
thicknessbox thickness [m]
posepose of the box [m]
colorcolor 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.
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 a string that contains the name of the object in the world

Reimplemented in WorldProxy, and WorldInterfaceServerImpl.

◆ makeCylinder() [1/2]

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

Make a cylinder.

Parameters
radiusradius of the cylinder [m]
lengthlength of the cylinder [m]
posepose of the cylinder [m]
colorcolor 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 a string that contains the name of the object in the world

Reimplemented in WorldProxy, and WorldInterfaceServerImpl.

◆ makeFrame() [1/2]

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

Make a reference frame.

Parameters
sizesize of the frame [m]
posepose of the frame [m]
colorcolor 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 a string that contains the name of the object in the world

Reimplemented in WorldProxy, and WorldInterfaceServerImpl.

◆ changeColor() [1/2]

bool GazeboYarpPlugins::WorldInterfaceServer::changeColor ( const std::string & id,
const 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 in WorldInterfaceServerImpl, and WorldProxy.

◆ setPose() [1/2]

bool GazeboYarpPlugins::WorldInterfaceServer::setPose ( const std::string & id,
const 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 in WorldProxy, and WorldInterfaceServerImpl.

◆ enableGravity() [1/2]

bool GazeboYarpPlugins::WorldInterfaceServer::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 in WorldInterfaceServerImpl, and WorldProxy.

◆ enableCollision() [1/2]

bool GazeboYarpPlugins::WorldInterfaceServer::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 in WorldInterfaceServerImpl, and WorldProxy.

◆ getPose() [1/2]

Pose GazeboYarpPlugins::WorldInterfaceServer::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. MODEL_ID::FRAME_ID). Otherwise, world it will be used.
Returns
returns value of the pose in the world reference frame

Reimplemented in WorldProxy, and WorldInterfaceServerImpl.

◆ loadModelFromFile() [1/2]

bool GazeboYarpPlugins::WorldInterfaceServer::loadModelFromFile ( const std::string & filename)
virtual

Load a model from file.

Parameters
filenamestring that specifies the name of the model
Returns
returns true or false on success failure

Reimplemented in WorldInterfaceServerImpl, and WorldProxy.

◆ loadModelFromFileWithPose() [1/2]

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

Load a model from file.

Parameters
filenamestring that specifies the name of the model
posepose to place the model at: position (x,y,z), orientation (roll, pitch, yaw)]
timeout(optional) time for the creation of the model [s]
Returns
returns a string that contains the name of the model in the world

Reimplemented in WorldProxy, and WorldInterfaceServerImpl.

◆ deleteObject() [1/2]

bool GazeboYarpPlugins::WorldInterfaceServer::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 in WorldInterfaceServerImpl, and WorldProxy.

◆ deleteAll() [1/2]

bool GazeboYarpPlugins::WorldInterfaceServer::deleteAll ( )
virtual

Delete all objects in the world.

Reimplemented in WorldInterfaceServerImpl, and WorldProxy.

◆ getList() [1/2]

std::vector< std::string > GazeboYarpPlugins::WorldInterfaceServer::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 in WorldInterfaceServerImpl, and WorldProxy.

◆ attach() [1/2]

bool GazeboYarpPlugins::WorldInterfaceServer::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 link of the robot
Returns
true if success, false otherwise

Reimplemented in WorldInterfaceServerImpl, and WorldProxy.

◆ detach() [1/2]

bool GazeboYarpPlugins::WorldInterfaceServer::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 in WorldInterfaceServerImpl, and WorldProxy.

◆ rename() [1/2]

bool GazeboYarpPlugins::WorldInterfaceServer::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 in WorldInterfaceServerImpl, and WorldProxy.

◆ help() [1/2]

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

◆ read() [1/2]

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

◆ makeSphere() [2/2]

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

Make a sphere.

Parameters
radiusradius of the sphere [m]
posepose of the sphere [m]
colorcolor 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.
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 a string that contains the name of the object in the world

Reimplemented in WorldProxy, and WorldInterfaceServerImpl.

◆ makeBox() [2/2]

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

Make a box.

Parameters
widthbox width [m]
heightbox height[m]
thicknessbox thickness [m]
posepose of the box [m]
colorcolor 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.
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 a string that contains the name of the object in the world

Reimplemented in WorldProxy, and WorldInterfaceServerImpl.

◆ makeCylinder() [2/2]

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

Make a cylinder.

Parameters
radiusradius of the cylinder [m]
lengthlength of the cylinder [m]
posepose of the cylinder [m]
colorcolor 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 a string that contains the name of the object in the world

Reimplemented in WorldProxy, and WorldInterfaceServerImpl.

◆ makeFrame() [2/2]

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

Make a reference frame.

Parameters
sizesize of the frame [m]
posepose of the frame [m]
colorcolor 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 a string that contains the name of the object in the world

Reimplemented in WorldProxy, and WorldInterfaceServerImpl.

◆ changeColor() [2/2]

virtual bool GazeboYarpPlugins::WorldInterfaceServer::changeColor ( const std::string & id,
const 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 in WorldInterfaceServerImpl, and WorldProxy.

◆ setPose() [2/2]

virtual bool GazeboYarpPlugins::WorldInterfaceServer::setPose ( const std::string & id,
const 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 in WorldProxy, and WorldInterfaceServerImpl.

◆ enableGravity() [2/2]

virtual bool GazeboYarpPlugins::WorldInterfaceServer::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 in WorldInterfaceServerImpl, and WorldProxy.

◆ enableCollision() [2/2]

virtual bool GazeboYarpPlugins::WorldInterfaceServer::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 in WorldInterfaceServerImpl, and WorldProxy.

◆ getPose() [2/2]

virtual Pose GazeboYarpPlugins::WorldInterfaceServer::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. MODEL_ID::FRAME_ID). Otherwise, world it will be used.
Returns
returns value of the pose in the world reference frame

Reimplemented in WorldProxy, and WorldInterfaceServerImpl.

◆ loadModelFromFile() [2/2]

virtual bool GazeboYarpPlugins::WorldInterfaceServer::loadModelFromFile ( const std::string & filename)
virtual

Load a model from file.

Parameters
filenamestring that specifies the name of the model
Returns
returns true or false on success failure

Reimplemented in WorldInterfaceServerImpl, and WorldProxy.

◆ loadModelFromFileWithPose() [2/2]

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

Load a model from file.

Parameters
filenamestring that specifies the name of the model
posepose to place the model at: position (x,y,z), orientation (roll, pitch, yaw)]
timeout(optional) time for the creation of the model [s]
Returns
returns a string that contains the name of the model in the world

Reimplemented in WorldProxy, and WorldInterfaceServerImpl.

◆ deleteObject() [2/2]

virtual bool GazeboYarpPlugins::WorldInterfaceServer::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 in WorldInterfaceServerImpl, and WorldProxy.

◆ deleteAll() [2/2]

virtual bool GazeboYarpPlugins::WorldInterfaceServer::deleteAll ( )
virtual

Delete all objects in the world.

Reimplemented in WorldInterfaceServerImpl, and WorldProxy.

◆ getList() [2/2]

virtual std::vector< std::string > GazeboYarpPlugins::WorldInterfaceServer::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 in WorldInterfaceServerImpl, and WorldProxy.

◆ attach() [2/2]

virtual bool GazeboYarpPlugins::WorldInterfaceServer::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 link of the robot
Returns
true if success, false otherwise

Reimplemented in WorldInterfaceServerImpl, and WorldProxy.

◆ detach() [2/2]

virtual bool GazeboYarpPlugins::WorldInterfaceServer::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 in WorldInterfaceServerImpl, and WorldProxy.

◆ rename() [2/2]

virtual bool GazeboYarpPlugins::WorldInterfaceServer::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 in WorldInterfaceServerImpl, and WorldProxy.

◆ help() [2/2]

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

◆ read() [2/2]

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

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