19 from uuv_control_interfaces
import DPPIDControllerBase
24 Modelbased Feedback Linearization Controller 27 Handbook of Marine Craft Hydrodynamics and Motion Control 29 _LABEL =
'Model-based Feedback Linearization Controller' 32 DPPIDControllerBase.__init__(self,
True)
33 self._logger.info(
'Initializing: ' + self.
_LABEL)
42 self._logger.info(self.
_LABEL +
' ready')
45 super(ROV_MBFLController, self).reset_controller()
47 self.
_tau = np.zeros(6)
56 self.
_last_vel = self._vehicle_model.to_SNAME(self._reference[
'vel'])
62 self.
_last_vel = self._vehicle_model.to_SNAME(self._reference[
'vel'])
67 vel = self._vehicle_model.to_SNAME(self._reference[
'vel'])
70 self._vehicle_model._update_damping(vel)
71 self._vehicle_model._update_coriolis(vel)
72 self._vehicle_model._update_restoring(q=self._reference[
'rot'], use_sname=
True)
74 self.
_tau = np.dot(self._vehicle_model.Mtotal, acc) + \
75 np.dot(self._vehicle_model.Ctotal, vel) + \
76 np.dot(self._vehicle_model.Dtotal, vel) + \
77 self._vehicle_model.restoring_forces
80 self.publish_control_wrench(self.
_pid_control + self._vehicle_model.from_SNAME(self.
_tau))
82 self.
_last_vel = self._vehicle_model.to_SNAME(self._reference[
'vel'])
86 if __name__ ==
'__main__':
87 print(
'Starting Modelbased Feedback Linearization Controller')
88 rospy.init_node(
'rov_mb_fl_controller')
93 except rospy.ROSInterruptException:
94 print(
'caught exception')
def _reset_controller(self)
def update_controller(self)