Skip to content

Commit

Permalink
Moves SDF and URDF Parsers Into libdrakeMultibodyParsers (RobotLocomo…
Browse files Browse the repository at this point in the history
…tion#4482)

* Moved SDF and URDF parsers, and their supporting classes into a new library called libdrakeParsers.

* Update BUILD for parsers

* Improve error message

* Fix test to work in Bazel sandbox

* bumped director version.

* Moved SDF and URDF parsers, and their supporting classes into a new library called libdrakeParsers.

* Update BUILD for parsers

* Improve error message

* Fix test to work in Bazel sandbox

* bumped director version.

* Move xml_utils into drake/multibody/parsers.

* Added missing xml_util files.

* Renamed library "drakeParsers" to be "drakeMultibodyParsers".

* Updated Director external's origin back to upstream remote.
  • Loading branch information
Chien-Liang Fok authored Dec 14, 2016
1 parent 21ab55d commit cff6874
Show file tree
Hide file tree
Showing 123 changed files with 473 additions and 317 deletions.
1 change: 1 addition & 0 deletions drake/automotive/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ cc_library(
":simple_car",
":trajectory_car",
"//drake/lcm",
"//drake/multibody/parsers:multi_body_parsers",
"//drake/multibody/rigid_body_plant:drake_visualizer",
"//drake/systems/analysis",
"//drake/systems/lcm",
Expand Down
1 change: 1 addition & 0 deletions drake/automotive/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ if(lcm_FOUND)
)
target_link_libraries(drakeAutomotiveLcm
drakeAutomotive
drakeMultibodyParsers
drakeRigidBodyPlant
)
drake_install_libraries(drakeAutomotiveLcm)
Expand Down
6 changes: 3 additions & 3 deletions drake/automotive/automotive_simulator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
#include "drake/common/text_logging.h"
#include "drake/lcm/drake_lcm.h"
#include "drake/multibody/joints/floating_base_types.h"
#include "drake/multibody/parser_model_instance_id_table.h"
#include "drake/multibody/parser_sdf.h"
#include "drake/multibody/parser_urdf.h"
#include "drake/multibody/parsers/model_instance_id_table.h"
#include "drake/multibody/parsers/sdf_parser.h"
#include "drake/multibody/parsers/urdf_parser.h"
#include "drake/multibody/rigid_body_plant/drake_visualizer.h"
#include "drake/systems/analysis/simulator.h"
#include "drake/systems/framework/diagram.h"
Expand Down
2 changes: 1 addition & 1 deletion drake/automotive/car_sim_lcm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "drake/common/eigen_types.h"
#include "drake/common/text_logging_gflags.h"
#include "drake/lcm/drake_lcm.h"
#include "drake/multibody/parser_sdf.h"
#include "drake/multibody/parsers/sdf_parser.h"
#include "drake/multibody/rigid_body_tree_construction.h"
#include "drake/systems/analysis/simulator.h"
#include "drake/systems/framework/diagram.h"
Expand Down
4 changes: 2 additions & 2 deletions drake/bindings/swig/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if(NOT DISABLE_PYTHON)

add_swig_python_module(rbtPython rbtree.i
CPLUSPLUS
LINK_LIBRARIES drakeRBM
LINK_LIBRARIES drakeMultibodyParsers drakeRBM
SWIG_INCLUDE_DIRS ${DRAKE_SWIG_FILES}/python ${DRAKE_SWIG_FILES}/common
DESTINATION ${python_install_subdir})

Expand All @@ -68,7 +68,7 @@ if(Matlab_FOUND)

add_swig_matlab_module(rbtMatlab rbtree_matlab.i
CPLUSPLUS
LINK_LIBRARIES drakeRBM
LINK_LIBRARIES drakeMultibodyParsers drakeRBM
SWIG_INCLUDE_DIRS ${DRAKE_SWIG_FILES}/matlab ${DRAKE_SWIG_FILES}/common
DESTINATION ${matlab_install_subdir})

Expand Down
8 changes: 4 additions & 4 deletions drake/bindings/swig/rbtree.i
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include <Python.h>
#endif
#include "drake/multibody/joints/floating_base_types.h"
#include "drake/multibody/package_map.h"
#include "drake/multibody/parser_urdf.h"
#include "drake/multibody/parsers/package_map.h"
#include "drake/multibody/parsers/urdf_parser.h"
#include "drake/multibody/rigid_body_tree.h"
%}

Expand Down Expand Up @@ -67,12 +67,12 @@

%include "drake/multibody/rigid_body_frame.h"

%include "drake/multibody/package_map.h"
%include "drake/multibody/parsers/package_map.h"

%inline %{
typedef std::map<std::string, int> ModelInstanceIdTable;
%}
%include "drake/multibody/parser_urdf.h"
%include "drake/multibody/parsers/urdf_parser.h"

%immutable RigidBodyTree::actuators;
%immutable RigidBodyTree::loops;
Expand Down
8 changes: 7 additions & 1 deletion drake/examples/Acrobot/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
add_library_with_exports(LIB_NAME drakeAcrobotPlant
SOURCE_FILES acrobot_plant.cc)
target_link_libraries(drakeAcrobotPlant drakeSystemFramework drakeLinearControl drakeSensors)
target_link_libraries(drakeAcrobotPlant
drakeLinearControl
drakeMultibodyParsers
drakeSensors
drakeSystemFramework)

if(lcm_FOUND)
add_executable(acrobot_run_passive acrobot_run_passive.cc)
Expand All @@ -13,6 +17,7 @@ if(lcm_FOUND)
add_executable(acrobot_run_lqr acrobot_run_lqr.cc)
target_link_libraries(acrobot_run_lqr
drakeAcrobotPlant
drakeMultibodyParsers
drakeRigidBodyPlant
drakeSystemAnalysis)
add_test(NAME acrobot_run_lqr COMMAND acrobot_run_lqr -realtime_factor 0.0)
Expand All @@ -21,6 +26,7 @@ if(lcm_FOUND)
target_link_libraries(acrobot_run_lqr_w_estimator
drakeAcrobotPlant
drakeEstimators
drakeMultibodyParsers
drakeRigidBodyPlant
drakeSensors
drakeSystemAnalysis)
Expand Down
2 changes: 1 addition & 1 deletion drake/examples/Acrobot/acrobot_run_lqr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "drake/examples/Acrobot/gen/acrobot_state_vector.h"
#include "drake/lcm/drake_lcm.h"
#include "drake/multibody/joints/floating_base_types.h"
#include "drake/multibody/parser_urdf.h"
#include "drake/multibody/parsers/urdf_parser.h"
#include "drake/multibody/rigid_body_plant/drake_visualizer.h"
#include "drake/multibody/rigid_body_tree.h"
#include "drake/systems/analysis/simulator.h"
Expand Down
2 changes: 1 addition & 1 deletion drake/examples/Acrobot/acrobot_run_lqr_w_estimator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "drake/lcm/drake_lcm.h"
#include "drake/lcm/lcm_call_matlab.h"
#include "drake/multibody/joints/floating_base_types.h"
#include "drake/multibody/parser_urdf.h"
#include "drake/multibody/parsers/urdf_parser.h"
#include "drake/multibody/rigid_body_plant/drake_visualizer.h"
#include "drake/multibody/rigid_body_tree.h"
#include "drake/systems/analysis/simulator.h"
Expand Down
2 changes: 1 addition & 1 deletion drake/examples/Acrobot/acrobot_run_passive.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "drake/examples/Acrobot/gen/acrobot_state_vector.h"
#include "drake/lcm/drake_lcm.h"
#include "drake/multibody/joints/floating_base_types.h"
#include "drake/multibody/parser_urdf.h"
#include "drake/multibody/parsers/urdf_parser.h"
#include "drake/multibody/rigid_body_plant/drake_visualizer.h"
#include "drake/multibody/rigid_body_tree.h"
#include "drake/systems/analysis/simulator.h"
Expand Down
2 changes: 1 addition & 1 deletion drake/examples/Acrobot/test/acrobot_urdf_dynamics_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "drake/common/eigen_matrix_compare.h"
#include "drake/examples/Acrobot/acrobot_plant.h"
#include "drake/multibody/joints/floating_base_types.h"
#include "drake/multibody/parser_urdf.h"
#include "drake/multibody/parsers/urdf_parser.h"
#include "drake/multibody/rigid_body_plant/rigid_body_plant.h"

namespace drake {
Expand Down
6 changes: 5 additions & 1 deletion drake/examples/Pendulum/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
if(lcm_FOUND)
add_library_with_exports(LIB_NAME drakePendulumPlant
SOURCE_FILES pendulum_swing_up.cc pendulum_plant.cc)
target_link_libraries(drakePendulumPlant
target_link_libraries(drakePendulumPlant
drakeMultibodyParsers
drakeSystemFramework
drakeTrajectoryOptimization)
drake_install_libraries(drakePendulumPlant)
Expand All @@ -15,6 +16,7 @@ if(lcm_FOUND)

add_executable(pendulum_run_dynamics pendulum_run_dynamics.cc)
target_link_libraries(pendulum_run_dynamics
drakeMultibodyParsers
drakePendulumPlant
drakeRigidBodyPlant
drakeSystemAnalysis
Expand All @@ -24,6 +26,7 @@ if(lcm_FOUND)

add_executable(pendulum_run_energy_shaping pendulum_run_energy_shaping.cc)
target_link_libraries(pendulum_run_energy_shaping
drakeMultibodyParsers
drakePendulumPlant
drakeRigidBodyPlant
drakeSystemAnalysis)
Expand All @@ -32,6 +35,7 @@ if(lcm_FOUND)

add_executable(pendulum_run_lqr pendulum_run_lqr.cc)
target_link_libraries(pendulum_run_lqr
drakeMultibodyParsers
drakePendulumPlant
drakeRigidBodyPlant
drakeSystemAnalysis
Expand Down
2 changes: 1 addition & 1 deletion drake/examples/Pendulum/pendulum_run_dynamics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "drake/examples/Pendulum/pendulum_plant.h"
#include "drake/lcm/drake_lcm.h"
#include "drake/multibody/joints/floating_base_types.h"
#include "drake/multibody/parser_urdf.h"
#include "drake/multibody/parsers/urdf_parser.h"
#include "drake/multibody/rigid_body_plant/drake_visualizer.h"
#include "drake/multibody/rigid_body_tree.h"
#include "drake/systems/analysis/simulator.h"
Expand Down
2 changes: 1 addition & 1 deletion drake/examples/Pendulum/pendulum_run_energy_shaping.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "drake/systems/framework/diagram_builder.h"
#include "drake/systems/framework/leaf_system.h"
#include "drake/multibody/joints/floating_base_types.h"
#include "drake/multibody/parser_urdf.h"
#include "drake/multibody/parsers/urdf_parser.h"
#include "drake/multibody/rigid_body_plant/drake_visualizer.h"

namespace drake {
Expand Down
2 changes: 1 addition & 1 deletion drake/examples/Pendulum/pendulum_run_lqr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "drake/examples/Pendulum/pendulum_plant.h"
#include "drake/lcm/drake_lcm.h"
#include "drake/multibody/joints/floating_base_types.h"
#include "drake/multibody/parser_urdf.h"
#include "drake/multibody/parsers/urdf_parser.h"
#include "drake/multibody/rigid_body_plant/drake_visualizer.h"
#include "drake/systems/analysis/simulator.h"
#include "drake/systems/controllers/linear_quadratic_regulator.h"
Expand Down
2 changes: 1 addition & 1 deletion drake/examples/Pendulum/pendulum_run_swing_up.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "drake/examples/Pendulum/pendulum_swing_up.h"
#include "drake/lcm/drake_lcm.h"
#include "drake/multibody/joints/floating_base_types.h"
#include "drake/multibody/parser_urdf.h"
#include "drake/multibody/parsers/urdf_parser.h"
#include "drake/multibody/rigid_body_plant/drake_visualizer.h"
#include "drake/systems/analysis/simulator.h"
#include "drake/systems/controllers/pid_controlled_system.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "drake/common/eigen_matrix_compare.h"
#include "drake/examples/Pendulum/pendulum_plant.h"
#include "drake/multibody/joints/floating_base_types.h"
#include "drake/multibody/parser_urdf.h"
#include "drake/multibody/parsers/urdf_parser.h"
#include "drake/multibody/rigid_body_plant/rigid_body_plant.h"

namespace drake {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ target_link_libraries(setpoint_test
if(lcm_FOUND)
drake_add_cc_test(NAME lcm_utils_test)
target_link_libraries(lcm_utils_test
drakeMultibodyParsers
drakeQPControllerLcmTranslator
drakeQPController
GTest::GTest GTest::Main)
Expand All @@ -14,6 +15,7 @@ endif()
if(gurobi_FOUND)
drake_add_cc_test(NAME valkyrie_balancing_test SIZE medium)
target_link_libraries(valkyrie_balancing_test
drakeMultibodyParsers
drakeQPController
GTest::GTest GTest::Main)
endif()
Expand All @@ -23,6 +25,7 @@ if(gurobi_FOUND AND lcm_FOUND)
valkyrie_qp_inverse_dynamics_controller.cc)
target_link_libraries(valkyrie_qp_inverse_dynamics_controller
drakeLCMSystem2
drakeMultibodyParsers
drakeQPController
drakeQPControllerLcmTranslator
drakeRigidBodyPlant
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "drake/examples/QPInverseDynamicsForHumanoids/example_qp_input_for_valkyrie.h"
#include "drake/examples/QPInverseDynamicsForHumanoids/lcm_utils.h"
#include "drake/multibody/joints/floating_base_types.h"
#include "drake/multibody/parser_urdf.h"
#include "drake/multibody/parsers/urdf_parser.h"
#include "drake/multibody/rigid_body_tree.h"

namespace drake {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "drake/examples/QPInverseDynamicsForHumanoids/example_qp_input_for_valkyrie.h"
#include "drake/examples/QPInverseDynamicsForHumanoids/qp_controller.h"
#include "drake/multibody/joints/floating_base_types.h"
#include "drake/multibody/parser_urdf.h"
#include "drake/multibody/parsers/urdf_parser.h"

namespace drake {
namespace examples {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "drake/examples/QPInverseDynamicsForHumanoids/system/robot_state_decoder_system.h"
#include "drake/lcm/drake_lcm.h"
#include "drake/multibody/joints/floating_base_types.h"
#include "drake/multibody/parser_urdf.h"
#include "drake/multibody/parsers/urdf_parser.h"
#include "drake/systems/framework/diagram.h"
#include "drake/systems/framework/diagram_builder.h"
#include "drake/systems/lcm/lcm_publisher_system.h"
Expand Down
11 changes: 6 additions & 5 deletions drake/examples/Quadrotor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
if(lcm_FOUND)
add_executable(run_quadrotor_dynamics run_quadrotor_dynamics.cc)
target_link_libraries(run_quadrotor_dynamics
drakeRigidBodyPlant
drakeSystemAnalysis
drakeSystemPrimitives
drakeLCMSystem2
gflags)
drakeLCMSystem2
drakeMultibodyParsers
drakeRigidBodyPlant
drakeSystemAnalysis
drakeSystemPrimitives
gflags)
drake_add_test(NAME run_quadrotor_dynamics COMMAND run_quadrotor_dynamics --duration=1.0 SIZE medium)
endif()

Expand Down
4 changes: 2 additions & 2 deletions drake/examples/Quadrotor/run_quadrotor_dynamics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#include "drake/common/drake_path.h"
#include "drake/common/text_logging.h"
#include "drake/lcm/drake_lcm.h"
#include "drake/multibody/parser_sdf.h"
#include "drake/multibody/parser_urdf.h"
#include "drake/multibody/parsers/sdf_parser.h"
#include "drake/multibody/parsers/urdf_parser.h"
#include "drake/multibody/rigid_body_plant/drake_visualizer.h"
#include "drake/multibody/rigid_body_plant/rigid_body_plant.h"
#include "drake/multibody/rigid_body_tree_construction.h"
Expand Down
6 changes: 4 additions & 2 deletions drake/examples/Valkyrie/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ if (lcm_FOUND)

add_executable(valkyrie_simulation valkyrie_simulation.cc valkyrie_constants.cc)
target_link_libraries(valkyrie_simulation
drakeRigidBodyPlant
drakeLCMSystem2
drakeMultibodyParsers
drakeRigidBodyPlant
drakeRobotStateEncoder
drakeSystemAnalysis
drakeSystemFramework
Expand All @@ -70,8 +71,9 @@ if (lcm_FOUND)

add_executable(valkyrie_pd_ff_controller valkyrie_pd_ff_controller.cc valkyrie_constants.cc)
target_link_libraries(valkyrie_pd_ff_controller
drakeRigidBodyPlant
drakeLCMSystem2
drakeMultibodyParsers
drakeRigidBodyPlant
drakeRobotStateDecoder
drakeSystemFramework)
endif()
Expand Down
16 changes: 10 additions & 6 deletions drake/examples/Valkyrie/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,30 @@ if(lcm_FOUND)
drake_add_cc_test(robot_state_encoder_decoder_test)
add_definitions(-g)
target_link_libraries(robot_state_encoder_decoder_test
drakeRobotStateEncoder
drakeMultibodyParsers
drakeRobotStateDecoder
drakeRobotStateEncoder
drakeSystemPrimitives)

drake_add_cc_test(robot_command_to_desired_effort_converter_test)
target_link_libraries(robot_command_to_desired_effort_converter_test
drakeRobotCommandToDesiredEffortConverter
drakeMultibodyParsers
drakeRBM
drakeSystemPrimitives)
drakeSystemPrimitives
drakeRobotCommandToDesiredEffortConverter)

add_executable(valkyrie_ik_test valkyrie_ik_test.cc)
target_link_libraries(valkyrie_ik_test
GTest::GTest GTest::Main
drakeCommon
drakeIK
drakeLcm
drakeMultibodyParsers
drakeRBM
drakeRigidBodyPlant
drakeSystemFramework
drakeSystemPrimitives
drakeSystemAnalysis
drakeRBM
GTest::GTest GTest::Main)
drakeSystemFramework
drakeSystemPrimitives)
drake_add_test(NAME valkyrie_ik_test WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" COMMAND valkyrie_ik_test)
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "drake/common/drake_path.h"
#include "drake/common/eigen_matrix_compare.h"
#include "drake/multibody/parser_urdf.h"
#include "drake/multibody/parsers/urdf_parser.h"
#include "drake/systems/framework/diagram_builder.h"
#include "drake/systems/primitives/constant_value_source.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "drake/common/drake_path.h"
#include "drake/common/eigen_matrix_compare.h"
#include "drake/math/quaternion.h"
#include "drake/multibody/parser_urdf.h"
#include "drake/multibody/parsers/urdf_parser.h"
#include "drake/multibody/rigid_body_plant/contact_results.h"
#include "drake/multibody/rigid_body_plant/kinematics_results.h"
#include "drake/multibody/rigid_body_tree_construction.h"
Expand Down
2 changes: 1 addition & 1 deletion drake/examples/Valkyrie/test/valkyrie_ik_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "drake/common/drake_path.h"
#include "drake/lcm/drake_lcm.h"
#include "drake/multibody/joints/floating_base_types.h"
#include "drake/multibody/parser_urdf.h"
#include "drake/multibody/parsers/urdf_parser.h"
#include "drake/multibody/rigid_body_plant/drake_visualizer.h"
#include "drake/multibody/rigid_body_tree.h"
#include "drake/systems/analysis/simulator.h"
Expand Down
2 changes: 1 addition & 1 deletion drake/examples/Valkyrie/valkyrie_pd_ff_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "drake/examples/Valkyrie/valkyrie_pd_ff_controller.h"
#include "drake/multibody/joints/floating_base_types.h"
#include "drake/multibody/kinematics_cache.h"
#include "drake/multibody/parser_urdf.h"
#include "drake/multibody/parsers/urdf_parser.h"
#include "drake/lcm/drake_lcm.h"
#include "drake/systems/framework/diagram_builder.h"
#include "drake/systems/lcm/lcm_publisher_system.h"
Expand Down
Loading

0 comments on commit cff6874

Please sign in to comment.