View unanswered posts | View active topics It is currently Wed Oct 22, 2014 7:04 pm






Reply to topic  [ 7 posts ] 
SONIC AND LIGHT SENSOR NOT WORKING ON REM IN VIRTUAL WORLDS 
Author Message
Rookie

Joined: Fri Feb 03, 2012 1:39 pm
Posts: 9
Post SONIC AND LIGHT SENSOR NOT WORKING ON REM IN VIRTUAL WORLDS
Hello, I am new to this. I am using the Robot Education Model (Lego Mindstorms NXT) in the Student Pack. I am using the REM in Curriculum Student Pack virtual world. The touch sensor works fine, but the sonic sensor and the light sensor (active) does not work. I need to have all of the sensors working in order to test the lab assignments for school.

Any help would be appreciated.
Rick


Wed Feb 08, 2012 12:20 pm
Profile
Rookie
User avatar

Joined: Mon Feb 14, 2011 10:37 am
Posts: 49
Location: The Pitts(burgh)
Post Re: SONIC AND LIGHT SENSOR NOT WORKING ON REM IN VIRTUAL WOR
Do you have #pragma statements at the top of your file for all of the sensors? You should have lines that look something like:

Code:
#pragma config(Sensor, S1,     touchSensor,              sensorTouch)
#pragma config(Sensor, S2,     compassSensor,            sensorVirtualCompass)
#pragma config(Sensor, S3,     lightSensor,              sensorLightActive)
#pragma config(Sensor, S4,     sonarSensor,              sensorSONAR)


Try using one of the supplied Sample Programs supplied with ROBOTC. You'll see a Virtual World folder full of examples suitable for use with RVW.

_________________
Robot Virtual Worlds Technical Lead
Robotics Academy - CMU


Wed Feb 08, 2012 3:00 pm
Profile WWW
Rookie

Joined: Fri Feb 03, 2012 1:39 pm
Posts: 9
Post Re: SONIC AND LIGHT SENSOR NOT WORKING ON REM IN VIRTUAL WOR
Thank you for the reply. My program is written as you have shown. But, it does not work. The sample programs that came with RobotC do not work because it uses const commands.
I tried something to see if I could see more information as to where the problem is. I added motor[motorC]=50; and motor[motorB]=50; wait1Msec(2000); befor the while loop because I felt that the robot was too close to the back wall. The robot moves out from the starting position and then goes back. It is acting like there is no while loop. Now, I'm not sure if the problem is with the sensors or with the while loop. I was wondering if there is a way to step through the program, one command at a time, and monitor the sensors. The normal debugging window does not appear.

Thanks again,
Rick


Wed Feb 08, 2012 4:16 pm
Profile
Rookie
User avatar

Joined: Mon Feb 14, 2011 10:37 am
Posts: 49
Location: The Pitts(burgh)
Post Re: SONIC AND LIGHT SENSOR NOT WORKING ON REM IN VIRTUAL WOR
There is no way to enable the step debugging in the current versions of RVW. You can watch the live output of the sensor values in the sensor debug window. Could you post your while() loop here?

_________________
Robot Virtual Worlds Technical Lead
Robotics Academy - CMU


Wed Feb 08, 2012 5:23 pm
Profile WWW
Rookie

Joined: Fri Feb 03, 2012 1:39 pm
Posts: 9
Post Re: SONIC AND LIGHT SENSOR NOT WORKING ON REM IN VIRTUAL WOR
Hello,
I think that I found two problems. I am not so sure about the first problem. But, here is what I think. Since we are dealing with a virtual robot here, you can't physically move the cable going to the touch sensor. It is plugged into S1. I assigned the sonic sensor to S2. It still did not work, so I tried S3. It did work, but not as expected. This brings us to the second problem. I think that I was in the wrong virtual world. I tried several worlds. I think that the obsticles were not tall enough in the worlds that I tried. I did get it to work when I tried the world with obsticles that were large.

Do you know how to view the sensors while the program is in progress. If I could have done that, that might have helped me see what was going on.

I appreciate your help.

Rick


Wed Feb 08, 2012 7:47 pm
Profile
Rookie
User avatar

Joined: Mon Feb 14, 2011 10:37 am
Posts: 49
Location: The Pitts(burgh)
Post Re: SONIC AND LIGHT SENSOR NOT WORKING ON REM IN VIRTUAL WOR
In the Robot menu, click on Debugger Windows, then Sensors. That will open a pane where you can see all the values of the sensors while the program runs.

_________________
Robot Virtual Worlds Technical Lead
Robotics Academy - CMU


Thu Feb 09, 2012 11:34 am
Profile WWW
Rookie

Joined: Fri Feb 03, 2012 1:39 pm
Posts: 9
Post Re: SONIC AND LIGHT SENSOR NOT WORKING ON REM IN VIRTUAL WOR
Thank you. We had our on-line class today. Our teacher showed us how the program will assign the ports for you. I wish that I would have known this. But, I learned more about assigning ports in the process.
Program and Sensors Setup.....Standard Models tab......Select Configuration.........Virtual Worlds Next

It does everything for you.
The debugger window worked fine.

Thank you for all of your suggestions and help,

Rick


Thu Feb 09, 2012 12:22 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.