Skip to content

Optimize the copy and swap constructors in robot_model::Model #174

@yrh012

Description

@yrh012

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions