Are we moving the barrel or rotating the turret

First I want to say that this is the second time building this project, and I have the complete code on GitHub. After looking at what we did in the section, I’m thinking we should be rotating the turret in the direction we are aiming. Then elevate the barrel to achieve a firing solution.

I know it is too late to go back and redo the course so I thought I would make a suggestion on method/function names.

// An all-in-one function
RotateTurretElevateBarrel() // Rotates turret in the AimDirection… can also contain the barrel elevation

// Separate functions… more code but (in my opinion) makes more sense
RotateTurret() // Just rotates turret in the AimDirection
ElevateBarrel() // Moves barrel to an appropriate angle

Yeah, “aim at” would seem to involve both turret yaw and barrel pitch.

Privacy & Terms