Closed GoogleCodeExporter closed 9 years ago
This works by connecting the NXT 2.0 sensor to a NXT original brick? This
project
currently doesn't support NXT 2.0, so I don't think this patch should be
included in
NXT-Python.
However, we may expand the project to include support for NXT 2.0 sometime in
the
future, in which case this patch will probably be used as the basis for color
sensor
2.0 support. Thank you for submitting this code; while it is currently not of
much
use to us, it will remain under consideration.
Original comment by marcus@wanners.net
on 7 Jun 2010 at 1:04
we've been using everything on an NXT 2.0 brick and it works great. I'm not
sure what
the distinction is, if you know I'd like to know.
Original comment by meldu...@gmail.com
on 7 Jun 2010 at 6:16
Oh, I had heard that they had a different interface...someone was having
problems with a NXT 2.0 brick and nxt-python, so I thought they were different.
This is an interesting thing to note, you are sure that everything works with a
2.0 brick?
Original comment by marcus@wanners.net
on 8 Jun 2010 at 2:09
Currently.. We have an NXT 2.0 system.. I have run with the USB and bluetooth
interface. I have streamed data with all the servos/sensors (touch, ultrasonic,
and color). My coworker, Tully even patched back the problem we found with
pulling the I2C too quickly. As far as I can tell everything works. I am going
to try out the gyro and accel today. I'll tell you the results, but I have
confidence that everything will work just fine.
We are using nxt-python as the interface layer for nxt_ros.. you can checkout
our code at
http://code.google.com/p/foote-ros-pkg/source/browse/#svn/trunk/nxt/trunk
Original comment by meldu...@gmail.com
on 8 Jun 2010 at 10:47
The I2C problem should be fixed in v1.1.2.
Unfortunately, until we have a committed developer who has a 2.0 brick and is
willing to debug stuff with it, I am not willing to support 2.0 explicitly.. If
it works, all well and good; otherwise, there is not much I can do.
As for the sensor, does it work if connected to a NXT 1.0 brick?
Original comment by marcus@wanners.net
on 9 Jun 2010 at 3:15
I don't have a NXT 1.0 brick, I'll try and get my hands an NXT brick 1.0. I'm
guessing it will work, since I am just using the analog interface that is
already being used with the NXT 1.0.
Original comment by meldu...@gmail.com
on 9 Jun 2010 at 3:23
Alrighty- I got a NXT 1.0 brick. This sensor will work with the NXT brick as
long as the firmware is upgraded to 1.28 then this code can be used with an NXT
1.0 brick no problem.
Original comment by meldu...@gmail.com
on 15 Jun 2010 at 7:22
The bricks from NXT 1.0, NXT 2.0 and the NXT Education set are identical. There
are no hardware changes. The firmware versions 1.0* (latest is 1.05) came with
NXT 1.0 and NXT Education.
NXT 2.0 came with a new firmware version (1.28). The current version is 1.29.
The direct commands protocol (which is used by NXT-Python and other remote
control programming languages) is 100% compatible to the old 1.0* branch!
The 2.0 firmware generation (1.2*) added floating point support for various
on-brick languages, some bugfixes, data-logging support, performance
improvements, and support for the NXT 2.0 color sensor.
Since there is no hardware difference between bricks, it doesn't make sense to
talk about NXT 1.0 or 2.0 bricks.
The NXT 2.0 color sensor can be used as light sensor. It's fully backward
compatible, so if you (and your program) assume it's an old NXT 1.0 light
sensor, it will work like that.
For more details, discussions and questions see the NXTasy forums:
http://forums.nxtasy.org/
Original comment by linus.at...@gmx.de
on 22 Jun 2010 at 11:03
Ok, so I can take a v1.05 NXT 1.0 brick, connect this sensor to it, run this
code, and have the sensor behave as expected?
Original comment by marcus@wanners.net
on 23 Jun 2010 at 1:08
Sorry I wasn't precise on this:
The Color NXT 2.0 sensor needs at least Firmware 1.28. But yes, you can use
your "1.0 NXT Brick", since it's identical to the 2.0 brick.
You can find Firmware 1.28 here:
http://www.legoengineering.com/library/doc_details/250-nxt-firmware-v128.html
Firmware 1.29 is available on the LEGO NXT Homepage.
1.28 (or 1.29) is so much better than 1.05 that there is no reason to still use
1.05.
One last thing: I'm not very up2date on the NXT 2.0 color sensor topic, but
I've not yet seen a solution to retrieve values from it that is as easy as
yours. I always thought you had to use the I/O maps (internal firmware
registers) to do so. It's good news to see the great "easy" solution by
melducky above. If it does behave exactly as expected, I cannot tell...
Original comment by linus.at...@gmx.de
on 23 Jun 2010 at 2:43
I'm still wary of this because of the fact that I can't test it and it still
needs to be ported to the v2 sensor interface at some point, but I will plan on
trying to get it out by v2.
Original comment by marcus@wanners.net
on 23 Jun 2010 at 3:26
This sensor is this one, correct?
http://www.hitechnic.com/cgi-bin/commerce.cgi?preadd=action&key=NCO1038
If not, I would like to see the product page for it so that I can classify it
correctly in the sensor module.
Original comment by marcus@wanners.net
on 24 Jun 2010 at 8:09
The part looks like this http://www.peeron.com/inv/parts/64892. It comes with
the NXT 2.0 kit, it is an official Lego part not made by hitech something I
tried to make clear in the comments of the code. But I can't find a product
page for it any where.
Original comment by meldu...@gmail.com
on 24 Jun 2010 at 9:05
[deleted comment]
Added in r132.
Original comment by marcus@wanners.net
on 24 Jun 2010 at 9:18
If you can grab the latest v2 SVN and test that with the sensor for me so I
know that the ported code works correctly, I would be very happy!
In case you can't do SVN, I'll try to have a beta up in the next few days for
testing purposes, so you can use that instead.
Original comment by marcus@wanners.net
on 25 Jun 2010 at 8:43
Yes I can this weekend..
Original comment by meldu...@gmail.com
on 25 Jun 2010 at 8:47
How did it go?
Original comment by marcus@wanners.net
on 2 Jul 2010 at 10:51
sorry .. I forgot to do this over the weekend.. I run my test script and I get
this error
File "/usr/local/lib/python2.6/dist-packages/nxt/sensor/generic.py", line 122, in __init__
super(Light, self).__init__(brick, port)
TypeError: super(type, obj): obj must be an instance or subtype of type
I'll see if I can figure it out If I don't hear from you
Original comment by meldu...@gmail.com
on 3 Jul 2010 at 12:14
Oops, that was because of my carelessness. To fix it, just change line 122 of
nxt/sensor/generic.py from
super(Light, self).__init__(brick, port)
to
super(Color20, self).__init__(brick, port)
Or update to the latest v2 svn. After that, test again and see if it's broken
anywhere else. Thanks!
Original comment by marcus@wanners.net
on 3 Jul 2010 at 1:48
everything works except that you forgot to return the color value in the
get_color call
def get_color(self):
self.get_reflected_light(Type.COLORFULL)
+ raw_reading = self.get_input_values()
+ return raw_reading.scaled_value
Original comment by meldu...@gmail.com
on 6 Jul 2010 at 5:35
Fixed in r144. Also, the result of a get_sensor_info() call would be very
helpful. Thanks!
Original comment by marcus@wanners.net
on 7 Jul 2010 at 1:15
Original comment by marcus@wanners.net
on 20 Aug 2010 at 2:00
Original issue reported on code.google.com by
meldu...@gmail.com
on 7 Jun 2010 at 2:57Attachments: