Skip to content

Commit 9de30f5

Browse files
committed
Add tutorial to test basestate plugin
1 parent ae97692 commit 9de30f5

File tree

2 files changed

+111
-0
lines changed

2 files changed

+111
-0
lines changed

tutorial/basestate/basestate_nws.xml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<!DOCTYPE robot PUBLIC "-//YARP//DTD yarprobotinterface 3.0//EN" "http://www.yarp.it/DTD/yarprobotinterfaceV3.0.dtd">
3+
4+
<robot name="basestate" portprefix="basestate" build="0" xmlns:xi="http://www.w3.org/2001/XInclude">
5+
<devices>
6+
<device name="basestate_nws_yarp" type="analogServer">
7+
<!-- See https://www.yarp.it/git-master/classAnalogWrapper.html#details for parameter documentation -->
8+
<param name="name"> /basestate </param>
9+
<param name="period"> 50 </param>
10+
<action phase="startup" level="5" type="attach">
11+
<!-- This is the same name that we passed with the yarpDeviceName to the basestate plugin -->
12+
<param name="device"> basestate_plugin_device </param>
13+
</action>
14+
<action phase="shutdown" level="5" type="detach" />
15+
</device>
16+
</devices>
17+
</robot>

tutorial/basestate/model.sdf

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
<?xml version="1.0" ?>
2+
3+
<sdf version="1.6">
4+
<world name="sensors">
5+
<physics name="1ms" type="ignored">
6+
<max_step_size>0.001</max_step_size>
7+
<real_time_factor>1.0</real_time_factor>
8+
</physics>
9+
<plugin
10+
filename="gz-sim-physics-system"
11+
name="gz::sim::systems::Physics">
12+
</plugin>
13+
<plugin
14+
filename="gz-sim-user-commands-system"
15+
name="gz::sim::systems::UserCommands">
16+
</plugin>
17+
<plugin
18+
filename="gz-sim-sensors-system"
19+
name="gz::sim::systems::Sensors">
20+
</plugin>
21+
<plugin
22+
filename="gz-sim-scene-broadcaster-system"
23+
name="gz::sim::systems::SceneBroadcaster">
24+
</plugin>
25+
26+
<light type="directional" name="sun">
27+
<cast_shadows>true</cast_shadows>
28+
<pose>0 0 10 0 0 0</pose>
29+
<diffuse>0.8 0.8 0.8 1</diffuse>
30+
<specular>0.2 0.2 0.2 1</specular>
31+
<attenuation>
32+
<range>1000</range>
33+
<constant>0.9</constant>
34+
<linear>0.01</linear>
35+
<quadratic>0.001</quadratic>
36+
</attenuation>
37+
<direction>-0.5 0.1 -0.9</direction>
38+
</light>
39+
40+
<model name="ground_plane">
41+
<static>true</static>
42+
<link name="link">
43+
<collision name="collision">
44+
<geometry>
45+
<plane>
46+
<normal>0 0 1</normal>
47+
<size>100 100</size>
48+
</plane>
49+
</geometry>
50+
</collision>
51+
<visual name="visual">
52+
<geometry>
53+
<plane>
54+
<normal>0 0 1</normal>
55+
<size>100 100</size>
56+
</plane>
57+
</geometry>
58+
<material>
59+
<ambient>0.8 0.8 0.8 1</ambient>
60+
<diffuse>0.8 0.8 0.8 1</diffuse>
61+
<specular>0.8 0.8 0.8 1</specular>
62+
</material>
63+
</visual>
64+
</link>
65+
</model>
66+
67+
<model name="basestate_model">
68+
<pose>0 0 0.2 0 0 0</pose>
69+
<link name="link_1">
70+
<visual name="visual">
71+
<geometry>
72+
<box>
73+
<size>0.1 0.1 0.1</size>
74+
</box>
75+
</geometry>
76+
</visual>
77+
<collision name="collision">
78+
<geometry>
79+
<box>
80+
<size>0.1 0.1 0.1</size>
81+
</box>
82+
</geometry>
83+
</collision>
84+
</link>
85+
<plugin name="gzyarp::BaseState" filename="gz-sim-yarp-basestate-system">
86+
<yarpConfigurationString>(yarpDeviceName basestate_plugin_device) (baseLink link_1)</yarpConfigurationString>
87+
</plugin>
88+
<plugin name="gzyarp::RobotInterface" filename="gz-sim-yarp-robotinterface-system">
89+
<yarpRobotInterfaceConfigurationFile>basestate_nws.xml</yarpRobotInterfaceConfigurationFile>
90+
</plugin>
91+
</model>
92+
93+
</world>
94+
</sdf>

0 commit comments

Comments
 (0)