Skip to content

Commit

Permalink
multibody: Enable deprecation warnings on old packages (RobotLocomoti…
Browse files Browse the repository at this point in the history
…on#10231)

Port all of Drake to use the new C++ namespaces.
  • Loading branch information
jwnimmer-tri authored Dec 14, 2018
1 parent 6401076 commit 0ffde26
Show file tree
Hide file tree
Showing 131 changed files with 219 additions and 316 deletions.
2 changes: 1 addition & 1 deletion attic/multibody/plants.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/** @addtogroup rigid_body_systems
* @{
* @brief These systems are being replaced with
* drake::multibody::multibody_plant::MultibodyPlant and
* drake::multibody::MultibodyPlant and
* drake::geometry::SceneGraph.
* @ingroup systems
* @}
Expand Down
4 changes: 2 additions & 2 deletions bindings/pydrake/manipulation/planner_py.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ PYBIND11_MODULE(planner, m) {
py::arg("parameters"), doc.DoDifferentialInverseKinematics.doc);

m.def("DoDifferentialInverseKinematics",
[](const multibody::multibody_plant::MultibodyPlant<double>& robot,
[](const multibody::MultibodyPlant<double>& robot,
const systems::Context<double>& context,
const Vector6<double>& V_WE_desired,
const multibody::Frame<double>& frame_E,
Expand All @@ -119,7 +119,7 @@ PYBIND11_MODULE(planner, m) {
doc.DoDifferentialInverseKinematics.doc_4);

m.def("DoDifferentialInverseKinematics",
[](const multibody::multibody_plant::MultibodyPlant<double>& robot,
[](const multibody::MultibodyPlant<double>& robot,
const systems::Context<double>& context,
const Isometry3<double>& X_WE_desired,
const multibody::Frame<double>& frame_E,
Expand Down
2 changes: 0 additions & 2 deletions bindings/pydrake/multibody/inverse_kinematics_py.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ PYBIND11_MODULE(inverse_kinematics, m) {
using namespace drake::multibody;
constexpr auto& doc = pydrake_doc.drake.multibody;

using multibody_plant::MultibodyPlant;

m.doc() = "InverseKinematics module";

py::module::import("pydrake.solvers.mathematicalprogram");
Expand Down
2 changes: 1 addition & 1 deletion bindings/pydrake/multibody/parsing_py.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "drake/multibody/parsing/parser.h"

using drake::geometry::SceneGraph;
using drake::multibody::multibody_plant::MultibodyPlant;
using drake::multibody::MultibodyPlant;
using std::string;

namespace drake {
Expand Down
4 changes: 2 additions & 2 deletions bindings/pydrake/systems/controllers_py.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace pydrake {
PYBIND11_MODULE(controllers, m) {
// NOLINTNEXTLINE(build/namespaces): Emulate placement in namespace.
using namespace drake::systems::controllers;
using drake::multibody::multibody_plant::MultibodyPlant;
using drake::multibody::MultibodyPlant;
using drake::systems::Diagram;
using drake::systems::LeafSystem;
constexpr auto& doc = pydrake_doc.drake.systems.controllers;
Expand Down Expand Up @@ -96,7 +96,7 @@ PYBIND11_MODULE(controllers, m) {
py::class_<InverseDynamics<double>, LeafSystem<double>> idyn(
m, "InverseDynamics", doc.InverseDynamics.doc);
idyn // BR
.def(py::init<const multibody::multibody_plant::MultibodyPlant<double>*,
.def(py::init<const multibody::MultibodyPlant<double>*,
InverseDynamics<double>::InverseDynamicsMode>(),
py::arg("plant"), py::arg("mode"),
doc.InverseDynamics.ctor.doc_2args_plant_mode)
Expand Down
2 changes: 1 addition & 1 deletion bindings/pydrake/systems/rendering_py.cc
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ PYBIND11_MODULE(rendering, m) {
py::class_<MultibodyPositionToGeometryPose<T>, LeafSystem<T>>(m,
"MultibodyPositionToGeometryPose",
doc.MultibodyPositionToGeometryPose.doc)
.def(py::init<const multibody::multibody_plant::MultibodyPlant<T>&>(),
.def(py::init<const multibody::MultibodyPlant<T>&>(),
doc.MultibodyPositionToGeometryPose.ctor.doc_1args)
.def("get_input_port",
&MultibodyPositionToGeometryPose<T>::get_input_port,
Expand Down
2 changes: 1 addition & 1 deletion examples/allegro_hand/allegro_common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace allegro_hand {
const double AllegroHandMotionState::velocity_thresh_ = 0.07;

using drake::multibody::JointIndex;
using drake::multibody::multibody_plant::MultibodyPlant;
using drake::multibody::MultibodyPlant;

void SetPositionControlledGains(Eigen::VectorXd* Kp, Eigen::VectorXd* Ki,
Eigen::VectorXd* Kd) {
Expand Down
2 changes: 1 addition & 1 deletion examples/allegro_hand/allegro_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void SetPositionControlledGains(Eigen::VectorXd* Kp, Eigen::VectorXd* Ki,
/// @param Sy the matrix to match the output torque for the hand joint
/// actuators in the desired order into the input actuation of the plant.
void GetControlPortMapping(
const multibody::multibody_plant::MultibodyPlant<double>& plant,
const multibody::MultibodyPlant<double>& plant,
MatrixX<double>* Sx, MatrixX<double>* Sy);

/// Defines the desired ordering of the finger joints by name. The fingers are
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace examples {
namespace allegro_hand {
namespace {

using drake::multibody::multibody_plant::MultibodyPlant;
using drake::multibody::MultibodyPlant;

DEFINE_double(simulation_time, std::numeric_limits<double>::infinity(),
"Desired duration of the simulation in seconds");
Expand Down Expand Up @@ -105,8 +105,7 @@ void DoMain() {
plant.get_geometry_query_input_port());

// Publish contact results for visualization.
multibody::multibody_plant::ConnectContactResultsToDrakeVisualizer(
&builder, plant, &lcm);
multibody::ConnectContactResultsToDrakeVisualizer(&builder, plant, &lcm);

// PID controller for position control of the finger joints
VectorX<double> kp, kd, ki;
Expand Down
2 changes: 1 addition & 1 deletion examples/allegro_hand/run_allegro_constant_load_demo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace drake {
namespace examples {
namespace allegro_hand {

using drake::multibody::multibody_plant::MultibodyPlant;
using drake::multibody::MultibodyPlant;

DEFINE_double(constant_load, 0, "the constant load on each joint, Unit [Nm]."
"Suggested load is in the order of 0.01 Nm. When input value"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ DEFINE_double(simulation_sec, 0.1, "Number of seconds to simulate.");
using drake::geometry::SceneGraph;
using drake::lcm::DrakeLcm;
using drake::multibody::Body;
using drake::multibody::multibody_plant::MultibodyPlant;
using drake::multibody::MultibodyPlant;
using drake::multibody::MultibodyTree;
using drake::multibody::Parser;
using drake::multibody::UniformGravityFieldElement;
Expand Down
2 changes: 1 addition & 1 deletion examples/manipulation_station/manipulation_station.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ using math::RigidTransform;
using math::RollPitchYaw;
using math::RotationMatrix;
using multibody::Joint;
using multibody::MultibodyPlant;
using multibody::PrismaticJoint;
using multibody::RevoluteJoint;
using multibody::SpatialInertia;
using multibody::multibody_plant::MultibodyPlant;

const int kNumDofIiwa = 7;

Expand Down
16 changes: 7 additions & 9 deletions examples/manipulation_station/manipulation_station.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,21 +228,21 @@ class ManipulationStation : public systems::Diagram<T> {
/// RegisterIiwaControllerModel() and RegisterWsgControllerModel() have been
/// called.
///
/// @see multibody::multibody_plant::MultibodyPlant<T>::Finalize()
/// @see multibody::MultibodyPlant<T>::Finalize()
void Finalize();

/// Returns a reference to the main plant responsible for the dynamics of
/// the robot and the environment. This can be used to, e.g., add
/// additional elements into the world before calling Finalize().
const multibody::multibody_plant::MultibodyPlant<T>& get_multibody_plant()
const multibody::MultibodyPlant<T>& get_multibody_plant()
const {
return *plant_;
}

/// Returns a mutable reference to the main plant responsible for the
/// dynamics of the robot and the environment. This can be used to, e.g.,
/// add additional elements into the world before calling Finalize().
multibody::multibody_plant::MultibodyPlant<T>& get_mutable_multibody_plant() {
multibody::MultibodyPlant<T>& get_mutable_multibody_plant() {
return *plant_;
}

Expand All @@ -261,8 +261,7 @@ class ManipulationStation : public systems::Diagram<T> {
/// Return a reference to the plant used by the inverse dynamics controller
/// (which contains only a model of the iiwa + equivalent mass of the
/// gripper).
const multibody::multibody_plant::MultibodyPlant<T>& get_controller_plant()
const {
const multibody::MultibodyPlant<T>& get_controller_plant() const {
return *owned_controller_plant_;
}

Expand Down Expand Up @@ -365,13 +364,12 @@ class ManipulationStation : public systems::Diagram<T> {
void MakeIiwaControllerModel();

// These are only valid until Finalize() is called.
std::unique_ptr<multibody::multibody_plant::MultibodyPlant<T>> owned_plant_;
std::unique_ptr<multibody::MultibodyPlant<T>> owned_plant_;
std::unique_ptr<geometry::SceneGraph<T>> owned_scene_graph_;

// These are valid for the lifetime of this system.
std::unique_ptr<multibody::multibody_plant::MultibodyPlant<T>>
owned_controller_plant_;
multibody::multibody_plant::MultibodyPlant<T>* plant_;
std::unique_ptr<multibody::MultibodyPlant<T>> owned_controller_plant_;
multibody::MultibodyPlant<T>* plant_;
geometry::SceneGraph<T>* scene_graph_;

// Populated by RegisterIiwaControllerModel() and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace manipulation_station {

using Eigen::Isometry3d;
using Eigen::Vector3d;
using multibody::multibody_plant::MultibodyPlant;
using multibody::MultibodyPlant;
using multibody::Parser;
using robotlocomotion::image_array_t;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ class ManipulationStationHardwareInterface : public systems::Diagram<double> {
/// the IIWA arm, with the lumped-mass equivalent spatial inertia of the
/// Schunk WSG gripper.
// TODO(russt): Actually add the equivalent mass of the WSG.
const multibody::multibody_plant::MultibodyPlant<double>&
get_controller_plant() const {
const multibody::MultibodyPlant<double>& get_controller_plant() const {
return *owned_controller_plant_;
}

Expand All @@ -74,8 +73,7 @@ class ManipulationStationHardwareInterface : public systems::Diagram<double> {
}

private:
std::unique_ptr<multibody::multibody_plant::MultibodyPlant<double>>
owned_controller_plant_;
std::unique_ptr<multibody::MultibodyPlant<double>> owned_controller_plant_;
std::unique_ptr<lcm::DrakeLcm> owned_lcm_;
systems::lcm::LcmSubscriberSystem* wsg_status_subscriber_;
systems::lcm::LcmSubscriberSystem* iiwa_status_subscriber_;
Expand Down
2 changes: 1 addition & 1 deletion examples/manipulation_station/proof_of_life.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ int do_main(int argc, char* argv[]) {

geometry::ConnectDrakeVisualizer(&builder, station->get_mutable_scene_graph(),
station->GetOutputPort("pose_bundle"));
multibody::multibody_plant::ConnectContactResultsToDrakeVisualizer(
multibody::ConnectContactResultsToDrakeVisualizer(
&builder, station->get_mutable_multibody_plant(),
station->GetOutputPort("contact_results"));

Expand Down
2 changes: 1 addition & 1 deletion examples/multibody/acrobot/passive_simulation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ using geometry::SourceId;
using lcm::DrakeLcm;
using multibody::benchmarks::acrobot::AcrobotParameters;
using multibody::benchmarks::acrobot::MakeAcrobotPlant;
using multibody::multibody_plant::MultibodyPlant;
using multibody::MultibodyPlant;
using multibody::RevoluteJoint;
using systems::ImplicitEulerIntegrator;
using systems::RungeKutta3Integrator;
Expand Down
2 changes: 1 addition & 1 deletion examples/multibody/acrobot/run_lqr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ using geometry::SceneGraph;
using lcm::DrakeLcm;
using multibody::benchmarks::acrobot::AcrobotParameters;
using multibody::benchmarks::acrobot::MakeAcrobotPlant;
using multibody::multibody_plant::MultibodyPlant;
using multibody::MultibodyPlant;
using multibody::Parser;
using multibody::JointActuator;
using multibody::RevoluteJoint;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ using systems::RungeKutta3Integrator;
using systems::SemiExplicitEulerIntegrator;

// "multibody" namespace is ambiguous here without "drake::".
using drake::multibody::multibody_plant::CoulombFriction;
using drake::multibody::multibody_plant::MultibodyPlant;
using drake::multibody::CoulombFriction;
using drake::multibody::MultibodyPlant;
using drake::multibody::MultibodyTree;
using drake::multibody::QuaternionFloatingMobilizer;

Expand Down
6 changes: 3 additions & 3 deletions examples/multibody/bouncing_ball/make_bouncing_ball_plant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ namespace bouncing_ball {
using geometry::Sphere;
using geometry::HalfSpace;
using geometry::SceneGraph;
using drake::multibody::multibody_plant::CoulombFriction;
using drake::multibody::multibody_plant::MultibodyPlant;
using drake::multibody::CoulombFriction;
using drake::multibody::MultibodyPlant;
using drake::multibody::RigidBody;
using drake::multibody::SpatialInertia;
using drake::multibody::UniformGravityFieldElement;
using drake::multibody::UnitInertia;

std::unique_ptr<drake::multibody::multibody_plant::MultibodyPlant<double>>
std::unique_ptr<drake::multibody::MultibodyPlant<double>>
MakeBouncingBallPlant(double radius, double mass,
const CoulombFriction<double>& surface_friction,
const Vector3<double>& gravity_W,
Expand Down
5 changes: 2 additions & 3 deletions examples/multibody/bouncing_ball/make_bouncing_ball_plant.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,10 @@ namespace bouncing_ball {
/// will register the new multibody plant to be a source for that geometry
/// system and it will also register geometry for collision.
/// If this argument is omitted, no geometry will be registered.
std::unique_ptr<drake::multibody::multibody_plant::MultibodyPlant<double>>
std::unique_ptr<drake::multibody::MultibodyPlant<double>>
MakeBouncingBallPlant(
double radius, double mass,
const drake::multibody::multibody_plant::CoulombFriction<double>&
surface_friction,
const drake::multibody::CoulombFriction<double>& surface_friction,
const Vector3<double>& gravity_W,
geometry::SceneGraph<double>* scene_graph = nullptr);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ using geometry::SceneGraph;
using lcm::DrakeLcm;

// "multibody" namespace is ambiguous here without "drake::".
using drake::multibody::multibody_plant::MultibodyPlant;
using drake::multibody::MultibodyPlant;
using drake::multibody::Parser;
using drake::multibody::PrismaticJoint;
using drake::multibody::RevoluteJoint;
Expand Down
2 changes: 1 addition & 1 deletion examples/multibody/cart_pole/test/cart_pole_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace {

using drake::multibody::Body;
using drake::multibody::JointActuator;
using drake::multibody::multibody_plant::MultibodyPlant;
using drake::multibody::MultibodyPlant;
using drake::multibody::Parser;
using drake::multibody::PrismaticJoint;
using drake::multibody::RevoluteJoint;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ using geometry::SceneGraph;
using lcm::DrakeLcm;

// "multibody" namespace is ambiguous here without "drake::".
using drake::multibody::multibody_plant::CoulombFriction;
using drake::multibody::multibody_plant::ConnectContactResultsToDrakeVisualizer;
using drake::multibody::multibody_plant::MultibodyPlant;
using drake::multibody::CoulombFriction;
using drake::multibody::ConnectContactResultsToDrakeVisualizer;
using drake::multibody::MultibodyPlant;
using drake::multibody::MultibodyTree;
using drake::multibody::SpatialVelocity;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ using geometry::Cylinder;
using geometry::HalfSpace;
using geometry::SceneGraph;
using geometry::Sphere;
using drake::multibody::multibody_plant::CoulombFriction;
using drake::multibody::multibody_plant::MultibodyPlant;
using drake::multibody::CoulombFriction;
using drake::multibody::MultibodyPlant;
using drake::multibody::RigidBody;
using drake::multibody::SpatialInertia;
using drake::multibody::UniformGravityFieldElement;
Expand Down Expand Up @@ -66,7 +66,7 @@ void AddCylinderWithMultiContact(
}
}

std::unique_ptr<drake::multibody::multibody_plant::MultibodyPlant<double>>
std::unique_ptr<drake::multibody::MultibodyPlant<double>>
MakeCylinderPlant(double radius, double length, double mass,
const CoulombFriction<double>& surface_friction,
const Vector3<double>& gravity_W, double dt,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ namespace cylinder_with_multicontact {
/// multibody plant to be a source for that scene graph and it will also
/// register geometry for contact modeling.
/// @throws std::exception if scene_graph is nullptr.
std::unique_ptr<drake::multibody::multibody_plant::MultibodyPlant<double>>
std::unique_ptr<drake::multibody::MultibodyPlant<double>>
MakeCylinderPlant(
double radius, double length, double mass,
const drake::multibody::multibody_plant::CoulombFriction<double>&
const drake::multibody::CoulombFriction<double>&
surface_friction, const Vector3<double>& gravity_W,
double dt,
geometry::SceneGraph<double>* scene_graph = nullptr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ namespace cylinder_with_multicontact {
namespace {

using drake::geometry::SceneGraph;
using drake::multibody::multibody_plant::CoulombFriction;
using drake::multibody::multibody_plant::MultibodyPlant;
using drake::multibody::CoulombFriction;
using drake::multibody::MultibodyPlant;
using drake::multibody::RigidBody;
using drake::multibody::SpatialInertia;
using Eigen::Vector3d;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ using lcm::DrakeLcm;

// "multibody" namespace is ambiguous here without "drake::".
using drake::multibody::benchmarks::inclined_plane::MakeInclinedPlanePlant;
using drake::multibody::multibody_plant::CoulombFriction;
using drake::multibody::multibody_plant::MultibodyPlant;
using drake::multibody::CoulombFriction;
using drake::multibody::MultibodyPlant;
using drake::multibody::MultibodyTree;

int do_main() {
Expand Down
2 changes: 1 addition & 1 deletion examples/multibody/pendulum/passive_simulation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ using geometry::SourceId;
using lcm::DrakeLcm;
using multibody::benchmarks::pendulum::MakePendulumPlant;
using multibody::benchmarks::pendulum::PendulumParameters;
using multibody::multibody_plant::MultibodyPlant;
using multibody::MultibodyPlant;
using multibody::RevoluteJoint;
using systems::ImplicitEulerIntegrator;
using systems::RungeKutta3Integrator;
Expand Down
6 changes: 3 additions & 3 deletions examples/simple_gripper/simple_gripper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ using drake::lcm::DrakeLcm;
using drake::math::RollPitchYaw;
using drake::math::RotationMatrix;
using drake::multibody::Body;
using drake::multibody::multibody_plant::CoulombFriction;
using drake::multibody::multibody_plant::ConnectContactResultsToDrakeVisualizer;
using drake::multibody::multibody_plant::MultibodyPlant;
using drake::multibody::CoulombFriction;
using drake::multibody::ConnectContactResultsToDrakeVisualizer;
using drake::multibody::MultibodyPlant;
using drake::multibody::Parser;
using drake::multibody::PrismaticJoint;
using drake::multibody::UniformGravityFieldElement;
Expand Down
Loading

0 comments on commit 0ffde26

Please sign in to comment.