In this task, I will focus on enhancing the efficiency of the copy and swap constructors in robot_model::Model. The current implementation of the copy constructor re-initializes a new model object, re-parses the URDFs, and rebuilds the collision geometry models, which is not optimal.
Upon investigation, we found that OsqpEigen::Solver solver_; prevents the compiler from performing a default copy due to its unique pointers, which should not have multiple owners. To address this, I will create a class wrapper around OsqpEigen::Solver solver_; and implement a copy constructor that re-initializes the solver.
Furthermore, I will improve the readability of robot_model::Model by relocating the init_solver from robot_model to a separate file. This change will make the robot_model::Model code more streamlined and easier to understand.
In this task, I will focus on enhancing the efficiency of the copy and swap constructors in
robot_model::Model. The current implementation of the copy constructor re-initializes a new model object, re-parses the URDFs, and rebuilds the collision geometry models, which is not optimal.Upon investigation, we found that
OsqpEigen::Solver solver_; prevents the compiler from performing a default copy due to its unique pointers, which should not have multiple owners. To address this, I will create a class wrapper aroundOsqpEigen::Solver solver_;and implement a copy constructor that re-initializes the solver.Furthermore, I will improve the readability of
robot_model::Modelby relocating theinit_solverfrom robot_model to a separate file. This change will make therobot_model::Modelcode more streamlined and easier to understand.