This is where you talk about the NXJ software itself, installation issues, and programming talk.
Moderators: roger, imaqine, 99jonathan
- New User
- Posts: 1
- Joined: Thu May 17, 2012 7:53 pm
Recently I built a robot that has one motor in the front that pivots the 2 wheels in the front to steer (like a car) and 2 motors in the back to make it move. So my best guess was to have a steeringpilot control the motors but it's constructor accepts only 2 motors. I was wondering if there's an easy way to treat those 2 Regulatedmotors like one big synchronous RegulatedMotor so it can be passed to the steeringpilot. If there's no easy way how would I go about writing a new class for this, e.g.: writing a new class implementing the nxtregulatedmotor interface that passes it's method's to 2 motors? Or manually controlling the remaining motor by copying the values from the working motor on listener events?
I hope somebody already thought about this and made a solution because i'm just starting out with Java and my skills are very very basic. Therefore if I said something incredibly stupid in this post please correct me so I can learn something from it.
- leJOS Team Member
- Posts: 4832
- Joined: Fri Sep 28, 2007 2:06 pm
- Location: UK
If you are just starting out I would be tempted to keep things simple. If you want both wheels to rotate at the same speed why not simply use one motor and link the two wheels together? Would save a lot of bother and once you have got things sorted out and want to get more advanced then you could add the extra motor back in and make things more complex (like using the extra motor to allow the inside wheel to run more slowly like it would with a differential, and so allow better turning)...
Return to “NXJ Software”
Who is online
Users browsing this forum: MSNbot Media, Yahoo [Bot] and 2 guests