Author Topic: Need Help With Programming.... LEGO NXT Using C  (Read 1994 times)

0 Members and 1 Guest are viewing this topic.

Offline stanley_fuTopic starter

  • Jr. Member
  • **
  • Posts: 8
  • Helpful? 0
Need Help With Programming.... LEGO NXT Using C
« on: November 14, 2007, 02:59:28 PM »
Hi, I got this robot I am trying to get working. There is 2 servo motors which has rotation sensors on it (encoder) and a servo for the turning sensors like the IR viewfinder on the website. The problem right now I am getting it a big tweaky sensor. It can track objects but only slow movement. I need to get movement right now. The movement I like to have is sensor lock on to target then the vehicle moves (turns) in the same direction. Then go ram it.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: Need Help With Programming.... LEGO NXT Using C
« Reply #1 on: November 17, 2007, 09:55:58 AM »
Quote
for the turning sensors like the IR viewfinder on the website.
A sharp IR you mean?

Quote
The problem right now I am getting it a big tweaky sensor.
Which part isn't working? I don't understand what you mean . . . a big tweaky sensor sounds like a big problem indeed :P

Offline stanley_fuTopic starter

  • Jr. Member
  • **
  • Posts: 8
  • Helpful? 0
Re: Need Help With Programming.... LEGO NXT Using C
« Reply #2 on: November 17, 2007, 01:12:16 PM »
ok, first of all, we are using a sonar to subsitude the ir....
and tweaky because it either follows a slow moving object or just follows for a sec then moves off

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: Need Help With Programming.... LEGO NXT Using C
« Reply #3 on: November 17, 2007, 03:29:33 PM »
Can you tell us more about how your robot is set up, and what the program should be doing?

Offline stanley_fuTopic starter

  • Jr. Member
  • **
  • Posts: 8
  • Helpful? 0
Re: Need Help With Programming.... LEGO NXT Using C
« Reply #4 on: November 17, 2007, 11:30:05 PM »
Basiclly My Robot Is Built On The Lego NXT Platform With The Language ROBOTC.
This Robot Has 2 Servo Motors (WIth Rotation Sensor).
1 Sonar Detection Mount On A 3Rd Servo Scanner Actively Like Your IR Sensor.
And 1 Light Sensor For Light Following.
Plus 2 Touch Sensor.

The robot is to stay within a 4 feet by 4 feet field. The actual field is 3 feet by 3 feet, this is marked in white tape that is 1 inch. There is also a hole in the middle. This hold is not cut perpendicular to the board by diagnally. The goal is to have a match with 3 other robot (4 robot sumo).
I am trying to get the sonar sensor to follow / detect another robot and lock on to target then attack them. While the light sensors prevent the robot from falling into the hole or running out of the field. Also the touch will detect anyone hitting us.

The program right now is only following or locking onto the target. But it is very tweaky and buggy

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,658
  • Helpful? 169
    • Society of Robots
Re: Need Help With Programming.... LEGO NXT Using C
« Reply #5 on: November 18, 2007, 09:16:08 AM »
Ok it sounds like your program isn't using sensor data very well.

The best way to debug this is to display (on the dot matrix display) the sensor data during realistic scenarios, then modify your control code to work with that sensor data. If you know what your robot is thinking, you will know how to fix/improve it.

This might be useful for you (it has code to download at the bottom):
http://www.bnxt.com/paper/radar_display

 


Get Your Ad Here

data_list