@@ -94,7 +94,7 @@ class MyEventReceiver : public IEventReceiver {
9494// wheel and the many radial rollers, already lined to the wheel with revolute joints.)
9595// The function returns the pointer to the central wheel.
9696std::shared_ptr<ChBody> create_mecanum_wheel (ChSystemNSC& sys,
97- ChVector<> shaft_position,
97+ ChVector3d shaft_position,
9898 ChQuaternion<> shaft_alignment,
9999 double wheel_radius,
100100 double wheel_width,
@@ -122,7 +122,7 @@ std::shared_ptr<ChBody> create_mecanum_wheel(ChSystemNSC& sys,
122122 double roller_elliptical_rad_Vert = wheel_radius * 1.0 / (cos (roller_angle));
123123
124124 for (int iroller = 0 ; iroller < n_rollers; iroller++) {
125- double pitch = CH_C_2PI * ((double )iroller / (double )n_rollers);
125+ double pitch = CH_2PI * ((double )iroller / (double )n_rollers);
126126
127127 double Roffset = -(wheel_radius - roller_midradius);
128128
@@ -131,9 +131,9 @@ std::shared_ptr<ChBody> create_mecanum_wheel(ChSystemNSC& sys,
131131 sys.Add (roller);
132132
133133 // move it to slanted aligment
134- ChFrameMoving<> f1 (ChVector<> (0 , 0 , -(wheel_radius - roller_midradius)),
135- Q_from_AngAxis (roller_angle, ChVector<>( 0 , 0 , 1 ) ));
136- ChFrameMoving<> f2 (ChVector<> (0 , 0 , 0 ), Q_from_AngAxis (pitch, ChVector<>( 0 , 1 , 0 ) ));
134+ ChFrameMoving<> f1 (ChVector3d (0 , 0 , -(wheel_radius - roller_midradius)),
135+ QuatFromAngleZ (roller_angle));
136+ ChFrameMoving<> f2 (ChVector3d (0 , 0 , 0 ), QuatFromAngleY (pitch));
137137 ChFrameMoving<> f3 = f1 >> f2 >> ftot;
138138 roller->ConcatenatePreTransformation (f3);
139139
@@ -150,7 +150,7 @@ std::shared_ptr<ChBody> create_mecanum_wheel(ChSystemNSC& sys,
150150 roller_elliptical_rad_Vert, roller_elliptical_rad_Hor, //
151151 Roffset);
152152 roller->GetCollisionModel ()->BuildModel ();
153- roller->SetCollide (true );
153+ roller->EnableCollision (true );
154154
155155 // add visualization shape
156156 auto rollershape =
@@ -161,7 +161,7 @@ std::shared_ptr<ChBody> create_mecanum_wheel(ChSystemNSC& sys,
161161
162162 // Make the revolute joint between the roller and the central wheel
163163 // (preconcatenate rotation 90 degrees on X, to set axis of revolute joint)
164- ChFrameMoving<> fr (ChVector<> (0 , 0 , 0 ), Q_from_AngAxis (CH_C_PI / 2.0 , ChVector<>( 1 , 0 , 0 ) ));
164+ ChFrameMoving<> fr (ChVector3d (0 , 0 , 0 ), QuatFromAngleX (CH_PI / 2.0 ));
165165 ChFrameMoving<> frabs = fr >> f3;
166166 auto link_roller = chrono_types::make_shared<ChLinkLockRevolute>();
167167 link_roller->Initialize (roller, centralWheel, frabs.GetCoord ());
@@ -172,14 +172,14 @@ std::shared_ptr<ChBody> create_mecanum_wheel(ChSystemNSC& sys,
172172}
173173
174174int main (int argc, char * argv[]) {
175- GetLog () << " Copyright (c) 2017 projectchrono.org\n Chrono version: " << CHRONO_VERSION << " \n\n " ;
175+ std::cout << " Copyright (c) 2017 projectchrono.org\n Chrono version: " << CHRONO_VERSION << " \n\n " ;
176176
177177 // Create a ChronoENGINE physical system
178178 ChSystemNSC sys;
179179
180180 double platform_radius = 8 ;
181181 double wheel_radius = 3 ;
182- double roller_angle = CH_C_PI / 4 ;
182+ double roller_angle = CH_PI / 4 ;
183183
184184 // Create the robot truss, as a circular platform
185185 auto platform = chrono_types::make_shared<ChBodyEasyCylinder>(platform_radius * 0.7 , 2 , // radius, height
@@ -193,11 +193,11 @@ int main(int argc, char* argv[]) {
193193
194194 // create the wheels and link them to the platform
195195
196- ChFrame<> f0 (ChVector<> (0 , 0 , 0 ), Q_from_AngAxis (CH_C_PI / 2.0 , ChVector<>( 1 , 0 , 0 ) ));
197- ChFrame<> f1 (ChVector<> (0 , 0 , platform_radius), QUNIT);
198- ChFrame<> f2_wA (VNULL, Q_from_AngAxis (0 * (CH_C_2PI / 3.0 ), ChVector<>( 0 , 1 , 0 )));
199- ChFrame<> f2_wB (VNULL, Q_from_AngAxis (1 * (CH_C_2PI / 3.0 ), ChVector<>( 0 , 1 , 0 )));
200- ChFrame<> f2_wC (VNULL, Q_from_AngAxis (2 * (CH_C_2PI / 3.0 ), ChVector<>( 0 , 1 , 0 )));
196+ ChFrame<> f0 (ChVector3d (0 , 0 , 0 ), QuatFromAngleX (CH_PI / 2.0 ));
197+ ChFrame<> f1 (ChVector3d (0 , 0 , platform_radius), QUNIT);
198+ ChFrame<> f2_wA (VNULL, QuatFromAngleY (0 * (CH_2PI / 3.0 )));
199+ ChFrame<> f2_wB (VNULL, QuatFromAngleY (1 * (CH_2PI / 3.0 )));
200+ ChFrame<> f2_wC (VNULL, QuatFromAngleY (2 * (CH_2PI / 3.0 )));
201201 ChFrame<> ftot_wA = f0 >> f1 >> f2_wA;
202202 ChFrame<> ftot_wB = f0 >> f1 >> f2_wB;
203203 ChFrame<> ftot_wC = f0 >> f1 >> f2_wC;
@@ -259,8 +259,8 @@ int main(int argc, char* argv[]) {
259259 true , // visualize
260260 true , // collide
261261 ground_mat); // contact material
262- ground->SetPos (ChVector<> (0 , -5 , 0 ));
263- ground->SetBodyFixed (true );
262+ ground->SetPos (ChVector3d (0 , -5 , 0 ));
263+ ground->SetFixed (true );
264264 ground->GetVisualShape (0 )->SetTexture (GetChronoDataFile (" textures/concrete.jpg" ), 100 , 100 );
265265 sys.Add (ground);
266266
@@ -272,7 +272,7 @@ int main(int argc, char* argv[]) {
272272 vis->Initialize ();
273273 vis->AddLogo ();
274274 vis->AddSkyBox ();
275- vis->AddCamera (ChVector<> (0 , 14 , -20 ));
275+ vis->AddCamera (ChVector3d (0 , 14 , -20 ));
276276 vis->AddTypicalLights ();
277277
278278 vis->GetGUIEnvironment ()->addStaticText (L" Use keys Q,W, A,Z, E,R to move the robot" , rect<s32>(150 , 10 , 430 , 40 ),
@@ -286,7 +286,7 @@ int main(int argc, char* argv[]) {
286286 sys.SetTimestepperType (ChTimestepper::Type::EULER_IMPLICIT_PROJECTED);
287287
288288 sys.SetSolverType (ChSolver::Type::PSOR);
289- sys.SetSolverMaxIterations (30 );
289+ sys.GetSolver ()-> AsIterative ()-> SetMaxIterations (30 );
290290
291291 // Simulation loop
292292
@@ -303,8 +303,8 @@ int main(int argc, char* argv[]) {
303303
304304 // change motor speeds depending on user setpoints from GUI
305305
306- ChVector<> imposed_speed (STATIC_x_speed, 0 , STATIC_z_speed);
307- ChFrame<> roll_twist (ChVector<> (0 , -wheel_radius, 0 ), Q_from_AngAxis (-roller_angle, ChVector<>( 0 , 1 , 0 ) ));
306+ ChVector3d imposed_speed (STATIC_x_speed, 0 , STATIC_z_speed);
307+ ChFrame<> roll_twist (ChVector3d (0 , -wheel_radius, 0 ), QuatFromAngleY (-roller_angle));
308308
309309 ChFrame<> abs_roll_wA = roll_twist >> f2_wA >> ChFrame<>(platform->GetCoord ());
310310 double wheel_A_rotspeed =
0 commit comments