repo_id
stringclasses
205 values
file_path
stringlengths
33
141
content
stringlengths
1
307k
__index_level_0__
int64
0
0
/home/johnshepherd/drake/examples/bouncing_ball
/home/johnshepherd/drake/examples/bouncing_ball/test/bouncing_ball_test.cc
#include "drake/examples/bouncing_ball/bouncing_ball.h" #include <memory> #include <gtest/gtest.h> #include "drake/systems/analysis/runge_kutta3_integrator.h" #include "drake/systems/analysis/simulator.h" #include "drake/systems/framework/test_utilities/scalar_conversion.h" namespace drake { namespace examples { na...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/rod2d/rod2d_geometry.h
#pragma once #include "drake/geometry/scene_graph.h" #include "drake/systems/framework/diagram_builder.h" #include "drake/systems/framework/leaf_system.h" namespace drake { namespace examples { namespace rod2d { // Expresses the Rod2D's geometry to a SceneGraph. /// /// @system /// name: Rod2dGeometry /// input_port...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/rod2d/BUILD.bazel
load("//tools/lint:lint.bzl", "add_lint_tests") load( "//tools/skylark:drake_cc.bzl", "drake_cc_binary", "drake_cc_googletest", "drake_cc_library", ) package(default_visibility = ["//visibility:private"]) drake_cc_library( name = "constraint_solver", srcs = ["constraint_solver.cc"], hdrs =...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/rod2d/rod2d_sim.cc
#include <cmath> #include <iomanip> #include <iostream> #include <limits> #include <memory> #include <gflags/gflags.h> #include "drake/examples/rod2d/rod2d.h" #include "drake/examples/rod2d/rod2d_geometry.h" #include "drake/geometry/drake_visualizer.h" #include "drake/systems/analysis/implicit_euler_integrator.h" #in...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/rod2d/rod2d.h
#pragma once #include <memory> #include <utility> #include <vector> #include "drake/examples/rod2d/constraint_problem_data.h" #include "drake/examples/rod2d/constraint_solver.h" #include "drake/examples/rod2d/rod2d_state_vector.h" #include "drake/solvers/moby_lcp_solver.h" #include "drake/systems/framework/leaf_syste...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/rod2d/README.md
# Multibody Dynamics Constraints This documentation describes `ConstraintSolver`, a prototype solver for mixed linear complementarity problems (MLCPs). In particular, problems corresponding to rigid multi-body systems with bilateral and/or unilateral constraints as well as polyhedral approximations of friction cone co...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/rod2d/rod2d_geometry.cc
#include "drake/examples/rod2d/rod2d_geometry.h" #include <memory> #include "drake/geometry/geometry_frame.h" #include "drake/geometry/geometry_ids.h" #include "drake/geometry/geometry_instance.h" #include "drake/geometry/geometry_roles.h" #include "drake/geometry/kinematics_vector.h" #include "drake/geometry/rgba.h"...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/rod2d/rod2d_state_vector.h
#pragma once // This file was previously auto-generated, but now is just a normal source // file in git. However, it still retains some historical oddities from its // heritage. In general, we do recommend against subclassing BasicVector in // new code. #include <cmath> #include <limits> #include <stdexcept> #include...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/rod2d/rod2d.cc
#include "drake/examples/rod2d/rod2d.h" #include <algorithm> #include <limits> #include <memory> #include <stdexcept> #include <utility> #include <vector> #include "drake/common/drake_assert.h" #include "drake/systems/framework/basic_vector.h" // TODO(edrumwri,sherm1) This code is currently written out mostly in sca...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/rod2d/rod2d_state_vector.cc
#include "drake/examples/rod2d/rod2d_state_vector.h" namespace drake { namespace examples { namespace rod2d { const int Rod2dStateVectorIndices::kNumCoordinates; const int Rod2dStateVectorIndices::kX; const int Rod2dStateVectorIndices::kY; const int Rod2dStateVectorIndices::kTheta; const int Rod2dStateVectorIndices::...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/rod2d/constraint_problem_data.h
#pragma once #include <vector> #include <Eigen/Core> #include "drake/common/eigen_types.h" namespace drake { namespace examples { namespace rod2d { /// Structure for holding constraint data for computing forces due to /// constraints and the resulting multibody accelerations. /// /// The Newton-Euler equations (es...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/rod2d/constraint_solver.cc
#include "drake/examples/rod2d/constraint_solver.h" namespace drake { namespace examples { namespace rod2d { template class ConstraintSolver<double>; } // namespace rod2d } // namespace examples } // namespace drake
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/rod2d/constraint_solver.h
#pragma once #include <algorithm> #include <limits> #include <memory> #include <numeric> #include <utility> #include <vector> #include "drake/common/fmt_eigen.h" #include "drake/common/text_logging.h" #include "drake/examples/rod2d/constraint_problem_data.h" #include "drake/solvers/moby_lcp_solver.h" namespace drake...
0
/home/johnshepherd/drake/examples/rod2d
/home/johnshepherd/drake/examples/rod2d/test/rod2d_test.cc
#include "drake/examples/rod2d/rod2d.h" #include <memory> #include <gtest/gtest.h> #include "drake/common/test_utilities/eigen_matrix_compare.h" #include "drake/common/test_utilities/expect_no_throw.h" #include "drake/examples/rod2d/constraint_problem_data.h" #include "drake/examples/rod2d/constraint_solver.h" #incl...
0
/home/johnshepherd/drake/examples/rod2d
/home/johnshepherd/drake/examples/rod2d/test/constraint_solver_test.cc
#include "drake/examples/rod2d/constraint_solver.h" #include <cmath> #include <memory> #include <gtest/gtest.h> #include "drake/common/drake_assert.h" #include "drake/common/ssize.h" #include "drake/examples/rod2d/rod2d.h" #include "drake/solvers/unrevised_lemke_solver.h" using drake::examples::rod2d::Rod2D; using ...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/acrobot/metrics.py
import numpy as np def _wrap_to(value, low, high): assert low < high return ((value - low) % (high - low)) + low def deviation_from_upright_equilibrium(x): return np.array([ # The upright equilibrium theta0 is pi; rotate this angle accordingly. _wrap_to(x[0], 0, 2 * np.pi) - np.pi, ...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/acrobot/acrobot_input.cc
#include "drake/examples/acrobot/acrobot_input.h" namespace drake { namespace examples { namespace acrobot { const int AcrobotInputIndices::kNumCoordinates; const int AcrobotInputIndices::kTau; const std::vector<std::string>& AcrobotInputIndices::GetCoordinateNames() { static const drake::never_destroyed<std::vect...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/acrobot/acrobot_params.cc
#include "drake/examples/acrobot/acrobot_params.h" namespace drake { namespace examples { namespace acrobot { const int AcrobotParamsIndices::kNumCoordinates; const int AcrobotParamsIndices::kM1; const int AcrobotParamsIndices::kM2; const int AcrobotParamsIndices::kL1; const int AcrobotParamsIndices::kL2; const int A...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/acrobot/run_plant_w_lcm.cc
/* * A simulated acrobot plant that communicates to its controller through LCM, * implemented by the following Diagram system: * * LcmSubscriberSystem --> * AcrobotCommandReceiver --> * AcrobotPlant --> * AcrobotStateSender --> * LcmPublisherSystem * */ #include <memory> #include <thread> #include <gflags/gf...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/acrobot/BUILD.bazel
load("//tools/install:install_data.bzl", "install_data") load("//tools/lint:lint.bzl", "add_lint_tests") load( "//tools/skylark:drake_cc.bzl", "drake_cc_binary", "drake_cc_googletest", "drake_cc_library", ) load("//tools/skylark:drake_data.bzl", "models_filegroup") load( "//tools/skylark:drake_py.bz...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/acrobot/acrobot_lcm.cc
#include "drake/examples/acrobot/acrobot_lcm.h" #include "drake/lcmt_acrobot_u.hpp" #include "drake/lcmt_acrobot_x.hpp" namespace drake { namespace examples { namespace acrobot { using systems::Context; using systems::SystemOutput; static const int kNumJoints = 2; /*------------------------------------------------...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/acrobot/Acrobot_no_collision.urdf
<?xml version="1.0"?> <robot name="Acrobot"> <link name="base_link"> <visual> <geometry> <box size="0.2 0.2 0.2"/> </geometry> <material name="green"> <color rgba="0 1 0 1"/> </material> </visual> </link> <link name="upper_link"> <inertial> <origin xyz="0 ...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/acrobot/run_lqr.cc
#include <memory> #include <gflags/gflags.h> #include "drake/examples/acrobot/acrobot_geometry.h" #include "drake/examples/acrobot/acrobot_plant.h" #include "drake/examples/acrobot/acrobot_state.h" #include "drake/geometry/drake_visualizer.h" #include "drake/systems/analysis/simulator.h" #include "drake/systems/frame...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/acrobot/acrobot_state.cc
#include "drake/examples/acrobot/acrobot_state.h" namespace drake { namespace examples { namespace acrobot { const int AcrobotStateIndices::kNumCoordinates; const int AcrobotStateIndices::kTheta1; const int AcrobotStateIndices::kTheta2; const int AcrobotStateIndices::kTheta1dot; const int AcrobotStateIndices::kTheta2...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/acrobot/spong_controller_params.cc
#include "drake/examples/acrobot/spong_controller_params.h" namespace drake { namespace examples { namespace acrobot { const int SpongControllerParamsIndices::kNumCoordinates; const int SpongControllerParamsIndices::kKE; const int SpongControllerParamsIndices::kKP; const int SpongControllerParamsIndices::kKD; const i...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/acrobot/acrobot_input.h
#pragma once // This file was previously auto-generated, but now is just a normal source // file in git. However, it still retains some historical oddities from its // heritage. In general, we do recommend against subclassing BasicVector in // new code. #include <cmath> #include <limits> #include <stdexcept> #include...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/acrobot/README.md
Drake Acrobot Examples ====================== The files in this directory implement a basic Drake acrobot (a double pendulum actuated at its "waist") and use the acrobot to demonstrate various drake control features. The most common task for the acrobot is to achieve and hold an upright (both links pointing in the po...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/acrobot/run_swing_up.cc
#include <memory> #include <gflags/gflags.h> #include "drake/examples/acrobot/acrobot_geometry.h" #include "drake/examples/acrobot/acrobot_plant.h" #include "drake/examples/acrobot/acrobot_state.h" #include "drake/examples/acrobot/spong_controller.h" #include "drake/geometry/drake_visualizer.h" #include "drake/math/w...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/acrobot/spong_controller_w_lcm.cc
/* * An acrobot Spong controller that communicates to run_plant_w_lcm * through LCM, implemented by the following diagram system: * * LcmSubscriberSystem—> * AcrobotStateReceiver—> * AcrobotSpongController—> * AcrobotCommandSender—> * LcmPublisherSystem * */ #include <chrono> #include <memory> #include <gfla...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/acrobot/acrobot_io.py
import numpy as np from pydrake.common.yaml import yaml_load, yaml_dump def load_scenario(*, filename=None, data=None): """Given a scenario `filename` xor `data` loads and returns the acrobot scenario from the file. """ return yaml_load(filename=filename, data=data) def save_scenario(*, scenario):...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/acrobot/spong_controller.h
#pragma once #include <memory> #include "drake/examples/acrobot/acrobot_input.h" #include "drake/examples/acrobot/acrobot_params.h" #include "drake/examples/acrobot/acrobot_plant.h" #include "drake/examples/acrobot/acrobot_state.h" #include "drake/examples/acrobot/spong_controller_params.h" #include "drake/math/wrap_...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/acrobot/Acrobot.sdf
<?xml version="1.0"?> <sdf version="1.7"> <model name="Acrobot"> <link name="base_link"> <collision name="base_link_collision"> <geometry> <box> <size>0.2 0.2 0.2</size> </box> </geometry> </collision> <visual name="base_link_visual"> <geom...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/acrobot/spong_controller_params.h
#pragma once // This file was previously auto-generated, but now is just a normal source // file in git. However, it still retains some historical oddities from its // heritage. In general, we do recommend against subclassing BasicVector in // new code. #include <cmath> #include <limits> #include <stdexcept> #include...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/acrobot/acrobot_lcm.h
#pragma once /// @file /// This file contains classes dealing with sending/receiving LCM messages /// related to acrobot. The classes in this file are based on iiwa_lcm.h #include <memory> #include "drake/examples/acrobot/acrobot_state.h" #include "drake/lcmt_acrobot_u.hpp" #include "drake/lcmt_acrobot_x.hpp" #inclu...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/acrobot/spong_sim.cc
#include <fstream> #include <iostream> #include <gflags/gflags.h> #include "drake/common/name_value.h" #include "drake/common/schema/stochastic.h" #include "drake/common/yaml/yaml_io.h" #include "drake/examples/acrobot/acrobot_plant.h" #include "drake/examples/acrobot/spong_controller.h" #include "drake/systems/analy...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/acrobot/spong_sim.py
"""A main() program (plus an reusable standalone function) that simulates a spong-controlled acrobot. """ import argparse import sys from pydrake.examples import ( AcrobotPlant, AcrobotSpongController, AcrobotState, ) from pydrake.systems.analysis import Simulator from pydrake.systems.framework import Dia...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/acrobot/run_passive.cc
#include <memory> #include <gflags/gflags.h> #include "drake/examples/acrobot/acrobot_geometry.h" #include "drake/examples/acrobot/acrobot_plant.h" #include "drake/examples/acrobot/acrobot_state.h" #include "drake/geometry/drake_visualizer.h" #include "drake/systems/analysis/simulator.h" #include "drake/systems/frame...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/acrobot/acrobot_geometry.cc
#include "drake/examples/acrobot/acrobot_geometry.h" #include <memory> #include "drake/examples/acrobot/acrobot_params.h" #include "drake/geometry/geometry_frame.h" #include "drake/geometry/geometry_ids.h" #include "drake/geometry/geometry_instance.h" #include "drake/geometry/geometry_roles.h" #include "drake/math/ri...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/acrobot/acrobot_plant.h
#pragma once #include <memory> #include "drake/examples/acrobot/acrobot_input.h" #include "drake/examples/acrobot/acrobot_params.h" #include "drake/examples/acrobot/acrobot_state.h" #include "drake/systems/framework/basic_vector.h" #include "drake/systems/framework/diagram.h" #include "drake/systems/framework/leaf_sy...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/acrobot/optimizer_demo.py
"""Demonstration of optimizing Spong controller parameters for an acrobot using a Monte Carlo scenario. """ import argparse from contextlib import closing import os import subprocess import sys import tempfile import numpy as np from pydrake.common import FindResourceOrThrow from examples.acrobot.acrobot_io import ...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/acrobot/acrobot_params.h
#pragma once // This file was previously auto-generated, but now is just a normal source // file in git. However, it still retains some historical oddities from its // heritage. In general, we do recommend against subclassing BasicVector in // new code. #include <cmath> #include <limits> #include <stdexcept> #include...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/acrobot/acrobot_state.h
#pragma once // This file was previously auto-generated, but now is just a normal source // file in git. However, it still retains some historical oddities from its // heritage. In general, we do recommend against subclassing BasicVector in // new code. #include <cmath> #include <limits> #include <stdexcept> #include...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/acrobot/acrobot_geometry.h
#pragma once #include "drake/examples/acrobot/acrobot_params.h" #include "drake/geometry/scene_graph.h" #include "drake/systems/framework/diagram_builder.h" #include "drake/systems/framework/leaf_system.h" namespace drake { namespace examples { namespace acrobot { /// Expresses an AcrobotPlant's geometry to a SceneG...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/acrobot/spong_controller.cc
#include "drake/examples/acrobot/spong_controller.h" #include "drake/common/default_scalars.h" DRAKE_DEFINE_CLASS_TEMPLATE_INSTANTIATIONS_ON_DEFAULT_SCALARS( class ::drake::examples::acrobot::AcrobotSpongController)
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/acrobot/Acrobot.urdf
<?xml version="1.0"?> <robot name="Acrobot"> <link name="base_link"> <visual> <geometry> <box size="0.2 0.2 0.2"/> </geometry> <material name="green"> <color rgba="0 1 0 1"/> </material> </visual> <collision name="base_link_collision"> <geometry> <box ...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/acrobot/acrobot_plant.cc
#include "drake/examples/acrobot/acrobot_plant.h" #include <cmath> #include <vector> #include "drake/common/default_scalars.h" #include "drake/common/drake_throw.h" #include "drake/systems/controllers/linear_quadratic_regulator.h" #include "drake/systems/framework/diagram.h" #include "drake/systems/framework/diagram_...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/acrobot/run_lqr_w_estimator.cc
#include <cmath> #include <iostream> #include <memory> #include <gflags/gflags.h> #include "drake/common/fmt_eigen.h" #include "drake/common/proto/call_python.h" #include "drake/examples/acrobot/acrobot_geometry.h" #include "drake/examples/acrobot/acrobot_plant.h" #include "drake/examples/acrobot/acrobot_state.h" #in...
0
/home/johnshepherd/drake/examples/acrobot
/home/johnshepherd/drake/examples/acrobot/gen/acrobot_input.h
#pragma once #include "drake/examples/acrobot/acrobot_input.h" // clang-format off // NOLINTNEXTLINE #warning "DRAKE_DEPRECATED: This include path is deprecated and will be removed on or after 2024-09-01. Remove the /gen/ part of your code's include statement." // clang-format on
0
/home/johnshepherd/drake/examples/acrobot
/home/johnshepherd/drake/examples/acrobot/gen/spong_controller_params.h
#pragma once #include "drake/examples/acrobot/spong_controller_params.h" // clang-format off // NOLINTNEXTLINE #warning "DRAKE_DEPRECATED: This include path is deprecated and will be removed on or after 2024-09-01. Remove the /gen/ part of your code's include statement." // clang-format on
0
/home/johnshepherd/drake/examples/acrobot
/home/johnshepherd/drake/examples/acrobot/gen/acrobot_params.h
#pragma once #include "drake/examples/acrobot/acrobot_params.h" // clang-format off // NOLINTNEXTLINE #warning "DRAKE_DEPRECATED: This include path is deprecated and will be removed on or after 2024-09-01. Remove the /gen/ part of your code's include statement." // clang-format on
0
/home/johnshepherd/drake/examples/acrobot
/home/johnshepherd/drake/examples/acrobot/gen/acrobot_state.h
#pragma once #include "drake/examples/acrobot/acrobot_state.h" // clang-format off // NOLINTNEXTLINE #warning "DRAKE_DEPRECATED: This include path is deprecated and will be removed on or after 2024-09-01. Remove the /gen/ part of your code's include statement." // clang-format on
0
/home/johnshepherd/drake/examples/acrobot
/home/johnshepherd/drake/examples/acrobot/test/metrics_test.py
import unittest import numpy as np from examples.acrobot.metrics import ( deviation_from_upright_equilibrium, ensemble_cost, final_state_cost, is_success, success_rate, ) class TestMetrics(unittest.TestCase): def setUp(self): self.x_equilibrium = [np.pi, 0, 0, 0] self.x_wrapp...
0
/home/johnshepherd/drake/examples/acrobot
/home/johnshepherd/drake/examples/acrobot/test/spong_sim_lib_py_test.py
import unittest from examples.acrobot.spong_sim import simulate class TestSpongControlledAcrobot(unittest.TestCase): def test_simulate(self): x_tape = simulate( initial_state=[0.01, 0.02, 0.03, 0.04], controller_params=[0.001, 0.002, 0.003, 0.004], t_final=30.0, tape_...
0
/home/johnshepherd/drake/examples/acrobot
/home/johnshepherd/drake/examples/acrobot/test/example_stochastic_scenario.yaml
# An example scenario for acrobot, with randomness. controller_params: !UniformVector min: [4, 40, 4, 0.9e3] max: [6, 60, 6, 1.1e3] initial_state: !UniformVector min: [1.1, -0.1, -0.1, -0.1] max: [1.3, 0.1, 0.1, 0.1] t_final: 30.0 tape_period: 0.05
0
/home/johnshepherd/drake/examples/acrobot
/home/johnshepherd/drake/examples/acrobot/test/run_swing_up_traj_optimization.cc
// Generates a swing-up trajectory for acrobot and displays the trajectory // in DrakeVisualizer. Trajectory generation code is based on // pendulum_swing_up.cc. #include <iostream> #include <limits> #include <memory> #include <gflags/gflags.h> #include "drake/common/is_approx_equal_abstol.h" #include "drake/example...
0
/home/johnshepherd/drake/examples/acrobot
/home/johnshepherd/drake/examples/acrobot/test/acrobot_plant_test.cc
#include "drake/examples/acrobot/acrobot_plant.h" #include <gtest/gtest.h> #include "drake/common/test_utilities/eigen_matrix_compare.h" #include "drake/common/test_utilities/expect_no_throw.h" namespace drake { namespace examples { namespace acrobot { namespace { GTEST_TEST(AcrobotPlantTest, ImplicitTimeDerivative...
0
/home/johnshepherd/drake/examples/acrobot
/home/johnshepherd/drake/examples/acrobot/test/example_scenario.yaml
# An example scenario for acrobot. controller_params: [5, 50, 5, 1e3] initial_state: [1.2, 0, 0, 0] t_final: 30.0 tape_period: 0.05
0
/home/johnshepherd/drake/examples/acrobot
/home/johnshepherd/drake/examples/acrobot/test/multibody_dynamics_test.cc
#include <memory> #include <gtest/gtest.h> #include "drake/common/test_utilities/eigen_matrix_compare.h" #include "drake/examples/acrobot/acrobot_plant.h" #include "drake/multibody/parsing/parser.h" namespace drake { namespace examples { namespace acrobot { namespace { // Tests that the hand-derived dynamics (from ...
0
/home/johnshepherd/drake/examples/acrobot
/home/johnshepherd/drake/examples/acrobot/test/acrobot_lcm_msg_generator.cc
// Generates simple LCM messages to test acrobot_plant and controllers. #include <memory> #include <string> #include <thread> #include <vector> #include "drake/lcm/drake_lcm.h" #include "drake/lcmt_acrobot_u.hpp" #include "drake/lcmt_acrobot_x.hpp" #include "drake/systems/analysis/simulator.h" namespace drake { name...
0
/home/johnshepherd/drake/examples/acrobot
/home/johnshepherd/drake/examples/acrobot/test/acrobot_io_test.py
import numpy as np import unittest from pydrake.common import FindResourceOrThrow from examples.acrobot.acrobot_io import ( load_scenario, save_scenario, load_output, save_output) class TestIo(unittest.TestCase): def setUp(self): self.maxDiff = None self.example = FindResourceOrThrow( ...
0
/home/johnshepherd/drake/examples/acrobot
/home/johnshepherd/drake/examples/acrobot/test/spong_sim_main_test.py
import os import subprocess import sys import unittest from pydrake.common import FindResourceOrThrow from examples.acrobot.acrobot_io import load_output, load_scenario _backend = "py" class TestRunSpongControlledAcrobot(unittest.TestCase): def setUp(self): self.dut = FindResourceOrThrow( ...
0
/home/johnshepherd/drake/examples/acrobot
/home/johnshepherd/drake/examples/acrobot/test/acrobot_geometry_test.cc
#include "drake/examples/acrobot/acrobot_geometry.h" #include <gtest/gtest.h> #include "drake/examples/acrobot/acrobot_plant.h" #include "drake/geometry/scene_graph.h" #include "drake/systems/framework/diagram_builder.h" namespace drake { namespace examples { namespace acrobot { namespace { GTEST_TEST(AcrobotGeomet...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/bead_on_a_wire/bead_on_a_wire.h
#pragma once #include <Eigen/Core> #include <unsupported/Eigen/AutoDiff> #include "drake/systems/framework/leaf_system.h" namespace drake { namespace examples { namespace bead_on_a_wire { /// Dynamical system of a point (unit) mass constrained to lie on a wire. The /// system is currently frictionless. The equation...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/bead_on_a_wire/BUILD.bazel
load("//tools/lint:lint.bzl", "add_lint_tests") load( "//tools/skylark:drake_cc.bzl", "drake_cc_googletest", "drake_cc_library", ) package(default_visibility = ["//visibility:private"]) drake_cc_library( name = "bead_on_a_wire", srcs = ["bead_on_a_wire.cc"], hdrs = [ "bead_on_a_wire.h"...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/bead_on_a_wire/bead_on_a_wire.cc
#include "drake/examples/bead_on_a_wire/bead_on_a_wire.h" #include <limits> #include "drake/common/drake_assert.h" #include "drake/systems/framework/basic_vector.h" namespace drake { namespace examples { namespace bead_on_a_wire { template <typename T> BeadOnAWire<T>::BeadOnAWire(BeadOnAWire<T>::CoordinateType type...
0
/home/johnshepherd/drake/examples/bead_on_a_wire
/home/johnshepherd/drake/examples/bead_on_a_wire/test/bead_on_a_wire_test.cc
#include "drake/examples/bead_on_a_wire/bead_on_a_wire.h" #include <memory> #include <gtest/gtest.h> namespace drake { namespace examples { namespace bead_on_a_wire { namespace { class BeadOnAWireTest : public ::testing::Test { protected: void SetUp() override { // Construct beads on the wire in absolute and...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/cubic_polynomial/region_of_attraction.cc
// A simple example of computing a region of attraction for a (polynomial) // dynamical system. Note that this is a C++ version of // CubicPolynomialExample.m which is available at the following link: // // https://github.com/RobotLocomotion/drake/blob/00ec5a9836871d5a22579963d45376b5979e41d5/drake/examples/CubicPolyno...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/cubic_polynomial/BUILD.bazel
load("//tools/lint:lint.bzl", "add_lint_tests") load("//tools/skylark:drake_cc.bzl", "drake_cc_binary") load("//tools/skylark:test_tags.bzl", "mosek_test_tags") package(default_visibility = ["//visibility:private"]) drake_cc_binary( name = "region_of_attraction", srcs = ["region_of_attraction.cc"], add_te...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/cubic_polynomial/backward_reachability.cc
// A simple "hello world" example of computing a finite-time backward reachable // set for a polynomial system using convex optimization. // // This implements the occupation measure-based SDP relaxation described in // "Convex computation of the region of attraction of polynomial control // systems" by Didier Henrion ...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/atlas/BUILD.bazel
load("//tools/lint:lint.bzl", "add_lint_tests") load( "//tools/skylark:drake_cc.bzl", "drake_cc_binary", ) package(default_visibility = ["//visibility:private"]) drake_cc_binary( name = "atlas_run_dynamics", srcs = [ "atlas_run_dynamics.cc", ], add_test_rule = 1, data = ["@drake_mo...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/atlas/README.md
This directory contains a small demo of Atlas dynamics. Historical note --------------- Prior to 2016, Drake was built around a substantial base of MATLAB software. Most of that was removed from the head of git master during 2017. To view or use the original MATLAB implementation of Atlas you may use this tag: htt...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/atlas/atlas_run_dynamics.cc
#include <memory> #include <gflags/gflags.h> #include "drake/geometry/scene_graph.h" #include "drake/multibody/parsing/parser.h" #include "drake/multibody/plant/multibody_plant_config_functions.h" #include "drake/systems/analysis/simulator.h" #include "drake/systems/analysis/simulator_gflags.h" #include "drake/system...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/zmp/BUILD.bazel
load("//tools/lint:lint.bzl", "add_lint_tests") load( "//tools/skylark:drake_cc.bzl", "drake_cc_binary", ) package(default_visibility = ["//visibility:private"]) drake_cc_binary( name = "zmp_example", testonly = 1, srcs = ["zmp_example.cc"], deps = [ "//common/proto:call_python", ...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/zmp/zmp_example.cc
#include <chrono> #include <thread> #include "drake/common/proto/call_python.h" #include "drake/planning/locomotion/test_utilities/zmp_test_util.h" namespace drake { namespace examples { namespace zmp { namespace { void PlotResults(const planning::ZmpTestTraj& traj) { using common::CallPython; using common::ToPy...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/rimless_wheel/rimless_wheel_continuous_state.cc
#include "drake/examples/rimless_wheel/rimless_wheel_continuous_state.h" namespace drake { namespace examples { namespace rimless_wheel { const int RimlessWheelContinuousStateIndices::kNumCoordinates; const int RimlessWheelContinuousStateIndices::kTheta; const int RimlessWheelContinuousStateIndices::kThetadot; const...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/rimless_wheel/rimless_wheel_params.h
#pragma once // This file was previously auto-generated, but now is just a normal source // file in git. However, it still retains some historical oddities from its // heritage. In general, we do recommend against subclassing BasicVector in // new code. #include <cmath> #include <limits> #include <stdexcept> #include...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/rimless_wheel/rimless_wheel_geometry.cc
#include "drake/examples/rimless_wheel/rimless_wheel_geometry.h" #include <memory> #include <fmt/format.h> #include "drake/examples/rimless_wheel/rimless_wheel_params.h" #include "drake/geometry/geometry_frame.h" #include "drake/geometry/geometry_ids.h" #include "drake/geometry/geometry_instance.h" #include "drake/g...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/rimless_wheel/rimless_wheel.cc
#include "drake/examples/rimless_wheel/rimless_wheel.h" #include <limits> #include "drake/common/default_scalars.h" namespace drake { namespace examples { namespace rimless_wheel { template <typename T> RimlessWheel<T>::RimlessWheel() : systems::LeafSystem<T>(systems::SystemTypeTag<RimlessWheel>{}) { this->De...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/rimless_wheel/BUILD.bazel
load("//tools/lint:lint.bzl", "add_lint_tests") load( "//tools/skylark:drake_cc.bzl", "drake_cc_binary", "drake_cc_googletest", "drake_cc_library", ) package(default_visibility = ["//visibility:private"]) drake_cc_library( name = "rimless_wheel_vector_types", srcs = [ "rimless_wheel_co...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/rimless_wheel/rimless_wheel_geometry.h
#pragma once #include "drake/examples/rimless_wheel/rimless_wheel_params.h" #include "drake/geometry/scene_graph.h" #include "drake/systems/framework/diagram_builder.h" #include "drake/systems/framework/leaf_system.h" namespace drake { namespace examples { namespace rimless_wheel { /// Expresses a RimlessWheel's geo...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/rimless_wheel/rimless_wheel_continuous_state.h
#pragma once // This file was previously auto-generated, but now is just a normal source // file in git. However, it still retains some historical oddities from its // heritage. In general, we do recommend against subclassing BasicVector in // new code. #include <cmath> #include <limits> #include <stdexcept> #include...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/rimless_wheel/rimless_wheel.h
#pragma once #include <memory> #include <vector> #include "drake/examples/rimless_wheel/rimless_wheel_continuous_state.h" #include "drake/examples/rimless_wheel/rimless_wheel_params.h" #include "drake/systems/framework/event.h" #include "drake/systems/framework/leaf_system.h" #include "drake/systems/framework/scalar_...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/rimless_wheel/rimless_wheel_params.cc
#include "drake/examples/rimless_wheel/rimless_wheel_params.h" namespace drake { namespace examples { namespace rimless_wheel { const int RimlessWheelParamsIndices::kNumCoordinates; const int RimlessWheelParamsIndices::kMass; const int RimlessWheelParamsIndices::kLength; const int RimlessWheelParamsIndices::kGravity;...
0
/home/johnshepherd/drake/examples
/home/johnshepherd/drake/examples/rimless_wheel/simulate.cc
#include <memory> #include <gflags/gflags.h> #include "drake/examples/rimless_wheel/rimless_wheel.h" #include "drake/examples/rimless_wheel/rimless_wheel_geometry.h" #include "drake/geometry/drake_visualizer.h" #include "drake/systems/analysis/simulator.h" #include "drake/systems/framework/diagram_builder.h" namespa...
0
/home/johnshepherd/drake/examples/rimless_wheel
/home/johnshepherd/drake/examples/rimless_wheel/gen/rimless_wheel_params.h
#pragma once #include "drake/examples/rimless_wheel/rimless_wheel_params.h" // clang-format off // NOLINTNEXTLINE #warning "DRAKE_DEPRECATED: This include path is deprecated and will be removed on or after 2024-09-01. Remove the /gen/ part of your code's include statement." // clang-format on
0
/home/johnshepherd/drake/examples/rimless_wheel
/home/johnshepherd/drake/examples/rimless_wheel/gen/rimless_wheel_continuous_state.h
#pragma once #include "drake/examples/rimless_wheel/rimless_wheel_continuous_state.h" // clang-format off // NOLINTNEXTLINE #warning "DRAKE_DEPRECATED: This include path is deprecated and will be removed on or after 2024-09-01. Remove the /gen/ part of your code's include statement." // clang-format on
0
/home/johnshepherd/drake/examples/rimless_wheel
/home/johnshepherd/drake/examples/rimless_wheel/test/rimless_wheel_test.cc
#include "drake/examples/rimless_wheel/rimless_wheel.h" #include <gtest/gtest.h> #include "drake/systems/analysis/simulator.h" #include "drake/systems/framework/test_utilities/scalar_conversion.h" using std::cos; using std::sin; using std::sqrt; namespace drake { namespace examples { namespace rimless_wheel { names...
0
/home/johnshepherd/drake/examples/rimless_wheel
/home/johnshepherd/drake/examples/rimless_wheel/test/rimless_wheel_geometry_test.cc
#include "drake/examples/rimless_wheel/rimless_wheel_geometry.h" #include <gtest/gtest.h> #include "drake/examples/rimless_wheel/rimless_wheel.h" #include "drake/geometry/scene_graph.h" #include "drake/systems/framework/diagram_builder.h" namespace drake { namespace examples { namespace rimless_wheel { namespace { ...
0
/home/johnshepherd/drake/examples/hydroelastic
/home/johnshepherd/drake/examples/hydroelastic/spatula_slip_control/BUILD.bazel
load("//tools/lint:lint.bzl", "add_lint_tests") load("//tools/skylark:drake_cc.bzl", "drake_cc_binary") load("//tools/skylark:drake_data.bzl", "models_filegroup") package(default_visibility = ["//visibility:private"]) models_filegroup( name = "glob_models", glob_exclude = ["images/**/*"], ) filegroup( na...
0
/home/johnshepherd/drake/examples/hydroelastic
/home/johnshepherd/drake/examples/hydroelastic/spatula_slip_control/README.md
# Spatula Slip Control This is an example of using the hydroelastic contact model with a robot gripper with compliant bubble fingers and a compliant spatula handle. This example is described in the paper [Discrete Approximation of Pressure Field Contact Patches](https://arxiv.org/abs/2110.04157) and a discussion of th...
0
/home/johnshepherd/drake/examples/hydroelastic
/home/johnshepherd/drake/examples/hydroelastic/spatula_slip_control/spatula_slip_control.cc
#include <gflags/gflags.h> #include "drake/common/drake_copyable.h" #include "drake/common/eigen_types.h" #include "drake/multibody/parsing/parser.h" #include "drake/multibody/plant/multibody_plant_config_functions.h" #include "drake/multibody/tree/prismatic_joint.h" #include "drake/systems/analysis/simulator.h" #incl...
0
/home/johnshepherd/drake/examples/hydroelastic
/home/johnshepherd/drake/examples/hydroelastic/spatula_slip_control/spatula.sdf
<?xml version="1.0"?> <sdf version="1.7" xmlns:drake='drake.mit.edu'> <model name="spatula"> <pose>0 0 0 0 0 0</pose> <link name="spatula"> <inertial> <mass>0.068</mass> <inertia> <ixx>0.21095403274864072</ixx> <ixy>-4.264472553729218e-08</ixy> <ixz>0.0</i...
0
/home/johnshepherd/drake/examples/hydroelastic
/home/johnshepherd/drake/examples/hydroelastic/python_nonconvex_mesh/BUILD.bazel
load("//tools/lint:lint.bzl", "add_lint_tests") load("//tools/skylark:drake_py.bzl", "drake_py_binary") package(default_visibility = ["//visibility:private"]) filegroup( name = "models", srcs = [ "table.sdf", ], visibility = ["//:__pkg__"], ) drake_py_binary( name = "drop_pepper_py", ...
0
/home/johnshepherd/drake/examples/hydroelastic
/home/johnshepherd/drake/examples/hydroelastic/python_nonconvex_mesh/README.md
# Drop a bell pepper This is a simple example of using non-convex meshes with the hydroelastic contact model in Python. The example drops a compliant-hydroelastic yellow bell pepper onto a rigid-hydroelastic bowl. The bell pepper is a non-convex compliant mesh. The bowl is a non-convex rigid mesh. The table is a comp...
0
/home/johnshepherd/drake/examples/hydroelastic
/home/johnshepherd/drake/examples/hydroelastic/python_nonconvex_mesh/table.sdf
<?xml version="1.0"?> <sdf version="1.7"> <model name="table"> <link name="table"> <pose>0 0 0 0 0 0</pose> <inertial> <pose>0 0 0 0 0 0</pose> <mass>5.0e3</mass> <inertia> <!-- The code will likely fix it to World frame, so the calculation here is just f...
0
/home/johnshepherd/drake/examples/hydroelastic
/home/johnshepherd/drake/examples/hydroelastic/python_nonconvex_mesh/drop_pepper.py
""" This is an example of using hydroelastic contact model through pydrake with non-convex meshes. It reads SDFormat files of: - a non-convex mesh of a yellow bell pepper with compliant-hydroelastic properties, - a non-convex mesh of a bowl with rigid-hydroelastic properties, - and a table top (anchored to the World)...
0
/home/johnshepherd/drake/examples/hydroelastic
/home/johnshepherd/drake/examples/hydroelastic/python_ball_paddle/BUILD.bazel
load("//tools/lint:lint.bzl", "add_lint_tests") load("//tools/skylark:drake_py.bzl", "drake_py_binary") package(default_visibility = ["//visibility:private"]) filegroup( name = "models", srcs = [ "ball.sdf", "paddle.sdf", ], visibility = ["//:__pkg__"], ) drake_py_binary( name = "...
0
/home/johnshepherd/drake/examples/hydroelastic
/home/johnshepherd/drake/examples/hydroelastic/python_ball_paddle/README.md
# Ball and Paddle in Python This is a simple example of using the hydroelastic contact model in Python. The example drops a compliant-hydroelastic ball on a compliant-hydroelastic paddle (represented as a box). The two bodies are defined in SDFormat files. The compliant paddle is a box of size 20x20x2 cm. It is stati...
0
/home/johnshepherd/drake/examples/hydroelastic
/home/johnshepherd/drake/examples/hydroelastic/python_ball_paddle/ball.sdf
<?xml version="1.0"?> <sdf version="1.7"> <model name="ball"> <link name="ball"> <pose>0 0 0 0 0 0</pose> <inertial> <pose>0 0 0 0 0 0</pose> <mass>0.1</mass> <inertia> <!-- Solid sphere of radius r and mass m has: Inertia tensor = (2/5)mr^2 I_3x3 = 1.6e-5...
0
/home/johnshepherd/drake/examples/hydroelastic
/home/johnshepherd/drake/examples/hydroelastic/python_ball_paddle/paddle.sdf
<?xml version="1.0"?> <sdf version="1.7"> <model name="paddle"> <link name="paddle"> <pose>0 0 0 0 0 0</pose> <inertial> <pose>0 0 0 0 0 0</pose> <mass>5.0e3</mass> <inertia> <!-- The code will likely fix it to World frame, so the calculation here is just...
0