Go to Post The robot can inflate the ringer. How cool is that? - dtengineering [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 03-04-2013, 11:18
brennonbrimhall brennonbrimhall is offline
Free Agent
AKA: Brennon Brimhall
no team
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Clifton Park, NY
Posts: 222
brennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to all
Inverse Trig in Java ME

I've found myself in a bit of a pickle. I need to write a calculation that involves some inverse trig for our robot, and the embedded version of Java that the cRIO uses (Java ME) does not have the inverse trig functions of the Java SE Math library.

How have other teams moved past this limitation?
__________________
Team 20, 2012-2014: 4 blue banners, 5 medals, and 9 team awards.
Church of Jesus Christ of Latter-day Saints, 2014-2016: Missionary, Colorado Denver South Mission.
Reply With Quote
  #2   Spotlight this post!  
Unread 03-04-2013, 11:20
BigJ BigJ is offline
Registered User
AKA: Josh P.
FRC #1675 (Ultimate Protection Squad)
Team Role: Engineer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Milwaukee, WI
Posts: 945
BigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond repute
Re: Inverse Trig in Java ME

You want MathUtils. It provides some of the functions that you'd usually find in Math in Java SE that aren't implemented in ME's Math class.
Reply With Quote
  #3   Spotlight this post!  
Unread 06-04-2013, 07:33
shindigo shindigo is offline
Registered User
AKA: Mike Parker
FRC #0102
Team Role: Mentor
 
Join Date: Feb 2012
Rookie Year: 2009
Location: Somerville, NJ
Posts: 33
shindigo is an unknown quantity at this point
Re: Inverse Trig in Java ME

Another possibility is javalution: http://javolution.org/core-java/targ...ocs/index.html I have never compared this with mathutils, but it might be worth exploring too.
Reply With Quote
  #4   Spotlight this post!  
Unread 06-04-2013, 08:31
brennonbrimhall brennonbrimhall is offline
Free Agent
AKA: Brennon Brimhall
no team
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Clifton Park, NY
Posts: 222
brennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to all
Smile Re: Inverse Trig in Java ME

Thanks for all the help!
__________________
Team 20, 2012-2014: 4 blue banners, 5 medals, and 9 team awards.
Church of Jesus Christ of Latter-day Saints, 2014-2016: Missionary, Colorado Denver South Mission.
Reply With Quote
  #5   Spotlight this post!  
Unread 07-04-2013, 17:35
MikeE's Avatar
MikeE MikeE is offline
Wrecking nice beaches since 1990
no team (Volunteer)
Team Role: Engineer
 
Join Date: Nov 2008
Rookie Year: 2008
Location: New England -> Alaska
Posts: 381
MikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond reputeMikeE has a reputation beyond repute
Re: Inverse Trig in Java ME

Depending on how you intend to use the trig function, another option is to write a simple routine that gives an approximate but "close enough" answer.

For example, our robot uses a leadscrew to adjust the tilt angle of our climbing mast. There is an encoder attached to the end of the leadscrew so we can measure the distance it has traveled and use the cosine rule to convert this to an angle for the drivers. However to convert from leadscrew distance to angle requires using the acos() function.

Since the range of leadscrew distances are limited by the physical system, our programmers approximated the function using a piecewise linear approximation implemented as a lookup table. While the results are approximate they are close enough for visual display.

This approach is fairly common practice in embedded software, and can be used safely if you do proper error analysis.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 09:52.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi