@@ -95,7 +95,7 @@ int main() {
95
95
96
96
// open file to store csv
97
97
std::ofstream traj_file;
98
- traj_file.open (" /media/varun/Work/Academics/_Spring 2019/CS 225A/cs225a_hw3/data4b .csv" );
98
+ traj_file.open (" /media/varun/Work/Academics/_Spring 2019/CS 225A/cs225a_hw3/data3a .csv" );
99
99
100
100
101
101
// create a timer
@@ -119,7 +119,7 @@ int main() {
119
119
// **********************
120
120
// WRITE YOUR CODE AFTER
121
121
// **********************
122
- int controller_number = QUESTION_4 ;
122
+ int controller_number = QUESTION_3 ;
123
123
124
124
robot->gravityVector (g); // update gravity vector
125
125
robot->coriolisForce (b); // update coriolis/cfugal vector
@@ -170,7 +170,7 @@ int main() {
170
170
171
171
x_desired_traj (0 ) = x_desired_traj_init (0 ) + 0.1 *sin (Pi*controller_counter*dt);
172
172
x_desired_traj (1 ) = x_desired_traj_init (1 ) + 0.1 *cos (Pi*controller_counter*dt);
173
- x_desired_traj (2 ) = x_desired_traj_init (0 ) + 0 ;
173
+ x_desired_traj (2 ) = x_desired_traj_init (2 ) + 0 ;
174
174
175
175
VectorXd xdot_traj (3 );
176
176
xdot_traj (0 ) = 0.1 *Pi*cos (Pi*controller_counter*dt);
@@ -180,6 +180,7 @@ int main() {
180
180
VectorXd xddot_traj (3 );
181
181
xddot_traj (0 ) = 0.1 *Pi*Pi*(-sin (Pi*controller_counter*dt));
182
182
xddot_traj (1 ) = 0.1 *Pi*Pi*(-cos (Pi*controller_counter*dt));
183
+ xddot_traj (2 ) = 0 ;
183
184
184
185
185
186
// compute the control torques using the control law:
@@ -270,7 +271,7 @@ int main() {
270
271
// store the trajectory in the csv file (order matters)
271
272
traj_file << x (0 ) << " ," << x (1 ) << " ," << x (2 ) << " ," <<
272
273
x_desired (0 ) << " ," << x_desired (1 ) << " ," << x_desired (2 ) << " ," <<
273
- xdot (0 ) << " ," << xdot (1 ) << " ," << xdot (2 ) << " , " << Vmax << endl;
274
+ dPhi (0 ) << " ," << dPhi (1 ) << " ," << dPhi (2 ) << endl;
274
275
275
276
276
277
// **********************
0 commit comments