|
Re: speed change in teleop
You can wire a -.5 constant to the run motor vi and it will spin backwards at half speed for the entire time teleop is enabled. That is probably not what you want.
You can divide your joystick value by 2 and wire that output to the run motor vi. This will make it so that the motor will never run at full speed, and will make it so that moving the joystick a quarter of the way forward will make the motor turn at 1/8 speed.
You can cube your inputs. This will make it so that you have finer control over the lower values (so moving the joystick halfway will have the motor turn at .5*.5*.5 = .125 = 1/8 speed), but still let you have full range of motion (because 1 * 1 * 1 = 1). You can also square it, but then you have to worry about preserving the sign (because squaring makes everything positive).
To make the motor turn backwards when you move the joystick forward, you can just add in a "negate" (named incorrectly, should be negatize) command between the axis and the run motor vi.
By saying "How do I change the speed of the arm" the correct answer is to move the joystick to a different position. What you should probably say (assuming I'm reading you correctly) is "How do I change the sensitivity of the joystick so that it (Has a lower max speed/is nonlinear)" or "How do I reverse the direction of a motor?"
Figuring out exactly what you want done is the majority of programming. The chassis folks tell you they want the robot to move, and you have to know that that means you need to have the x axis of the joystick control the turning rate, defined by this algorithm... et cetera.
Try to do that, and we can help you on how to do it. Alternatively, if you don't know exactly what you want done, you can post some detailed descriptions of how everything is configured (such as: "there's a motor controlling one arm, and then on that arm there's another motor controlling another arm, similar to how a human arm works. How should I go about programming this to take in a height and make the end of the arm go to that place?") and we can help you with that too. However, saying really vague things ("my robot doesn't work" "How do you run an arm?") makes it harder to help you.
|