8 CPPUNIT_ASSERT( playerc_simulation_subscribe(
simProxy, PLAYER_OPEN_MODE ) == 0 );
12 CPPUNIT_ASSERT( playerc_simulation_unsubscribe(
simProxy ) == 0 );
13 playerc_simulation_destroy(
simProxy );
22 CPPUNIT_ASSERT( playerc_simulation_get_pose2d(
simProxy,
"r1", &x, &y, &a ) == 0 );
23 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"pose (x)", -4.19, x,
Delta );
24 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"pose (y)", -5.71, y,
Delta );
25 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"pose (a)", 3*M_PI/4, a,
Delta );
28 CPPUNIT_ASSERT( playerc_simulation_set_pose2d(
simProxy,
"r1", 0, 0, 0 ) == 0 );
29 CPPUNIT_ASSERT( playerc_simulation_get_pose2d(
simProxy,
"r1", &x2, &y2, &a2 ) == 0 );
30 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"pose (x)", 0, x2,
Delta );
31 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"pose (y)", 0, y2,
Delta );
32 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"pose (a)", 0, a2,
Delta );
35 CPPUNIT_ASSERT( playerc_simulation_set_pose2d(
simProxy,
"r1", x, y, a ) == 0 );
39 double x, y, z, roll, pitch, yaw, time;
40 double x2, y2, z2, roll2, pitch2, yaw2, time2;
43 CPPUNIT_ASSERT( playerc_simulation_get_pose3d(
simProxy,
"r1", &x, &y, &z, &roll, &pitch, &yaw, &time ) == 0 );
44 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"pose (x)", -4.19, x,
Delta );
45 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"pose (y)", -5.71, y,
Delta );
46 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"pose (z)", 0, z,
Delta );
47 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"pose (roll)", 0, roll,
Delta );
48 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"pose (pitch)", 0, pitch,
Delta );
49 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"pose (yaw)", 3*M_PI/4, yaw,
Delta );
50 CPPUNIT_ASSERT( time > 0 );
53 CPPUNIT_ASSERT( playerc_simulation_set_pose3d(
simProxy,
"r1", 0, 0, 0.5, M_PI/4, M_PI/4, M_PI/4 ) == 0 );
54 CPPUNIT_ASSERT( playerc_simulation_get_pose3d(
simProxy,
"r1", &x2, &y2, &z2, &roll2, &pitch2, &yaw2, &time2 ) == 0 );
55 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"pose (x)", 0, x2,
Delta );
56 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"pose (y)", 0, y2,
Delta );
57 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"pose (z)", 0.5, z2,
Delta );
59 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"pose (roll)", 0, roll2,
Delta );
60 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"pose (pitch)", 0, pitch2,
Delta );
61 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(
"pose (yaw)", M_PI/4, yaw2,
Delta );
62 CPPUNIT_ASSERT( time2 > time );
65 CPPUNIT_ASSERT( playerc_simulation_set_pose3d(
simProxy,
"r1", x, y, z, roll, pitch, yaw ) == 0 );
74 CPPUNIT_ASSERT( playerc_simulation_set_property(
simProxy,
"r0",
"aggression", &r0Agg,
sizeof(
void*) ) == 0 );
75 CPPUNIT_ASSERT( playerc_simulation_set_property(
simProxy,
"r1",
"aggression", &r1Agg,
sizeof(
void*) ) == 0 );
76 CPPUNIT_ASSERT( playerc_simulation_set_property(
simProxy,
"r1",
"power", &r1Pow,
sizeof(
void*) ) == 0 );
static const double Delta
playerc_simulation_t * simProxy
playerc_client_t * client