Trig functions in NXT-G
Trig functions in NXT-G
Are there any blocks for the standard trig functions in NXT-G 2.0? There used to be one for NXT-G that used fixed point math but it was sssssllllloooooowwww, up to 0.1 second per function (sin, cos, tan, asin, acos, atan), which is unacceptable for me.
Are the normal trig functions even part of the standard firmware or can they only be found in the enhanced firmware?
Regards,
Xander
Are the normal trig functions even part of the standard firmware or can they only be found in the enhanced firmware?
Regards,
Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
-
- Posts: 346
- Joined: 27 Sep 2010, 03:05
- Contact:
Re: Trig functions in NXT-G
I think I remember seeing a block over on NXTa-woops. darn. Guess we're going to have to recreate that index of NXT-G blocks.mightor wrote:Are there any blocks for the standard trig functions in NXT-G 2.0? There used to be one for NXT-G that used fixed point math but it was sssssllllloooooowwww, up to 0.1 second per function (sin, cos, tan, asin, acos, atan), which is unacceptable for me.
Are the normal trig functions even part of the standard firmware or can they only be found in the enhanced firmware?
I'm out of practice on building blocks, but it would be great content for Mindboards.
Steve
---> Link to lots of MINDSTORMS stuff under my picture --->
Re: Trig functions in NXT-G
What trig blocs did you use? Claude Baumann's ones seem reasonably fast (though using integer and NXT 1 FW):
Sin/Cos and Atan / Atan2
Sin/Cos and Atan / Atan2
Philo
Re: Trig functions in NXT-G
The latest version of the standard firmware has a section of code that has been commented out using #if 0 ... #endif which contained an implementation of the standard trig functions (sin, cos, tan). The NXT-G compiler probably would have needed to be changed to support new opcodes and that may be why they decided not to add them to the firmware. Radian and degree versions of trig functions are available in abundance in the enhanced NBC/NXC firmware but there isn't any way to use them in NXT-G.mightor wrote:Are the normal trig functions even part of the standard firmware or can they only be found in the enhanced firmware?
John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
http://bricxcc.sourceforge.net/
Re: Trig functions in NXT-G
Philo,
Ah so it;s not 100ms, but 14ms per operation, that's still quite slow for what I want to do with it. I was hoping to be able to use native calls through NXT-G blocks. I guess I'll have to use something else.
- Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
-
- Posts: 346
- Joined: 27 Sep 2010, 03:05
- Contact:
Re: Trig functions in NXT-G
Oh, come on. I did my Omni stuff with NXT-G...mightor wrote:Ah so it;s not 100ms, but 14ms per operation, that's still quite slow for what I want to do with it. I was hoping to be able to use native calls through NXT-G blocks. I guess I'll have to use something else.
Steve
---> Link to lots of MINDSTORMS stuff under my picture --->
-
- Posts: 16
- Joined: 01 Oct 2010, 03:07
Re: Trig functions in NXT-G
if you want I have a folder on my computer with every single block from nxtasy's repo organized by type (advanced, sensor, ect) so if anyone wants a block before the new blocks get posted I have them at easy acess.
In A World Filled With Seemingly Endless Limitations....
-toshiba a long long time ago
-toshiba a long long time ago
Re: Trig functions in NXT-G
I want to do more than just control the wheels, I need time to do other stuff, toohassenplug wrote:mightor wrote:Oh, come on. I did my Omni stuff with NXT-G...
- Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
Re: Trig functions in NXT-G
I was in the process of creating a back-up on th Lroboticas wiki. It is very incomplete, but it may be a start:hassenplug wrote: I think I remember seeing a block over on NXTa-woops. darn. Guess we're going to have to recreate that index of NXT-G blocks.
http://lrobotikas.net/wiki/index.php?ti ... para_NXT-G
Re: Trig functions in NXT-G
Xander,
Is there a particular reason why you want to limit yourself to using NXT-G ?
NXT-G might not always be the best choice for advanced use cases.
Is there a particular reason why you want to limit yourself to using NXT-G ?
NXT-G might not always be the best choice for advanced use cases.
Who is online
Users browsing this forum: No registered users and 1 guest