Skip to content
LIBRARY
tests.DoublePendulum.md

tests.DoublePendulum

Usage

MultibodyComponents.tests.DoublePendulum()

Behavior

Source

dyad
component DoublePendulum
  world = MultibodyComponents.World()
  base_link = MultibodyComponents.BoxVisualizer(length_direction = [1.0, 0.0, 0.0], width_direction = [0.0, 1.0, 0.0], length = 0.2, width = 0.2, height = 0.2, r_shape = [-0.1, 0.0, 0.0], color = [0.0, 1.0, 0.0, 1.0])
  upper_link = MultibodyComponents.URDFBodyCylinder(m = 1.0, r_cm = [0.0, 0.0, -0.5], I_11 = 1.0, I_22 = 0.083, I_33 = 1.0, I_21 = 0.0, I_31 = 0.0, I_32 = 0.0, r_visual = [0.0, 0.0, -0.5], length_direction = [0.0, 0.0, 1.0], length = 1.1, radius = 0.05, color = [1.0, 0.0, 0.0, 1.0])
  lower_link = MultibodyComponents.URDFBodyCylinder(m = 1.0, r_cm = [0.0, 0.0, -1.0], I_11 = 1.0, I_22 = 0.33, I_33 = 1.0, I_21 = 0.0, I_31 = 0.0, I_32 = 0.0, r_visual = [0.0, 0.0, -1.0], length_direction = [0.0, 0.0, 1.0], length = 2.1, radius = 0.05, color = [0.0, 0.0, 1.0, 1.0])
  shoulder = MultibodyComponents.URDFRevolute(r = [0.15, 0.0, 0.0], n = [1.0, 0.0, 0.0], angle = 0.0, joint_n = [1.0, 0.0, 0.0], final axisflange = true, render = true)
  shoulder_damper = RotationalComponents.Components.Damper(d = 0.1)
  elbow = MultibodyComponents.URDFRevolute(r = [0.1, 0.0, -1.0], n = [1.0, 0.0, 0.0], angle = 0.0, joint_n = [1.0, 0.0, 0.0], final axisflange = true, render = true)
  elbow_damper = RotationalComponents.Components.Damper(d = 0.1)
relations
  connect(world.frame_b, base_link.frame_a)
  connect(base_link.frame_a, shoulder.frame_a)
  connect(shoulder.frame_b, upper_link.frame_a)
  connect(upper_link.frame_a, elbow.frame_a)
  connect(elbow.frame_b, lower_link.frame_a)
  connect(shoulder.support, shoulder_damper.spline_a)
  connect(shoulder_damper.spline_b, shoulder.axis)
  connect(elbow.support, elbow_damper.spline_a)
  connect(elbow_damper.spline_b, elbow.axis)
end
Flattened Source
dyad
component DoublePendulum
  world = MultibodyComponents.World()
  base_link = MultibodyComponents.BoxVisualizer(length_direction = [1.0, 0.0, 0.0], width_direction = [0.0, 1.0, 0.0], length = 0.2, width = 0.2, height = 0.2, r_shape = [-0.1, 0.0, 0.0], color = [0.0, 1.0, 0.0, 1.0])
  upper_link = MultibodyComponents.URDFBodyCylinder(m = 1.0, r_cm = [0.0, 0.0, -0.5], I_11 = 1.0, I_22 = 0.083, I_33 = 1.0, I_21 = 0.0, I_31 = 0.0, I_32 = 0.0, r_visual = [0.0, 0.0, -0.5], length_direction = [0.0, 0.0, 1.0], length = 1.1, radius = 0.05, color = [1.0, 0.0, 0.0, 1.0])
  lower_link = MultibodyComponents.URDFBodyCylinder(m = 1.0, r_cm = [0.0, 0.0, -1.0], I_11 = 1.0, I_22 = 0.33, I_33 = 1.0, I_21 = 0.0, I_31 = 0.0, I_32 = 0.0, r_visual = [0.0, 0.0, -1.0], length_direction = [0.0, 0.0, 1.0], length = 2.1, radius = 0.05, color = [0.0, 0.0, 1.0, 1.0])
  shoulder = MultibodyComponents.URDFRevolute(r = [0.15, 0.0, 0.0], n = [1.0, 0.0, 0.0], angle = 0.0, joint_n = [1.0, 0.0, 0.0], final axisflange = true, render = true)
  shoulder_damper = RotationalComponents.Components.Damper(d = 0.1)
  elbow = MultibodyComponents.URDFRevolute(r = [0.1, 0.0, -1.0], n = [1.0, 0.0, 0.0], angle = 0.0, joint_n = [1.0, 0.0, 0.0], final axisflange = true, render = true)
  elbow_damper = RotationalComponents.Components.Damper(d = 0.1)
relations
  connect(world.frame_b, base_link.frame_a)
  connect(base_link.frame_a, shoulder.frame_a)
  connect(shoulder.frame_b, upper_link.frame_a)
  connect(upper_link.frame_a, elbow.frame_a)
  connect(elbow.frame_b, lower_link.frame_a)
  connect(shoulder.support, shoulder_damper.spline_a)
  connect(shoulder_damper.spline_b, shoulder.axis)
  connect(elbow.support, elbow_damper.spline_a)
  connect(elbow_damper.spline_b, elbow.axis)
metadata {}
end


Test Cases

No test cases defined.

  • Examples

  • Experiments

  • Analyses