Skip to content

Commit

Permalink
Merge pull request #44 from mpetersen94/deprecated_solvers
Browse files Browse the repository at this point in the history
Change pydrake imports due to deprecation
  • Loading branch information
mpetersen94 authored Mar 7, 2023
2 parents 60b2074 + 440c4bf commit b3f92de
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 23 deletions.
2 changes: 1 addition & 1 deletion examples/simple_2D_planning.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"import matplotlib.pyplot as plt\n",
"\n",
"from pydrake.geometry.optimization import HPolyhedron\n",
"from pydrake.solvers.mosek import MosekSolver\n",
"from pydrake.solvers import MosekSolver\n",
"from pydrake.trajectories import PiecewisePolynomial\n",
"\n",
"from gcs.bezier import BezierGCS\n",
Expand Down
5 changes: 2 additions & 3 deletions examples/uav_planning.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@
"from scipy.spatial import ConvexHull\n",
"from IPython.display import SVG\n",
"\n",
"from pydrake.examples.quadrotor import QuadrotorGeometry\n",
"from pydrake.examples import QuadrotorGeometry\n",
"from pydrake.geometry import MeshcatVisualizer, Rgba, StartMeshcat\n",
"from pydrake.geometry.optimization import HPolyhedron, VPolytope\n",
"from pydrake.multibody.plant import AddMultibodyPlantSceneGraph\n",
"from pydrake.multibody.parsing import Parser\n",
"from pydrake.perception import PointCloud\n",
"from pydrake.solvers.gurobi import GurobiSolver\n",
"from pydrake.solvers.mosek import MosekSolver\n",
"from pydrake.solvers import GurobiSolver, MosekSolver\n",
"from pydrake.systems.analysis import Simulator\n",
"from pydrake.systems.framework import DiagramBuilder\n",
"\n",
Expand Down
9 changes: 5 additions & 4 deletions gcs/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
GraphOfConvexSetsOptions,
Point,
)
from pydrake.solvers.mathematicalprogram import (
from pydrake.solvers import (
CommonSolverOption,
GurobiSolver,
MathematicalProgram,
MosekSolver,
SolverOptions,
)
from pydrake.solvers.gurobi import GurobiSolver
from pydrake.solvers.mosek import MosekSolver
from pydrake.all import MathematicalProgram, le
from pydrake.all import le

from gcs.rounding import MipPathExtraction

Expand Down
2 changes: 1 addition & 1 deletion gcs/bezier.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
BsplineBasis_,
KnotVectorType,
)
from pydrake.solvers.mathematicalprogram import(
from pydrake.solvers import(
Binding,
Constraint,
Cost,
Expand Down
2 changes: 1 addition & 1 deletion gcs/linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from pydrake.geometry.optimization import (
Point,
)
from pydrake.solvers.mathematicalprogram import (
from pydrake.solvers import (
Binding,
Constraint,
Cost,
Expand Down
3 changes: 1 addition & 2 deletions reproduction/bimanual/bimanual_iiwa_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
"from pydrake.multibody.parsing import LoadModelDirectives, Parser, ProcessModelDirectives\n",
"from pydrake.multibody.plant import AddMultibodyPlantSceneGraph\n",
"from pydrake.multibody.tree import RevoluteJoint\n",
"from pydrake.solvers.gurobi import GurobiSolver\n",
"from pydrake.solvers.mosek import MosekSolver\n",
"from pydrake.solvers import GurobiSolver, MosekSolver\n",
"from pydrake.systems.framework import DiagramBuilder\n",
"\n",
"from gcs.linear import LinearGCS\n",
Expand Down
3 changes: 1 addition & 2 deletions reproduction/bimanual/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
from pydrake.multibody.parsing import LoadModelDirectives, Parser, ProcessModelDirectives
from pydrake.multibody.plant import AddMultibodyPlantSceneGraph, MultibodyPlant
from pydrake.perception import PointCloud
from pydrake.solvers.mathematicalprogram import Solve
from pydrake.solvers.mosek import MosekSolver
from pydrake.solvers import MosekSolver, Solve
from pydrake.systems.analysis import Simulator
from pydrake.systems.framework import DiagramBuilder, LeafSystem
from pydrake.systems.primitives import TrajectorySource
Expand Down
2 changes: 1 addition & 1 deletion reproduction/maze_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"from random import choice, randint, seed\n",
"\n",
"from pydrake.geometry.optimization import HPolyhedron\n",
"from pydrake.solvers.mosek import MosekSolver\n",
"from pydrake.solvers import MosekSolver\n",
"\n",
"from gcs.bezier import BezierGCS\n",
"from gcs.linear import LinearGCS\n",
Expand Down
2 changes: 1 addition & 1 deletion reproduction/min_length_vs_min_time.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"from scipy.spatial import ConvexHull\n",
"\n",
"from pydrake.geometry.optimization import HPolyhedron\n",
"from pydrake.solvers.mosek import MosekSolver\n",
"from pydrake.solvers import MosekSolver\n",
"\n",
"from gcs.bezier import BezierGCS\n",
"from gcs.linear import LinearGCS\n",
Expand Down
2 changes: 1 addition & 1 deletion reproduction/prm_comparison/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from pydrake.trajectories import PiecewisePolynomial
from pydrake.systems.analysis import Simulator
from pydrake.multibody import inverse_kinematics
from pydrake.solvers.mathematicalprogram import Solve
from pydrake.solvers import Solve

from reproduction.util import *

Expand Down
3 changes: 1 addition & 2 deletions reproduction/prm_comparison/prm_comparison.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
"from pydrake.multibody.parsing import LoadModelDirectives, Parser, ProcessModelDirectives\n",
"from pydrake.multibody.plant import AddMultibodyPlantSceneGraph\n",
"from pydrake.planning.common_robotics_utilities import SimpleRRTPlannerState\n",
"from pydrake.solvers.gurobi import GurobiSolver\n",
"from pydrake.solvers.mosek import MosekSolver\n",
"from pydrake.solvers import GurobiSolver, MosekSolver\n",
"from pydrake.systems.framework import DiagramBuilder\n",
"\n",
"from gcs.linear import LinearGCS\n",
Expand Down
2 changes: 1 addition & 1 deletion reproduction/uav/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import time

from pydrake.systems.framework import LeafSystem
from pydrake.solvers.mosek import MosekSolver
from pydrake.solvers import MosekSolver

from gcs.bezier import BezierGCS
from gcs.rounding import *
Expand Down
5 changes: 2 additions & 3 deletions reproduction/uav/uav_generated_rooms.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@
"from scipy.spatial import ConvexHull\n",
"from IPython.display import SVG\n",
"\n",
"from pydrake.examples.quadrotor import QuadrotorGeometry\n",
"from pydrake.examples import QuadrotorGeometry\n",
"from pydrake.geometry import MeshcatVisualizerCpp, Rgba, StartMeshcat\n",
"from pydrake.geometry.optimization import HPolyhedron, VPolytope\n",
"from pydrake.multibody.plant import AddMultibodyPlantSceneGraph\n",
"from pydrake.multibody.parsing import Parser\n",
"from pydrake.perception import PointCloud\n",
"from pydrake.solvers.gurobi import GurobiSolver\n",
"from pydrake.solvers.mosek import MosekSolver\n",
"from pydrake.solvers import GurobiSolver, MosekSolver\n",
"from pydrake.systems.analysis import Simulator\n",
"from pydrake.systems.framework import DiagramBuilder\n",
"\n",
Expand Down

0 comments on commit b3f92de

Please sign in to comment.