RobotLocomotion / drake

Model-based design and verification for robotics.
https://drake.mit.edu
Other
3.29k stars 1.26k forks source link

Add transform for frame Manipulator #1606

Closed xuhao1 closed 8 years ago

xuhao1 commented 8 years ago

For some problems I deal in UAV, I would like a different coordinate frame as input output but another one use for model. For example,a classical hover model for linear controller can be

-- rpy input ->controller -> xyz-quat based model -> xyz-rpy dynamics output ---- xyz-quat-for-display--

and feedback will be take from xyz-rpy dynamics output to controller

that is I need to make -xyz-quat based model ---> xyz-rpy dynamics output-- as a new system,which input is the control value (for quadrotor ,it's four throttle values) and output wil be rpy, so I can do LQR on both (0,0,0) (0,-pi/2,0) by change the zero point of transform from xyz-quat to xyz-rpy

As for I can't find doc about this. I am thinking about use CascadeSystem to solve this. Is there any more elegant solution on this? I found that there are some addtransform method for CoordinateFrame,does them will help on this?

RussTedrake commented 8 years ago

Yes, I would implement a simple system which performs the change of coordinates. If you want it to just be used once (in your .m file between the plant and controller), then cascade will absolutely do the trick. addTransform simply registers that system as a mechanism to change coordinates so that it will automatically be inserted (via cascade) anytime you try to combine a system that outputs your quat with one that inputs your rpy representation.