fzi-forschungszentrum-informatik / cartesian_controllers

A set of Cartesian controllers for the ROS1 and ROS2-control framework.
BSD 3-Clause "New" or "Revised" License
374 stars 109 forks source link

Unnecessary call to `buildGenericModel` in the forward dynamic solver ? #188

Closed captain-yoshi closed 5 months ago

captain-yoshi commented 5 months ago

ROS1 Branch I guess this call is not needed as it is already built in the init method ? This is recomputed for every control loop.

  // ForwardDynamicSolver.cpp

  trajectory_msgs::JointTrajectoryPoint ForwardDynamicsSolver::getJointControlCmds(
        ros::Duration period,
        const ctrl::Vector6D& net_force)
  {

    // Compute joint space inertia matrix with actualized link masses
    buildGenericModel();  // Needed ?
    m_jnt_space_inertia_solver->JntToMass(m_current_positions,m_jnt_space_inertia);

    ...

  }
stefanscherzinger commented 5 months ago

@captain-yoshi

Thanks for asking. If I remember correctly, there's a dynamic parameter that influences how responsive the forward simulation behaves that users may change during runtime. The buildGenericModel() call should take that into consideration.