3#include "SupergridCable.h"
4#include <Eigen/StdVector>
5#include "InitializerTools3DCurve.h"
8#include <boost/container/map.hpp>
15#ifdef FH_VISUALIZATION
16#include "sfh/ogre/C3DArrow.h"
23class SupergridWinchCable;
36 Winch(
double drum_length,
double drum_diameter,
double flange_diameter,
double flange_thickness,
double beta);
49 double GetWinchTheta(){
return m_theta;}
50 double GetWinchOmega(){
return m_omega;}
52 Quat GetStandardizedOrientationNED();
58 void SetStates(
const vec3& P,
const Quat& Q,
const vec3& V,
const vec3& W);
64#ifdef FH_VISUALIZATION
65 void RenderInit(Ogre::Root*
const ogreRoot);
66 void RenderUpdate(
const double T,
const double*
const X);
75 double accumulated_volume;
76 double accumulated_weight;
77 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
84 void PushElement(
DiscreteElement* element,
const vec3& P,
const Quat& Q);
101 const std::vector<AttachedElement,Eigen::aligned_allocator<AttachedElement> >
GetAttachedCableElements(){
return m_attached_elements;}
107 std::vector<std::vector<CollisionManager::ExternalObject*> > GetAttachedGeometry(
const std::vector<CollisionManager::InternalObject*>& InternalObjects);
108 std::vector<CollisionManager::ExternalObject*> CollisionCandidates(
GeometryTools::AABB aabb);
110 double DrumVirtualRadius(){
return m_virtual_radius;}
111 double DrumRadius(){
return 0.5*m_drum_diameter;}
112 double DrumDiameter(){
return m_drum_diameter;}
113 double DrumLength(){
return m_drum_length;}
114 double FlangeRadius(){
return 0.5*m_flange_diameter;}
115 double FlangeDiameter(){
return m_flange_diameter;}
117 void SetLineStructure(SupergridWinchCable* line_structure);
119 virtual void XmlInfo(TiXmlElement& xml_node);
121 double GetRetractedLength();
123 void WriteAttachedGeometryDataToFile(std::string filename);
131 std::vector<AttachedElement,Eigen::aligned_allocator<AttachedElement>>::iterator GetIterator();
132 std::vector<AttachedElement,Eigen::aligned_allocator<AttachedElement>>::iterator GetEnd();
134 std::vector<AttachedElement,Eigen::aligned_allocator<AttachedElement>> m_elements;
136 void LoadAttachedGeometryDataFromFile(
InitialStatesLoader states, std::vector<DiscreteElement*>& super_elements,
size_t& super_ix,
size_t& sub_ix,
const vec3& target_point);
137 static void WinchInitFileInfo(std::string filename, std::vector<double>& angle, std::vector<double>& retracted_length);
143 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
144 SpoolingDevice(vec3 relative_position,
double radius,
double length,
double beta);
145 vec3 GetPassThroughPoint();
146 void UpdateStates(vec3& winch_P, Quat& winch_base_Q, vec3& winch_V, vec3& winch_W);
148 vec3 RelativePosition(){
return m_relative_position;}
150#ifdef FH_VISUALIZATION
151 virtual void RenderInit(Ogre::Root*
const ogreRoot);
152 virtual void RenderUpdate(
const double T,
const double*
const X);
153 Ogre::SceneNode* m_node;
157 vec3 m_relative_position;
158 double m_state_data[13];
162 void SetSpoolingDevice(vec3 relative_position,
double rail_radius);
168 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
170 void UpdateWinchDrumGeometry();
176 void Setup(
Winch* winch);
206 std::vector<std::vector<unsigned short>> m_data;
218 V3ptr(vec3::Zero(),P);
220 V3ptr(vec3::Zero(),V);
221 V3ptr(vec3::Zero(),W);
232 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
237 boost::container::map<int,ObjectAndStates*> m_accumulated_candidates;
239 std::map<int,ObjectAndStates*> m_accumulated_candidates;
241 std::vector<AttachedElement,Eigen::aligned_allocator<AttachedElement>> m_attached_elements;
252 double m_drum_length;
253 double m_drum_diameter;
254 double m_flange_diameter;
255 double m_flange_thickness;
256 double m_virtual_radius;
258 double m_nominal_cable_radius;
260 double m_base_Q_array[4];
261 double m_block_upper_V_array[3];
262 double m_block_lower_V_array[3];
263 double m_block_upper_P_array[3];
264 double m_block_lower_P_array[3];
266 double m_winch_Q_array[4];
267 double m_flange1_V_array[3];
268 double m_flange2_V_array[3];
269 double m_flange1_P_array[3];
270 double m_flange2_P_array[3];
283 vec3 m_winch_base_flange_connection;
284 vec3 m_winch_base_connection_vector;
290#ifdef FH_VISUALIZATION
291 Ogre::SceneNode* m_winch_node;
292 Ogre::SceneNode* m_virtual_drum_node;
293 std::vector<Ogre::SceneNode*> m_element_nodes;
294 Ogre::SceneNode* m_base_node;
307 TowingBlock(ISimObjectCreator* creator, std::string state_prefix,
double block_width,
double block_diameter,
double flange_diameter,
double flange_thickness,
double pivot_arm_length,
double beta);
318 void SetStates(
const vec3& P,
const Quat& Q,
const vec3& V,
const vec3& W);
321 const std::vector<CollisionManager::ExternalObject*> GetTowingBlockGeometry();
323#ifdef FH_VISUALIZATION
324 void RenderInit(Ogre::Root*
const ogreRoot);
325 void RenderUpdate(
const double T,
const double*
const X);
328 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
330 vec3 P(){
return m_P;}
331 Quat Q(){
return m_Q;}
332 vec3 V(){
return m_V;}
333 vec3 W(){
return m_W;}
335 Quat GetStandardizedOrientationNED();
339 double GetBlockRadius(){
return 0.5*m_block_diameter;}
341 vec3 PassThroughPoint();
346 virtual void XmlInfo(TiXmlElement& xml_node);
348 void Flagging_OdeFcn(
const double T,
const double *
const X,
double *
const XDot);
356 void SetFlaggingResponseCoefficient(
double c){m_flagging_response_coefficient = c;}
369 std::vector<CollisionManager::ExternalObject*> m_block_geometry;
375 double m_block_width;
376 double m_block_diameter;
377 double m_flange_diameter;
378 double m_flange_thickness;
379 double m_pivot_arm_length;
381 double m_pivot_arm_angle;
382 int m_pivot_angle_ix;
384 vec3 m_block_base_flange_connection;
385 vec3 m_block_base_cover_connection;
399 double m_flagging_response_coefficient;
401#ifdef FH_VISUALIZATION
402 Ogre::SceneNode* m_block_node;
Definition: CollisionManager.h:135
Definition: DataStructures.h:27
Definition: ObjectFactoryStack.h:22
Definition: SupergridLineStructure.h:73
Definition: SupergridWinchCable.h:27
Quat BlockOrientation()
block center position
void SetLineStructure(SupergridWinchCable *line_structure)
Returns orientation in a standardized Forward-Starboard-Down oriented coordinate system in a Roll/Pit...
Quat m_Q
pivot position
Definition: Winch.h:388
vec3 m_W
pivot velocity
Definition: Winch.h:390
vec3 NeutralPivotArm()
vector from pivot to block center
double PivotAngle()
block orientation
vec3 m_V
pivot orientation
Definition: Winch.h:389
vec3 BlockPosition()
vector from pivot to neutral angle block center
void SetStates(const vec3 &P, const Quat &Q, const vec3 &V, const vec3 &W)
StateData m_block_states
pivot angular velocity
Definition: Winch.h:394
vec3 m_V
center orientation
Definition: Winch.h:279
void SetWinchRotation(double theta, double omega)
Quat m_base_Q
winch rotation speed
Definition: Winch.h:274
vec3 m_P
winch base rotation speed
Definition: Winch.h:277
vec3 m_base_W
winch base orientation
Definition: Winch.h:275
vec3 m_W
center velocity
Definition: Winch.h:280
vec3 m_winch_base_pin_connection
center angular velocity
Definition: Winch.h:282
std::vector< CollisionManager::ExternalObject * > m_winch_geometry
relative position and orientation of attached cable elements
Definition: Winch.h:244
Quat m_Q
center position
Definition: Winch.h:278
const std::vector< AttachedElement, Eigen::aligned_allocator< AttachedElement > > GetAttachedCableElements()
Definition: Winch.h:101
void SetStates(const vec3 &P, const Quat &Q, const vec3 &V, const vec3 &W)
Returns orientation in a standardized Forward-Starboard-Down oriented coordinate system in a Roll/Pit...
double m_omega
winch rotation
Definition: Winch.h:273
Definition: CollisionManager.h:6
void V3ptr(const vec3 &V, double *ptr)
writes the vector to ptr
Quat dblQ(double d)
writes the quaternion from ptr in w,x,y,z order
void Qptr(const Quat &Q, double *ptr)
returns the (d,d,d,d) quaternion
Definition: GeometryTools.h:88
Definition: JointConstraint.h:157
double accumulated_length
position relative to winch coordinate system
Definition: Winch.h:74
vec3 P
orientation relative to winch coordinate system
Definition: Winch.h:73