system_bolt.ros2_control.xacro 7.24 KB
Newer Older
Paul Rouanet's avatar
Paul Rouanet committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">

  <xacro:macro name="system_bolt" params="name prefix use_sim:=^|false use_fake_hardware:=^|true fake_sensor_commands:=^|false slowdown:=2.0">

    <ros2_control name="${name}" type="system">

      <xacro:if value="$(arg use_sim)">
        <hardware>
          <plugin>gazebo_ros2_control/GazeboSystem</plugin>
        </hardware>
      </xacro:if>
      <xacro:unless value="$(arg use_sim)">
        <hardware>
          <xacro:if value="${use_fake_hardware}">
            <plugin>fake_components/GenericSystem</plugin>
            <param name="fake_sensor_commands">${fake_sensor_commands}</param>
            <param name="state_following_offset">0.0</param>
          </xacro:if>
          <xacro:unless value="${use_fake_hardware}">
            <plugin>ros2_hardware_interface_bolt/SystemBoltMultiInterfaceHardware</plugin>
            <param name="example_param_hw_start_duration_sec">2.0</param>
            <param name="example_param_hw_stop_duration_sec">3.0</param>
            <param name="example_param_hw_slowdown">${slowdown}</param>
Paul Rouanet's avatar
Paul Rouanet committed
25
            <param name="eth_interface">${enp3s0}</param>
Paul Rouanet's avatar
Paul Rouanet committed
26
            </xacro:unless>
Paul Rouanet's avatar
Paul Rouanet committed
27
28
29
30
31
        </hardware>
      </xacro:unless>

      <joint name="FLHAA">
        <command_interface name="position">
Paul Rouanet's avatar
Paul Rouanet committed
32
          <param name="min">-0.5</param>
Paul Rouanet's avatar
Paul Rouanet committed
33
34
35
36
37
38
39
40
41
42
43
44
45
          <param name="max">0.5</param>
        </command_interface>
        <command_interface name="velocity">
          <param name="min">-1</param>
          <param name="max">1</param>
        </command_interface>
        <command_interface name="acceleration">
          <param name="min">-1</param>
          <param name="max">1</param>
        </command_interface>
        <state_interface name="position"/>
        <state_interface name="velocity"/>
        <state_interface name="acceleration"/>
Paul Rouanet's avatar
Paul Rouanet committed
46
        <param name="motor_number">0</param>
47
48
49
50
51
        <param name="gear_ratio">9.</param>
        <param name="motor_constant">0.025</param>
        <param name="max_current">12.</param>
        <param name="max_joint_velocity">80.</param>
        <param name="safety_damping">0.5</param>
52
        <param name="motor_reversed_polarity">${true}</param>
Paul Rouanet's avatar
Paul Rouanet committed
53
54
55
      </joint>
      <joint name="FLHFE">
        <command_interface name="position">
Paul Rouanet's avatar
Paul Rouanet committed
56
57
          <param name="min">-1.7</param>
          <param name="max">1.7</param>
Paul Rouanet's avatar
Paul Rouanet committed
58
59
60
61
62
63
64
65
66
67
68
        </command_interface>
        <command_interface name="velocity">
          <param name="min">-1</param>
          <param name="max">1</param>
        </command_interface>
        <command_interface name="acceleration">
          <param name="min">-1</param>
          <param name="max">1</param>
        </command_interface>
        <state_interface name="position"/>
        <state_interface name="velocity"/>
Paul Rouanet's avatar
Paul Rouanet committed
69
        <state_interface name="acceleration"/>*
70
        <param name="motor_number">3</param>
71
72
73
74
75
        <param name="gear_ratio">9.</param>
        <param name="motor_constant">0.025</param>
        <param name="max_current">12.</param>
        <param name="max_joint_velocity">80.</param>
        <param name="safety_damping">0.5</param>
76
        <param name="motor_reversed_polarity">${true}</param>
Paul Rouanet's avatar
Paul Rouanet committed
77
78
79
      </joint>
      <joint name="FLK">
        <command_interface name="position">
Paul Rouanet's avatar
Paul Rouanet committed
80
81
          <param name="min">-3.4</param>
          <param name="max">3.4</param>
Paul Rouanet's avatar
Paul Rouanet committed
82
83
84
85
86
87
88
89
90
91
92
93
        </command_interface>
        <command_interface name="velocity">
          <param name="min">-1</param>
          <param name="max">1</param>
        </command_interface>
        <command_interface name="acceleration">
          <param name="min">-1</param>
          <param name="max">1</param>
        </command_interface>
        <state_interface name="position"/>
        <state_interface name="velocity"/>
        <state_interface name="acceleration"/>
Paul Rouanet's avatar
Paul Rouanet committed
94
        <param name="motor_number">2</param>
95
96
97
98
99
        <param name="gear_ratio">9.</param>
        <param name="motor_constant">0.025</param>
        <param name="max_current">12.</param>
        <param name="max_joint_velocity">80.</param>
        <param name="safety_damping">0.5</param>
100
        <param name="motor_reversed_polarity">${true}</param>
Paul Rouanet's avatar
Paul Rouanet committed
101
102
103
104
      </joint>
      <joint name="FRHAA">
        <command_interface name="position">
          <param name="min">-0.5</param>
Paul Rouanet's avatar
Paul Rouanet committed
105
          <param name="max">0.5</param>
Paul Rouanet's avatar
Paul Rouanet committed
106
107
108
109
110
111
112
113
114
115
116
117
        </command_interface>
        <command_interface name="velocity">
          <param name="min">-1</param>
          <param name="max">1</param>
        </command_interface>
        <command_interface name="acceleration">
          <param name="min">-1</param>
          <param name="max">1</param>
        </command_interface>
        <state_interface name="position"/>
        <state_interface name="velocity"/>
        <state_interface name="acceleration"/>
118
        <param name="motor_number">1</param>
119
120
121
122
123
        <param name="gear_ratio">9.</param>
        <param name="motor_constant">0.025</param>
        <param name="max_current">12.</param>
        <param name="max_joint_velocity">80.</param>
        <param name="safety_damping">0.5</param>
124
        <param name="motor_reversed_polarity">${true}</param>
Paul Rouanet's avatar
Paul Rouanet committed
125
126
127
      </joint>
      <joint name="FRHFE">
        <command_interface name="position">
Paul Rouanet's avatar
Paul Rouanet committed
128
129
          <param name="min">-1.7</param>
          <param name="max">1.7</param>
Paul Rouanet's avatar
Paul Rouanet committed
130
131
132
133
134
135
136
137
138
139
140
141
        </command_interface>
        <command_interface name="velocity">
          <param name="min">-1</param>
          <param name="max">1</param>
        </command_interface>
        <command_interface name="acceleration">
          <param name="min">-1</param>
          <param name="max">1</param>
        </command_interface>
        <state_interface name="position"/>
        <state_interface name="velocity"/>
        <state_interface name="acceleration"/>
142
        <param name="motor_number">5</param>
143
144
145
146
147
        <param name="gear_ratio">9.</param>
        <param name="motor_constant">0.025</param>
        <param name="max_current">12.</param>
        <param name="max_joint_velocity">80.</param>
        <param name="safety_damping">0.5</param>
148
        <param name="motor_reversed_polarity">${false}</param>
Paul Rouanet's avatar
Paul Rouanet committed
149
150
151
      </joint>
      <joint name="FRK">
        <command_interface name="position">
Paul Rouanet's avatar
Paul Rouanet committed
152
153
          <param name="min">-3.4</param>
          <param name="max">3.4</param>
Paul Rouanet's avatar
Paul Rouanet committed
154
155
156
157
158
159
160
        </command_interface>
        <command_interface name="velocity">
          <param name="min">-1</param>
          <param name="max">1</param>
        <state_interface name="position"/>
        <state_interface name="velocity"/>
        <state_interface name="acceleration"/>
161
        <param name="motor_number">4</param>
162
163
164
165
166
        <param name="gear_ratio">9.</param>
        <param name="motor_constant">0.025</param>
        <param name="max_current">12.</param>
        <param name="max_joint_velocity">80.</param>
        <param name="safety_damping">0.5</param>
167
        <param name="motor_reversed_polarity">${false}</param>
Paul Rouanet's avatar
Paul Rouanet committed
168
      </joint>
Paul Rouanet's avatar
Paul Rouanet committed
169
      <sensor name="IMU">
Paul Rouanet's avatar
Paul Rouanet committed
170
171
        <state_interface name="gyroscope"/>
        <state_interface name="accelerometer"/>
Paul Rouanet's avatar
Paul Rouanet committed
172
        <state_interface name="linear_acceleration"/>
Paul Rouanet's avatar
Paul Rouanet committed
173
174
        <state_interface name="attitude_euler"/>
        <state_interface name="attitude_quaternion"/>
175
176
        <param name="rotate_vector">"1 2 3"</param>
        <param name="orientation_vector">"1 2 3 4"</param>
Paul Rouanet's avatar
Paul Rouanet committed
177
      </sensor>
Paul Rouanet's avatar
Paul Rouanet committed
178
179
180
181
182
183
    </ros2_control>

  </xacro:macro>

</robot>