Skip to content

Design choice: why is the ros2_control_node reimplemented? #38

Open
@danielsanjosepro

Description

@danielsanjosepro

Hi!
Thanks for the repo, I like the idea of having an unified place for this. :)
I have a question about the design choice the MujocoRosControl class.
Why are you not just creating a HardwareInterface like in cartesian_controllers ?
In your code, you implement a class that instantiates a pointer to the control manager instead of just creating a HardwareInterface that runs mujoco in an infinite while loop. This makes the launch files look a bit odd, since they do not use the controller_manager as default. (I am referencing the code down here).

mjModel *mj_model_;
mjData *mj_data_;
rclcpp::Logger logger_;
std::shared_ptr<pluginlib::ClassLoader<MujocoSystemInterface>> robot_hw_sim_loader_;
std::shared_ptr<controller_manager::ControllerManager> controller_manager_;
rclcpp::Executor::SharedPtr cm_executor_;
std::thread cm_thread_;
bool stop_cm_thread_;
rclcpp::Duration control_period_;

Is there a reason for this? I have been using a modified version of cartesian_controllers (since it has some mistakes, see Issue 217) and it has been working perfectly without modifying the controller manager.

Thanks in advance for the clarification.
Dani

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions