Project help

Post your NXJ projects, project ideas, etc here!

Moderators: roger, 99jonathan, imaqine

Project help

Postby victor » Sun Mar 03, 2013 3:13 am

Hi All,

I am quite new to nxj at this stage and my intention was to use some software for my ballbot project (i.e. balancing the nxt robot on a ball). I found several methods on the website but it seems that I cannot apply those successfully on my robot.. I came across this nxj occasionally on a youtube video using nxj to program ballbot which is quite interesting. I do find there exists a ballbot class in lejos that can be applied to balance the robot. It looks quite easy to do but I'm just wondering is there any example codes associated with the ballbot application that can be given? Or any suggestions/hints about how to get started to use nxj for my ballbot project would be highly appreciated. :D

Thanks,
Victor
victor
New User
 
Posts: 2
Joined: Sun Mar 03, 2013 3:02 am

Re: Project help

Postby victor » Sun Mar 03, 2013 6:55 pm

Hi there,

Just find something new related to my previous post. I tried to use the following codes for the ballbot. My purpose was to create an instance for ballbot class, but it still doesn't work on my built robot. Can anyone give me some help? What I want to do is to have a similar balance situation as shown in this video: http://www.youtube.com/watch?v=c1TmEn-eP7U

import lejos.nxt.MotorPort;
import lejos.nxt.NXTMotor;
import lejos.nxt.SensorPort;
import lejos.nxt.addon.GyroSensor;
import lejos.robotics.navigation.Ballbot;

public class BallbotDemo {

public static void main(String [] args) {
NXTMotor left = new NXTMotor(MotorPort.B);
NXTMotor right = new NXTMotor(MotorPort.C);

GyroSensor g1 = new GyroSensor(SensorPort.S1);
GyroSensor g2 = new GyroSensor(SensorPort.S2);

Ballbot pilot = new Ballbot(left,g1, right,g2, 4.32);

}
}

Thanks a lot.
Victor
victor
New User
 
Posts: 2
Joined: Sun Mar 03, 2013 3:02 am


Return to NXJ Projects

Who is online

Users browsing this forum: No registered users and 1 guest

more stuff