YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
ISimulatedWorldTest.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2026-2026 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#ifndef ISIMULATEDWORLDTEST_H
7#define ISIMULATEDWORLDTEST_H
8
9#include <memory>
10#include <numeric>
11
13#include <catch2/catch_amalgamated.hpp>
14
15using namespace yarp::dev;
16using namespace yarp::os;
17
18namespace yarp::dev::tests
19{
21 {
22 REQUIRE(isim != nullptr);
23
25
26 std::string frame_name;
29 bool gravity_enabled = true;
30 bool collision_enabled = true;
31
32 ret = isim->makeSphere("sphere1", 0.1, pose, color,frame_name,gravity_enabled,collision_enabled);
33 CHECK(ret);
34
35 ret = isim->makeBox("box1",1,1,1, pose, color,frame_name,gravity_enabled,collision_enabled);
36 CHECK(ret);
37
38 ret = isim->makeCylinder("cyl1",1,1, pose, color,frame_name,gravity_enabled,collision_enabled);
39 CHECK(ret);
40
41 ret = isim->makeFrame("frame",1, pose, color,frame_name,gravity_enabled,collision_enabled);
42 CHECK(ret);
43
44 ret = isim->makeModel("model1", "filename", pose, frame_name,gravity_enabled,collision_enabled);
45 CHECK(ret);
46
47 ret = isim->makeActor("actor1", "filename1", "filename2", pose);
48 CHECK(ret);
49
50 ret = isim->deleteObject("sphere1");
51 CHECK(ret);
52
53 ret = isim->deleteAll();
54 CHECK(ret);
55
56 ret = isim->setPose("box1", pose);
57 CHECK(ret);
58
59 ret = isim->getPose("box1", pose);
60 CHECK(ret);
61
62 ret = isim->rename("box1", "box2");
63 CHECK(ret);
64
65 std::vector<std::string> objects;
66 ret = isim->getList(objects);
67 CHECK(ret);
68
69 ret = isim->enableGravity("cyl1", true);
70 CHECK(ret);
71 ret = isim->enableGravity("cyl1", false);
72 CHECK(ret);
73
74 ret = isim->enableCollision("cyl1", true);
75 CHECK(ret);
76 ret = isim->enableCollision("cyl1", false);
77 CHECK(ret);
78
79 ret = isim->changeColor("box1", color);
80 CHECK(ret);
81
82 ret = isim->attach("box1", "frame1");
83 CHECK(ret);
84
85 ret = isim->detach("box1");
86 CHECK(ret);
87 }
88}
89
90#endif
ISimulatedWorld Interface.
A mini-server for performing network communication in the background.
void exec_ISimulatedWorld_test_1(ISimulatedWorld *isim)
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.