I have a plugin for classic Gazebo to control a vehicle that used the solution from the following question to implement braking:
https://answers.gazebosim.org/question/16442/how-to-programatically-set-joint-friction-torque/
I have now ported this plugin over to Ignition Gazebo (Fortress), as a System plugin, but am unable to get braking working in a similar way. My attempt looks like the following:
void VehicleInterface::PreUpdate(
const ignition::gazebo::UpdateInfo & _info, ignition::gazebo::EntityComponentManager & _ecm)
{
auto joint_entity = this->my_model.JointByName(_ecm, this->wheel_joint_name);
auto axis = _ecm.Component<ignition::gazebo::components::JointAxis>(joint_entity);
axis->Data().SetFriction(friction);
}
But the friction does not seem to have any effect. I guess you can only request the current value of the friction this way, not actually update it. This is confirmed when I look through the gz-physics source, and can't find any place where the friction from the JointAxis is used, beyond at the beginning when the initial model is created.
Is there any way to achieve this?