def test_params(self):
     params = RimlessWheelParams()
     params.set_mass(1.)
     params.set_length(2.)
     params.set_gravity(4.)
     params.set_number_of_spokes(7)
     params.set_slope(.15)
     self.assertEqual(params.mass(), 1.)
     self.assertEqual(params.length(), 2.)
     self.assertEqual(params.gravity(), 4.)
     self.assertEqual(params.number_of_spokes(), 7)
     self.assertEqual(params.slope(), .15)
Beispiel #2
0
 def test_params(self):
     params = RimlessWheelParams()
     params.set_mass(1.)
     params.set_length(2.)
     params.set_gravity(4.)
     params.set_number_of_spokes(7)
     params.set_slope(.15)
     self.assertEqual(params.mass(), 1.)
     self.assertEqual(params.length(), 2.)
     self.assertEqual(params.gravity(), 4.)
     self.assertEqual(params.number_of_spokes(), 7)
     self.assertEqual(params.slope(), .15)
Beispiel #3
0
                    type=float,
                    help="Initial angular velocity of the stance leg "
                    "(in radians/sec).",
                    default=5.0)
parser.add_argument("-S",
                    "--slope",
                    type=float,
                    help="Ramp angle (in radians)",
                    default=0.08)
args = parser.parse_args()

tree = RigidBodyTree(
    FindResourceOrThrow("drake/examples/rimless_wheel/RimlessWheel.urdf"),
    FloatingBaseType.kRollPitchYaw)
params = RimlessWheelParams()
params.set_slope(args.slope)
R = np.identity(3)
R[0, 0] = math.cos(params.slope())
R[0, 2] = math.sin(params.slope())
R[2, 0] = -math.sin(params.slope())
R[2, 2] = math.cos(params.slope())
X = Isometry3(rotation=R, translation=[0, 0, -5.])
color = np.array([0.9297, 0.7930, 0.6758, 1])
tree.world().AddVisualElement(VisualElement(Box([100., 1., 10.]), X, color))
tree.compile()

builder = DiagramBuilder()
rimless_wheel = builder.AddSystem(RimlessWheel())

visualizer = builder.AddSystem(
    PlanarRigidBodyVisualizer(tree,
Beispiel #4
0
                    default=0.0)
parser.add_argument("-V", "--initial_angular_velocity",
                    type=float,
                    help="Initial angular velocity of the stance leg "
                         "(in radians/sec).",
                    default=5.0)
parser.add_argument("-S", "--slope", type=float,
                    help="Ramp angle (in radians)",
                    default=0.08)
args = parser.parse_args()

tree = RigidBodyTree(FindResourceOrThrow(
                        "drake/examples/rimless_wheel/RimlessWheel.urdf"),
                     FloatingBaseType.kRollPitchYaw)
params = RimlessWheelParams()
params.set_slope(args.slope)
R = np.identity(3)
R[0, 0] = math.cos(params.slope())
R[0, 2] = math.sin(params.slope())
R[2, 0] = -math.sin(params.slope())
R[2, 2] = math.cos(params.slope())
X = Isometry3(rotation=R, translation=[0, 0, -5.])
color = np.array([0.9297, 0.7930, 0.6758, 1])
tree.world().AddVisualElement(VisualElement(Box([100., 1., 10.]), X, color))
tree.compile()

builder = DiagramBuilder()
rimless_wheel = builder.AddSystem(RimlessWheel())

visualizer = builder.AddSystem(PlanarRigidBodyVisualizer(tree,
                                                         xlim=[-8., 8.],