From bdb2a61fa7d352f068a778abf77165eaafd6dc7b Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Fri, 18 Dec 2020 21:05:54 -0800 Subject: [PATCH 1/3] compile fixes on Mac (more to follow) --- examples/tiny_visual_instance_generator.h | 4 ++-- src/link.hpp | 2 +- src/math/eigen_algebra.hpp | 2 +- src/mb_constraint_solver.hpp | 6 +++--- src/multi_body.hpp | 6 +++--- third_party/bullet3 | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/examples/tiny_visual_instance_generator.h b/examples/tiny_visual_instance_generator.h index 7bb28944..64079e0d 100644 --- a/examples/tiny_visual_instance_generator.h +++ b/examples/tiny_visual_instance_generator.h @@ -14,7 +14,7 @@ struct TinyVisualInstanceGenerator : public VisualInstanceGenerator } virtual void create_visual_instance(int shape_uid, std::vector& visual_instances ) { - OpenGLUrdfVisualizer::TinyVisualLinkInfo& vis_link = viz_.m_b2vis[shape_uid]; + OpenGLUrdfVisualizer::TinyVisualLinkInfo& vis_link = viz_.m_b2vis[shape_uid]; for (int v = 0; v < vis_link.visual_shape_uids.size(); v++) { int visual_shape = vis_link.visual_shape_uids[v]; @@ -31,4 +31,4 @@ struct TinyVisualInstanceGenerator : public VisualInstanceGenerator } }; -#endif \ No newline at end of file +#endif diff --git a/src/link.hpp b/src/link.hpp index 979c04fd..e8949d5e 100644 --- a/src/link.hpp +++ b/src/link.hpp @@ -93,7 +93,7 @@ struct Link { conv.link_name = link_name; conv.joint_name = joint_name; conv.f_ext = tds::clone(f_ext); - conv.visual_ids = visual_ids; + conv.visual_instance_uids = visual_instance_uids; for (const auto &x : X_visuals) { conv.X_visuals.push_back(x.template clone()); } diff --git a/src/math/eigen_algebra.hpp b/src/math/eigen_algebra.hpp index 0ace8e50..c51e6f80 100644 --- a/src/math/eigen_algebra.hpp +++ b/src/math/eigen_algebra.hpp @@ -182,7 +182,7 @@ struct EigenAlgebraT { * input a storage for the result * output boolean is_positive_definite if operation succeeded */ - static bool inverse(const MatrixX& A, MatrixX& a) { + static bool symmetric_inverse(const MatrixX& A, MatrixX& a) { assert(a.cols() == A.cols()); assert(a.rows() == A.rows()); diff --git a/src/mb_constraint_solver.hpp b/src/mb_constraint_solver.hpp index 59070b8c..a7b83df0 100644 --- a/src/mb_constraint_solver.hpp +++ b/src/mb_constraint_solver.hpp @@ -191,7 +191,7 @@ class MultiBodyConstraintSolver { // } else { submit_profile_timing("inverse_mass_matrix_a"); is_positive_definite_a = - Algebra::inverse(mass_matrix_a, mass_matrix_a_inv); + Algebra::symmetric_inverse(mass_matrix_a, mass_matrix_a_inv); submit_profile_timing(""); // } } @@ -209,7 +209,7 @@ class MultiBodyConstraintSolver { // is_positive_definite_b = true; // } else { submit_profile_timing("inverse_mass_matrix_b"); - is_positive_definite_b = Algebra::inverse(mass_matrix_b, mass_matrix_b_inv); + is_positive_definite_b = Algebra::symmetric_inverse(mass_matrix_b, mass_matrix_b_inv); submit_profile_timing(""); // } } @@ -474,4 +474,4 @@ static TINY_INLINE MultiBodyConstraintSolver clone( const MultiBodyConstraintSolver& s) { return s.template clone(); } -} // namespace tds \ No newline at end of file +} // namespace tds diff --git a/src/multi_body.hpp b/src/multi_body.hpp index b0e76902..91cefb71 100644 --- a/src/multi_body.hpp +++ b/src/multi_body.hpp @@ -94,7 +94,7 @@ class MultiBody { conv.links_.push_back(link.template clone()); } conv.control_indices_ = control_indices_; - conv.visual_shape_ids_ = visual_shape_ids_; + conv.visual_shape_uids_ = visual_shape_uids_; for (const auto &x : X_visuals_) { conv.X_visuals_.push_back(x.template clone()); } @@ -212,8 +212,8 @@ class MultiBody { return base_X_world_; } - TINY_INLINE std::vector &visual_shape_ids() { return visual_shape_ids_; } - TINY_INLINE const std::vector &visual_shape_ids() const { return visual_shape_ids_; } + TINY_INLINE std::vector &visual_shape_ids() { return visual_shape_uids_; } + TINY_INLINE const std::vector &visual_shape_ids() const { return visual_shape_uids_; } TINY_INLINE std::vector& visual_instance_uids() { return visual_instance_uids_; } TINY_INLINE const std::vector& visual_instance_uids() const { return visual_instance_uids_; } diff --git a/third_party/bullet3 b/third_party/bullet3 index ef72fdd7..7f87bb53 160000 --- a/third_party/bullet3 +++ b/third_party/bullet3 @@ -1 +1 @@ -Subproject commit ef72fdd73d5d7f196ba40e2aa01c991decd31f27 +Subproject commit 7f87bb5362bf5674046e0f6c27dd6f7906e4d999 From ca8243be5fb5e052ec25b983c53e2f3ddb7b6bda Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Fri, 18 Dec 2020 21:22:37 -0800 Subject: [PATCH 2/3] more Mac compile fixes --- examples/laikago_opengl_example.cpp | 2 +- examples/tiny_visual_instance_generator.h | 2 +- src/math/eigen_algebra.hpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/laikago_opengl_example.cpp b/examples/laikago_opengl_example.cpp index 801eef85..7718f156 100644 --- a/examples/laikago_opengl_example.cpp +++ b/examples/laikago_opengl_example.cpp @@ -194,7 +194,7 @@ struct LaikagoSimulation { result[j++] = visual_X_world.translation[0]; result[j++] = visual_X_world.translation[1]; result[j++] = visual_X_world.translation[2]; - Algebra::Quaternion orn = Algebra::matrix_to_quat(visual_X_world.rotation); + auto orn = Algebra::matrix_to_quat(visual_X_world.rotation); result[j++] = orn.x(); result[j++] = orn.y(); result[j++] = orn.z(); diff --git a/examples/tiny_visual_instance_generator.h b/examples/tiny_visual_instance_generator.h index 64079e0d..edc3c681 100644 --- a/examples/tiny_visual_instance_generator.h +++ b/examples/tiny_visual_instance_generator.h @@ -14,7 +14,7 @@ struct TinyVisualInstanceGenerator : public VisualInstanceGenerator } virtual void create_visual_instance(int shape_uid, std::vector& visual_instances ) { - OpenGLUrdfVisualizer::TinyVisualLinkInfo& vis_link = viz_.m_b2vis[shape_uid]; + auto& vis_link = viz_.m_b2vis[shape_uid]; for (int v = 0; v < vis_link.visual_shape_uids.size(); v++) { int visual_shape = vis_link.visual_shape_uids[v]; diff --git a/src/math/eigen_algebra.hpp b/src/math/eigen_algebra.hpp index c51e6f80..f40913a2 100644 --- a/src/math/eigen_algebra.hpp +++ b/src/math/eigen_algebra.hpp @@ -462,11 +462,11 @@ struct EigenAlgebraT { m.row(i) = v; } - EIGEN_ALWAYS_INLINE static void assign_row(MatrixX &m, Index i, + EIGEN_ALWAYS_INLINE static void assign_row(MatrixX& m, Index i, const SpatialVector &v) { - m.block<1, 3>(i, 0) = v.top; - m.block<1, 3>(i, 3) = v.bottom; + m.template block<1, 3>(i, 0) = v.top; + m.template block<1, 3>(i, 3) = v.bottom; } From dc603ebcb8690dfeaf13953d0767471216f8dcce Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Fri, 18 Dec 2020 21:25:16 -0800 Subject: [PATCH 3/3] lower #instances in urdf example --- examples/tiny_urdf_parser_opengl_example.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/tiny_urdf_parser_opengl_example.cpp b/examples/tiny_urdf_parser_opengl_example.cpp index d2c98c6c..5271b30c 100644 --- a/examples/tiny_urdf_parser_opengl_example.cpp +++ b/examples/tiny_urdf_parser_opengl_example.cpp @@ -241,7 +241,7 @@ int main(int argc, char* argv[]) { visualizer.convert_visuals(urdf_structures, texture_path); - int num_total_threads = 256; + int num_total_threads = 16; std::vector visual_instances; std::vector num_instances; int num_base_instances;