View unanswered posts | View active topics It is currently Thu Jul 24, 2014 11:22 am






This topic is locked, you cannot edit posts or make further replies.  [ 14 posts ] 
Released: ROBOTC Driver Suite V1.0 
Author Message
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3162
Location: Rotterdam, The Netherlands
Post Released: ROBOTC Driver Suite V1.0
Hey guys,

After a long time between releases, I am proud to present to you the latest version of the ROBOTC Driver Suite. The biggest new addition to this version is support for the new HiTechnic SMUX sensor. Adding support for this new sensor involved modifying almost every single driver for the HiTechnic sensors to add the ability to poll the sensors through the SMUX. I've tried very hard to make it as easy to use and transparent as possible.

For example, to use the HiTechnic Colour Sensor V2, you'd use the following code:
Code:
#pragma config(Sensor, S1,     HTCS2,               sensorI2CCustomStd)

#include "drivers/common.h"
#include "drivers/HTCS2-driver.h"

task main () {
  int _color = 0;
  eraseDisplay();
  while (true) {
    //eraseDisplay();
    _color = HTCS2readColor(HTCS2);
  }
}


To use the same sensor via the SMUX, you'd use the following:
Code:
#pragma config(Sensor, S1,     HTSMUX,               sensorI2CCustomStd)

#include "drivers/common.h"
#include "drivers/HTCS2-driver.h"

task main () {
  int _color = 0;
  HTSMUXinit();
  HTSMUXscanPorts(HTSMUX);
  eraseDisplay();
  while (true) {
    //eraseDisplay();
    _color = HTCS2readColor(msensor_S1_1);
  }
}


As you can see, there's not a whole lot of difference. msensor_S1_1 means the SMUX is attached to sensor port S1 and the Colour Sensor is attached to port 1 of the SMUX. To connect to port 4 of the same SMUX, you'd use msensor_S1_4. All the sensor calls that are supported through the SMUX can be found in the drivers. I recommend you check out the documentation for more information.

A quick overview of some of the changes in this version:
  • Added support for the new HiTechnic SMUX and created functions for all supported sensors to allow access via the SMUX.
  • Added support for the new HiTechnic Colour Sensor
  • Added support for the new HiTechnic Sensor MUX
  • Added support for the Mindsensors RCX MUX
  • Added support for the Mindsensors PF Mate
  • Added support for the latest alpha release of ROBOTC and its ability to distinguish between signed and unsigned.

You can download V1.0 here: [LINK].

The drivers’ website is here: [LINK].
The documentation can be found here: [LINK].
You can download the software from the Source Forge page here: [LINK].

Regards,
Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Tue Oct 06, 2009 4:01 pm
Profile WWW
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post Re: Released: ROBOTC Driver Suite V1.0
very sophisticated, indeed.
ingeniously simple, have been by me.
congratulations!

must have 'em.

EDIT: if you might even daisy chain them: unlimited possibilities...


Tue Oct 06, 2009 4:40 pm
Profile
Rookie

Joined: Mon Feb 05, 2007 10:40 pm
Posts: 9
Location: Alaska
Post Re: Released: ROBOTC Driver Suite V1.0
Great work. Looks like I need to get the new smux. I was really hoping you would have something in there for the mindsensors servo controller but one can't have everything.


Tue Oct 06, 2009 11:32 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3162
Location: Rotterdam, The Netherlands
Post Re: Released: ROBOTC Driver Suite V1.0
Thanks for the kind words, guys!

Ford,
Unfortunately, you can't daisy chain them, that's not how this sensor works. As for the simplicity, well, as I was making them I tried to hide as much of the complexity from the user as possible.

Marshalk,
It works by recognising the sensor attached to the MUX port (that's what happens when you call HTSMUXscanPorts(HTSMUX);) and then loading a "profile" of that particular sensor. In other words, it needs to know a little about the sensor before it can start polling it. The bytes that are polled are stored in a specific range of registers that can then be retrieved via the brick. If you go through the code, you'll see what I mean.

I am sure you understand why HiTechnic wouldn't put support for their main competitor in their sensors :)

If you have the SMUX and you want to try something cool, check out SMUX-test1.c, it basically allows you to attach pretty much any supported sensor and it will display the data from those sensors. It's a cool menu driven program. You can detach, attach and rescan as well. Please note that you will need 1.9x to make it work because of the sheer number of functions in it. 1.4x has a 100 function limit, 1.9x has a much higher limit. I'll post a video of that program sometime this week if I get the time.

Future developments:
* Support for the IR Receiver (it's somewhere over the Atlantic as we speak)
* Support for the NXT Servo sensor (it's getting there)
* Optimisation of the drivers, in other words, combine the HTCS and HTCS2 and use sensor identification to make the right I2C calls. The same goes for the IR Seeker and V2.

Regards,
Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Wed Oct 07, 2009 1:08 am
Profile WWW
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post Re: Released: ROBOTC Driver Suite V1.0
hi Xander,
just 2 questions:
- RCXMUX = RCX Sensor multiplexer for NXT (RXMux allows you to connects upto 4 RCX style sensors to NXT) ?
- will the MightyBoard be supported? ;)

_________________
regards,
HaWe aka Ford
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;task main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}


Last edited by Ford Prefect on Wed Oct 07, 2009 7:57 am, edited 1 time in total.



Wed Oct 07, 2009 7:54 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3162
Location: Rotterdam, The Netherlands
Post Re: Released: ROBOTC Driver Suite V1.0
You already have drivers for that :)

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Wed Oct 07, 2009 7:56 am
Profile WWW
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post Re: Released: ROBOTC Driver Suite V1.0
Hi Xander,
I think you misunderstood my question:
I meant:
can both the Mindsensors RCX Sensor MUX and the Mightyboard be attached to the Hitechnic SMux?

_________________
regards,
HaWe aka Ford
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;task main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}


Thu Oct 08, 2009 2:19 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3162
Location: Rotterdam, The Netherlands
Post Re: Released: ROBOTC Driver Suite V1.0
Neither can. No Mindsensors sensors are supported. I posted the list of supported devices here:
http://forums.nxtasy.org/index.php?s=&s ... st&p=32884

Regards,
Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Thu Oct 08, 2009 2:31 pm
Profile WWW
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post Re: Released: ROBOTC Driver Suite V1.0
sh*t.
Then I can't use it.
Except you can hack the firmware...?

_________________
regards,
HaWe aka Ford
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;task main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}


Thu Oct 08, 2009 3:40 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3162
Location: Rotterdam, The Netherlands
Post Re: Released: ROBOTC Driver Suite V1.0
As far as I know you can't hack the firmware of the sensor MUX.

Regards,
Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Thu Oct 08, 2009 3:56 pm
Profile WWW
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post Re: Released: ROBOTC Driver Suite V1.0
faulty construction.
why can't they simply support the Lego standard..?!!
Any sensor type that can be defined e.g. by
SensorType[NxtPort] = SensorXYZ or
SensorMode[] =...
SensorValue[] =...
SensorRaw[] =...
must be able to be defined at a mux port like
SensorTypeMux[NxtPort; MuxPort]=SensorXYZ
SensorModeMux[] =...
SensorValueMux[] =...
SensorRawMux[] =...

(or a similar function) by the programmer.
BTW I have no idea why Robotc uses [] instead of ()

_________________
regards,
HaWe aka Ford
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;task main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}


Last edited by Ford Prefect on Fri Oct 09, 2009 1:26 pm, edited 6 times in total.



Thu Oct 08, 2009 4:12 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3162
Location: Rotterdam, The Netherlands
Post Re: Released: ROBOTC Driver Suite V1.0
Also, I am keen to know what you mean by "Lego Standard". Do you mean the I2C standard? It's not a Lego standard at all, it precedes the NXT by quite a number of years. Lego doesn't support half the things you plan to do with your NXT. The MUX supports Lego certified sensors, not the ones that aren't certified. Unfortunately, none of the sensors made by Mindsensors are Lego certified. The MightyBoard which I made for you sure as heck isn't certified by Lego. You can't complain about other people not adhering to imagined standards when you're more than happy to disregard established ones yourself when it suits your purposes.

Now, I will remove all posts from now on that are not related to these drivers. If you want to start a "the new smux sux" thread, go right ahead, but keep it out of this one. Make sure you post it in the "Off-Topic" forum.

Regards,
Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Thu Oct 08, 2009 4:38 pm
Profile WWW
Professor

Joined: Fri Sep 19, 2008 1:22 am
Posts: 200
Post Re: Released: ROBOTC Driver Suite V1.0
Great job on the driver suite. I particularlily like the nice clean interface for the smux.

_________________
Jeff McBride
Benson Robotics Club


Thu Oct 08, 2009 10:11 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3162
Location: Rotterdam, The Netherlands
Post Re: Released: ROBOTC Driver Suite V1.0
Jeff,

Thanks! I would appreciate any feedback you might have regarding the interface or any other part of the driver suite.

Regards,
Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Fri Oct 09, 2009 1:41 am
Profile WWW
Display posts from previous:  Sort by  
This topic is locked, you cannot edit posts or make further replies.   [ 14 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.