YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
SimulatedWorld_nwc_yarp.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2026-2026 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: LGPL-2.1-or-later
4 */
5
6#ifndef YARP_DEV_SIMULATEDWORLDNWC_H
7#define YARP_DEV_SIMULATEDWORLDNWC_H
8
9#include <mutex>
10
11#include <yarp/os/Network.h>
14#include <yarp/sig/Vector.h>
15#include <yarp/os/Time.h>
16#include <yarp/dev/PolyDriver.h>
17
18#include "ISimulatedWorldMsgs.h"
20
21#define DEFAULT_THREAD_PERIOD 20 //ms
22
35{
36protected:
39 std::mutex m_mutex;
40
41public:
42
43 /* DeviceDriver methods */
44 bool open(yarp::os::Searchable& config) override;
45 bool close() override;
46
47 /* ISimulatedWorld methods */
48 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;
49 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;
50 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;
51 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;
52 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;
53 yarp::dev::ReturnValue makeActor(std::string id, std::string skin_filename, std::string animation_filename, yarp::sig::Pose6D pose) override;
54 yarp::dev::ReturnValue changeColor (std::string id, yarp::sig::ColorRGB color) override;
55 yarp::dev::ReturnValue setPose(std::string id, yarp::sig::Pose6D pose, std::string frame_name) override;
56 yarp::dev::ReturnValue enableGravity (std::string id, bool enable) override;
57 yarp::dev::ReturnValue enableCollision (std::string id, bool enable) override;
58 yarp::dev::ReturnValue getPose(std::string id, yarp::sig::Pose6D& pose, std::string frame_name) override;
59 yarp::dev::ReturnValue deleteObject(std::string id) override;
61 yarp::dev::ReturnValue getList(std::vector<std::string>& names) override;
62 yarp::dev::ReturnValue attach(std::string id, std::string link_name) override;
63 yarp::dev::ReturnValue detach(std::string id) override;
64 yarp::dev::ReturnValue rename(std::string old_name, std::string new_name) override;
65};
66
67#endif // YARP_DEV_SIMULATEDWORLDNWC_H
contains the definition of a Vector type
This class is the parameters parser for class SimulatedWorld_nwc_yarp.
SimulatedWorld_nwc_yarp: The client side of any ISimulatedWorld capable device.
yarp::dev::ReturnValue detach(std::string id) override
Detach a previously attached object.
yarp::dev::ReturnValue attach(std::string id, std::string link_name) override
Attach an object to a link of another object.
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 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 deleteObject(std::string id) override
Delete an object.
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 enableCollision(std::string id, bool enable) override
Enable/disables collision detection for an object.
yarp::dev::ReturnValue enableGravity(std::string id, bool enable) override
Enable/disables gravity for an object.
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 getList(std::vector< std::string > &names) override
List id of all objects that have been added to the world.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
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 rename(std::string old_name, std::string new_name) override
Change the names of an object.
yarp::dev::ReturnValue deleteAll() override
Delete all objects in the world.
yarp::dev::ReturnValue changeColor(std::string id, yarp::sig::ColorRGB color) override
Change the color of an object.
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 setPose(std::string id, yarp::sig::Pose6D pose, std::string frame_name) override
Set new object pose.
bool close() override
Close the DeviceDriver.
yarp::dev::ReturnValue getPose(std::string id, yarp::sig::Pose6D &pose, std::string frame_name) override
Get object pose.
Interface implemented by all device drivers.
ISimulatedWorld Interface.
A mini-server for network communication.
Definition Port.h:46
A base class for nested structures that can be searched.
Definition Searchable.h:31