Thanks a bunch.afanofosc wrote:I will work to incorporate the new absolute position regulation changes from Nicolas into my enhanced NBC/NXC firmware. I am also working on getting my firmware SVN repository up on sourceforge. Hopefully I can get it up there this month.
John Hansen
wishlist for NXC
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: wishlist for NXC
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
Re: wishlist for NXC
Niceafanofosc wrote:I will work to incorporate the new absolute position regulation changes from Nicolas into my enhanced NBC/NXC firmware. I am also working on getting my firmware SVN repository up on sourceforge. Hopefully I can get it up there this month.
In this case, for backward compatibility, I suppose it is still better to keep the 100 ms regulation interval by default. I did not handle the TurnRatio != 0 case yet, I think it is buggy (TurnRatio value should be divided by 100ms/regulation time). I have to add fractional value support for TurnRatio like I did for Speed.
EDIT: I started to patch bricxcc to add new fields, this is really a draft (missing doc for example), but it may help: http://ni.fr.eu.org/~nico/nxc/bricxcc-absreg.patch
LEGO things http://ni.fr.eu.org/lego/ - NXT Improved Firmware (GCC) http://nxt-firmware.ni.fr.eu.org/ - Other robots http://apbteam.org
Re: wishlist for NXC
I had the same "fakedio.h" * wish as doc-helmut since forever (which was way before yesterday, but sometime after time came into existence).
Insanity:
Insanity:
Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE
Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
Re: wishlist for NXC
atan2 says:
Not ringing a bell? What about this:
My question is... why are they different? Shouldn't the atan2d() say +/-180 degrees? Or is the output really between 90 and -90? Should I start using my own atan2d() function?
-----
And another thing... ( )
Could we have these built in:
I don't like thinking about [simple or complicated] conversions, especially if I have about ten of them on one line:
atan2d says:atan2 wrote:Returns:
Arc tangent of y/x, in the interval [-pi,+pi] radians.
Notice anything? Hint:atan2d wrote:Returns:
Arc tangent of y/x, in the interval [-90,+90] degrees.
Code: Select all
pi radians != 90 degrees
Code: Select all
pi radians != pi/2 radians
Code: Select all
inline float myatan2d(float y, float x)
{
return(atan2(y, x) * DEGREES_PER_RADIAN);
}
-----
And another thing... ( )
Could we have these built in:
Code: Select all
// #define degToRad(x) (x * RADIANS_PER_DEGREE)
// #define radToDeg(x) (x * DEGREES_PER_RADIAN)
inline float degToRad(float x)
{
return(x * RADIANS_PER_DEGREE);
}
inline float radToDeg(float x)
{
return(x * DEGREES_PER_RADIAN);
}
* yoctohertzMy 1yHz* Brain wrote: 00101010 10011010 01101110
[Translation:]
Now, if I'm converting x degrees to y radians, do I do y = x * RADIANS_PER_DEGREE, since it will be rad = deg * (rad / deg), or should I do it the other way around?
-- Later --
01000111 01001111 01001111 01000111 01001100 01000101 01001011 01001111
[Translation:]Code: Select all
float z = x == 3 * DEGREES_PER_RADIAN ? y == 4 * RADIANS_PER_DEGREE ? 5*x/RADIANS_PER_DEGREE : y+42*RADIANS_PER_DEGREE : 101 == LOL ? LOL : 42;
Last edited by muntoo on 19 Feb 2011, 03:41, edited 1 time in total.
Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE
Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: wishlist for NXC
I am sure it is just a mistake, as there are many in the help files.
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
Re: wishlist for NXC
muntoo, please stop faking and bastardizing the sources of quotes - it's weird and confusing !
float Deg_Per_Rad= 180 / 3.14159265
for atan you may get only values of the interval ] −π/2 ; +π/2 [ (π/2 = 90°)
by atan2 you may use all 4 quadrants for x, y of the coordinate system (except discontinuities at +/- π/2)
(CMIIW)
float Rad_Per_Deg= 3.14159265 / 180My 1yHz* Brain wrote:00101010 10011010 01101110
[Translation:]
Now, if I'm converting x degrees to y radians, do I do y = x * RADIANS_PER_DEGREE, since it will be rad = deg * (rad / deg), or should I do it the other way around?
-- Later --
01000111 01001111 01001111 01000111 01001100 01000101 01001011 01001111
[Translation:]...Code: Select all
...
float Deg_Per_Rad= 180 / 3.14159265
for atan you may get only values of the interval ] −π/2 ; +π/2 [ (π/2 = 90°)
by atan2 you may use all 4 quadrants for x, y of the coordinate system (except discontinuities at +/- π/2)
(CMIIW)
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: wishlist for NXC
I would like higher I2C speed to be supported (but optional) in NXC. There are a few things the NXT could do much better if it was able to run the I2C bus at 100kHz or so. Ideally, you could allow the speed to be selected (maybe 4 speed options). Perhaps even an infinite number of speeds, allowing for the highest speed the external hardware supports.
A quote from Andy
A quote from Andy
No rush getting it implemented (if at all), but it would be cool.gloomyandy wrote:Hi,
So I've been tweaking the i2c code in the leJOS firmware. With that I can run reliably at 125KHz (as opposed to the standard 9.6KHz). This seems to work with all of the non Lego i2c devices I have (half a dozen or so in all). I can even combine most of them on a single bus (using a port splitter). Any faster than this though and things seem to fall apart...
Andy
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
Re: wishlist for NXC
Dear Santa-John,
I firmly hope you're not stuck in the chimney anywhere, so please forgive me when I respectfully dare to kindly remind you of my Christmas present...of last year...?
I hope you still remember what I am referring to .... ?
If I'm not much mistaken, it might be rather far back in the Book of Christmas Wishes ... from last Christmas ... and it starts with a "T "....
Kind regards,
*cough*
D.H.
(!! INPUT !! - Johnny_7 needs action...)
I firmly hope you're not stuck in the chimney anywhere, so please forgive me when I respectfully dare to kindly remind you of my Christmas present...of last year...?
I hope you still remember what I am referring to .... ?
If I'm not much mistaken, it might be rather far back in the Book of Christmas Wishes ... from last Christmas ... and it starts with a "T "....
Kind regards,
*cough*
D.H.
(!! INPUT !! - Johnny_7 needs action...)
Re: wishlist for NXC
John,
though everybody might do it "his way", what do you think about simplifying the confusion about raw sensor modes by defining in NXC API something like
which does with SetSensor() like
the same as
- if possible not by a macro but by an inline function, so that also variables like function returned values may be passed to it.
Having once configured the sensor this way, the standard reading
should always give the same result as SensorRaw(_port).
though everybody might do it "his way", what do you think about simplifying the confusion about raw sensor modes by defining in NXC API something like
Code: Select all
SENSOR_ANALOG_RAW
Code: Select all
SetSensor(_port, SENSOR_ANALOG_RAW)
Code: Select all
SetSensorType(_port, SENSOR_TYPE_TOUCH);
SetSensorMode(_port, SENSOR_MODE_RAW);
Wait(20);
Having once configured the sensor this way, the standard reading
Code: Select all
SensorValue(_port)
Re: wishlist for NXC
I can't include more than a few files. (They all have include guards, except the ones with * after their name.)
-----
To be exact, I'm including multiple files inside "MM_v0_3.nxc". "MM.nxc" * #includes "MM_v0_3.nxc". "MM-Demo.nxc" * #includes "MM.nxc" *.
The first two files of "MM_v0_3.nxc" cause no trouble.
The last three do cause trouble. Removing the includes doesn't cause any trouble. (After you copy some of the MM_get_LONG/MM_set_LONG functions before removing the #include, of course.)
-----
Leaving this at the end of "MM_v0_3.nxc" causes another compile error:. Remove it, and the three "bad include files", and I finally get a successful compile.
-----
EDIT: Alternatively, you can add a line break after /*<br />*/ to prevent compile errors
-----
To be exact, I'm including multiple files inside "MM_v0_3.nxc". "MM.nxc" * #includes "MM_v0_3.nxc". "MM-Demo.nxc" * #includes "MM.nxc" *.
The first two files of "MM_v0_3.nxc" cause no trouble.
The last three do cause trouble. Removing the includes doesn't cause any trouble. (After you copy some of the MM_get_LONG/MM_set_LONG functions before removing the #include, of course.)
-----
Leaving this at the end of "MM_v0_3.nxc" causes another compile error:
Code: Select all
/*
Reasons to use:
//...
To do:
// ...
// Blah blah blah
*/
-----
EDIT: Alternatively, you can add a line break after /*<br />*/ to prevent compile errors
Code: Select all
/*
Reasons to use:
//...
To do:
// ...
// Blah blah blah
*/
- Attachments
-
- v0_3.zip
- (13.28 KiB) Downloaded 264 times
Commit to LEGO Mindstorms Robotics Stack Exchange:
bit.ly/MindstormsSE
Commit to LEGO Stack Exchange: bit.ly/Area51LEGOcommit
Who is online
Users browsing this forum: No registered users and 0 guests