loading
 
RR crash
Arif Rahman from Malaysia  [10 posts]
17 year
Hi,
I've just downloaded RR yesterday. Everything worked fine except when I try to control my Mindstorm.
I copied the skin track program from one of the earlier forum posts. But when I run the program, once RR detects enough 'skin', both motors start to move at max speed continuosly and doen not react to any movement of the 'skin'. And they dont stop when there is no skin either.
When I click the stop button in the LEGO interface, a dialogue box come out saying RR has to close, sorry for the inconvenience, do you want to send error report etc. This also happens everytime I try to access the LEGO control.
Is this something commom or is it my computer? Or maybe I missed a step in the installation?
Lego Issues
Anonymous
17 year
Arif,

There was a problem with the Lego RIS module that has now been corrected. Please download RR again as we uploaded a new version today. We also introduced a checkbox to switch off receiving sensor values. This helps to speed up the interactivity between the PC and the RCX.

Can you include the skin detection VBScript routine that you are using? It sounds like the motor values have not been correctly initialized as when the script first starts the variables will be 0 which will cause the motors to move at max speed.

STeven.
script
Arif Rahman from Malaysia  [10 posts]
17 year
here's the script I used (I copied this from one of the previous forum posts):

if GetVariable("COG_BOX_SIZE") > 30 then
' get the center of screen
xcenter = GetVariable("IMAGE_WIDTH")/2

' if the blob is off to the right then increase the right motor
if GetVariable("COG_X") > xcenter then
rightMove = 230
leftMove = 128
else
' otherwise up the left motor in a similar manner
rightMove = 128
leftMove = 230
end if

' set the variables so that the motor control module can use them
SetVariable "LEFT_MOTOR", leftMove
SetVariable "RIGHT_MOTOR", rightMove
end if
Tracking Script
Anonymous
17 year
That is almost right. The script assumes that there is already an object in view that is greater than 30 pixels. To make this a little more robust you would want to initialize the variables if no object is found. So the script would instead be:

if GetVariable("COG_BOX_SIZE") > 30 then
  ' get the center of screen
  xcenter = GetVariable("IMAGE_WIDTH")/2

  ' if the blob is off to the right then increase the right motor
  if GetVariable("COG_X") > xcenter then
    rightMove = 230
    leftMove = 128
  else
    ' otherwise up the left motor in a similar manner
    rightMove = 128
    leftMove = 230
  end if
else
  rightMove = 128
  leftMove = 230
end if

' set the variables so that the motor control module can use them
SetVariable "LEFT_MOTOR", leftMove
SetVariable "RIGHT_MOTOR", rightMove

which should make the robot spin right when no object is seen and then target it as long as the object's size is larger than 30 pixels. Note that this is a very crude script in that the movement may be very jerky as you really want to scale the motor commands by the amount the object is off center.

STeven.

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index