<% # Joint friction demo world # Spawn joints of different types with different friction parameters # Inertial parameters # Aluminum 2700 kg/m^3 density = 2700.0 dy = 0.5 dx = dy/10 dz = dy/10 dd = dy mass = density * dx * dy * dz ixx = 1.0 / 12 * mass * (dy*dy + dz*dz) iyy = 1.0 / 12 * mass * (dz*dz + dx*dx) izz = 1.0 / 12 * mass * (dx*dx + dy*dy) # Initial angle of revolute joints theta = 0* Math::PI revolute_friction = [0.0, 0.1, 1.0, 10.0] prismatic_friction = [0.0, 5.0, 9.0, 9.81] universal_friction = [0.0, 0.1, 1.0, 10.0] %> model://sun <% # Revolute joints i = 0 revolute_friction.each do |f| i = i + 1 name = 'pendulum_' + i.to_s %> <%= "" %> <%= dd*2.1*i %> 0 <%= dd*1.8 %> <%= theta %> 0 0 0 0 <%= -dd/2 %> 0 0 0 <%= mass %> <%= ixx %> <%= iyy %> <%= izz %> 0.0 0.0 0.0 <%= dx %> <%= dy %> <%= dz %> <%= dx %> <%= dy %> <%= dz %> 0 <%= dd/2 %> 0 0 0 0 world link 1 0 0 <%= f %> <% end %> <% # Universal joints, axis 1 i = 0 universal_friction.each do |f| i = i + 1 name = 'universal_axis1_' + i.to_s %> <%= "" %> <%= dd*2.1*i %> <%= -dd*3 %> <%= dd*1.8 %> <%= theta %> 0 0 0 0 <%= -dd/2 %> 0 0 0 <%= mass %> <%= ixx %> <%= iyy %> <%= izz %> 0.0 0.0 0.0 <%= dx %> <%= dy %> <%= dz %> <%= dx %> <%= dy %> <%= dz %> 0 <%= dd/2 %> 0 0 0 0 world link 1 0 0 <%= f %> 0 0 1 <%= 0 %> <% end %> <% # Universal joints, axis 2 i = 0 universal_friction.each do |f| i = i + 1 name = 'universal_axis2_' + i.to_s %> <%= "" %> <%= dd*2.1*i %> <%= -dd*6 %> <%= dd*1.8 %> <%= theta %> 0 0 0 0 <%= -dd/2 %> 0 0 0 <%= mass %> <%= ixx %> <%= iyy %> <%= izz %> 0.0 0.0 0.0 <%= dx %> <%= dy %> <%= dz %> <%= dx %> <%= dy %> <%= dz %> 0 <%= dd/2 %> 0 0 0 0 world link 0 0 1 <%= 0 %> 1 0 0 <%= f %> <% end %> <% # Prismatic joints i = 0 prismatic_friction.each do |f| i = i + 1 name = 'slider_' + i.to_s %> <%= "" %> <%= dd*2.1*i %> <%= dd*3 %> <%= dd*1.8 %> 0 0 0 0 0 <%= -dd/2 %> 0 0 0 <%= mass %> <%= ixx %> <%= iyy %> <%= izz %> 0.0 0.0 0.0 <%= dx %> <%= dy %> <%= dz %> <%= dx %> <%= dy %> <%= dz %> world link 0 0 1 <%= f %> <% end %>