Announcement

Collapse
No announcement yet.

A Working RR Trip Meter

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • A Working RR Trip Meter

    When I get out of town on some of my 4WD trips I use my Car Speedo’s trip meter either for resetting to 0.0 at the beginning of a track where I am looking for a track or turnoff that is not always marked on the map. I also use it to calculate fuel consumption especially in long sandy trips where the fuel consumption is greater than normal.

    This got me thinking about making a RoadRunner screen with 2 or 3 trip meters, where you can either set the starting value to 0.0 and have it count up or set a distance and have it count backwards.

    I have now got a basic working trip meter but need to get some feedback as to what to do next.

    As a prototype I just used AutoIT as I don’t have any VB skills. This is the logic to how it works.

    Read GPSLAT & GPSLON from RR work out the distance between this lat and long and the previous set you read. Add the difference to a counter.

    then send the value of the counter back to RR as a custom label

    On a test run in the car today over 12km on my Speedo I got 12.04 one-way and 12.02 in reverse

    One thing I did notice that will have to be added to the code is not to increment the counter if the speed is less that 1km, sitting at the lights I was getting very small increments but over time they could add up

    --------------------------------------------------------------------------
    $pi = 3.14159265358979
    $counter1 = 0.00
    $lat2 = rrget ("GPSLAT")
    $lon2 = rrget ("GPSLON")

    while 1
    $lat1 = rrget ("GPSLAT")
    $lon1 = rrget ("GPSLON")
    $dist3 = distance($lat1, $lon1, $lat2, $lon2)
    ;swap the points ready for next calculation
    $lat2 = $lat1
    $lon2 = $lon1
    $counter1 = $counter1 + $dist3
    rrsnd ("!MYCTR", $counter1)
    sleep(1000)
    wend
    exit

    I have the following AutoIt functions

    rrget – will read a label from RR
    rrsnd – will send back to RR a custom label
    distance – calculates the distance between ($lat1, $lon1, $lat2, $lon2)

    rrget and rrsnd were written by @cool dude back in march when I was playing around with getting a compass working, and he changed the VB SDK example so you can talk to the SDK it without the VB form.
    --------------------------------------------------------------------------

    All the mathematics are in the distance function
    I found on the www a few different ways to calculate the distance between 2 geographical coordinates; I have used a formula that is based on spherical trigonometry which is supposed to be more accurate than some of the others

    I would also like to see Average speed as a label

    Why I have posted is to get some feedback on what to do next

    Are there enough people that would like to have a trip meter as part of RR in which case we can ask Guino to add it to RR

    Or I just continue using AutoIT and finish off the development myself and release it when I finish my 4WD skin

    Thinking outside the box and on a comment Rustyboxx made is if you have 3 or 4 trip counters you could assign one for work mileage and save the counter to a file when you exit RR, probably even a description of the work trip.

    Your comments and thoughts

  • #2
    subscribed
    95 Mazda Protege LX
    Worklog
    Overall [Project Dead] 0%

    2003 Nissan Altima
    [XXXXXXXX--] 80% Planning
    [XX--------] 20% FABRICATION/INSTALLATION

    Worklog

    Comment


    • #3
      Maybe also have a variable gauge that by clicking will cycle through displays of things like:
      Average speed
      Time traveling
      Current speed (To have it on the same page for ease)
      Average time/distance between stops

      and other such things that could maybe be customized.
      Fusion Brain Version 6 Released!
      1.9in x 2.9in -- 47mm x 73mm
      30 Digital Outputs -- Directly drive a relay
      15 Analogue Inputs -- Read sensors like temperature, light, distance, acceleration, and more
      Buy now in the MP3Car.com Store

      Comment


      • #4
        This is a great idea Ash and one that would appear to have quite a few possibilities as Toaster pointed out. Excellent work on getting the complicated maths sussed, I can't believe you got it working and tested in such a short time.

        I'll be keeping a close eye on this and encourage other members to express their interest and opinion as this is a feature that is well overdue.

        Ash, I've got another idea for your 4wd skin if you get time. Catch me on msn later
        Only true postwhores remember everything they post

        REP CLUB IS DEAD
        LONG LIVE REP CLUB

        Comment


        • #6
          Very interesting, subscribing to this idea

          Comment


          • #7
            good idea
            My Nissan 200SX @ Silverstone
            NOW SADLY WRITTEN OFF!

            My Car's spec list + pics

            Stealth CarPC fab'ing...

            Comment


            • #8
              Ash, I just posted a link to this thread on DC. Hope you don't mind
              Only true postwhores remember everything they post

              REP CLUB IS DEAD
              LONG LIVE REP CLUB

              Comment


              • #9
                Maybe Tissy in the RR clock thread could add the info you want to a screen in 1 of his flash clocks.
                Great Idea BTW
                Nice1 Ash
                P4 2.8 HT, 512Mb Ram, 60Gb 2.5 HD, M4-ATX, SB Audigy2, BU353, Lilliput TS,Soundgraph Imon VFD,SONY Optiarc dvd Burner,RideRunner, iGo8, Custom Freedom 2.1

                Comment


                • #10
                  Ash, if you need a willing volunteer to test this.........
                  Only true postwhores remember everything they post

                  REP CLUB IS DEAD
                  LONG LIVE REP CLUB

                  Comment


                  • #11
                    are you using the great circles distance calc or utm conversion ive also scoured the net for some decent code for gps gas and found that great circles is usually pretty good matches up with google and yahoo maps pretty well
                    .______
                    | '_ |__\___
                    [(o)|___(o)] XB
                    ._________
                    | I__I I_I|_\__I
                    [(o)______(o)]b VanPimpin'

                    LostReceptions Apps D/L Here

                    GPSGasoline- Rewriting

                    Draw- SkribblePad for Touchscreens

                    iGQwerty-iG3.0 Qwerty Keyboard

                    CarPCNetwork

                    Comment


                    • #12
                      Yes I used the great circles distance formula, I hope Guino adds this to RR, and provide 3 or 4 counter labels, then we can each use the information the way we want too.

                      Guino can probably shed more light on how hard it will be but he is already reading the raw gps information. I did all the maths (about 6 lines of code) in one function so it would be easy for Guino to copy. It will only need a bit of a syntax change to make it work in VB. AutoIt and VB code is very similar especially the all the trig functions.

                      Add Counter1 Counter2 ……as new RR labels

                      add 4 command
                      start counter#, stop counter#, Clear Counter#, counter direction# (EG count up or down)

                      While it works in Autoit passing labels back and forward between AutoIT and RR just uses extra CPU which most people hate

                      Then we can each use the Counter labels for our own needs, like you say use it your GPS Gasoline app.

                      I imagine that a few like Tissy and DiNASTY will do flash trip meters, if we can get this to fly

                      Also thought that Chuck would want one for his Truck, if he doesn’t use it to keep track of distance he can always use it to count his RR variables

                      Comment


                      • #13
                        im sure someone wil chime in eventually to say that what if you lose gps signal well for one thing its possible to place a counter in the app that if and update is not recieved for say 5- 10 seconds or more it then dumps those untracked variables then upon resumption of the signal it should dump the next distanc calculation into a lostsignal.ini and also add it to the trip meter then you can go back and view those droputs and see it they make sense or not in terms of calculation lets say u have a distance of 30 miles in there obviosly wrong

                        what do you think
                        if i wasnt coding gps gas id take a stab at this let me know if u need any help
                        .______
                        | '_ |__\___
                        [(o)|___(o)] XB
                        ._________
                        | I__I I_I|_\__I
                        [(o)______(o)]b VanPimpin'

                        LostReceptions Apps D/L Here

                        GPSGasoline- Rewriting

                        Draw- SkribblePad for Touchscreens

                        iGQwerty-iG3.0 Qwerty Keyboard

                        CarPCNetwork

                        Comment


                        • #14
                          Originally posted by lostreception
                          im sure someone wil chime in eventually to say that what if you lose gps signal well for one thing its possible to place a counter in the app that if and update is not recieved for say 5- 10 seconds or more it then dumps those untracked variables then upon resumption of the signal it should dump the next distanc calculation into a lostsignal.ini and also add it to the trip meter then you can go back and view those droputs and see it they make sense or not in terms of calculation lets say u have a distance of 30 miles in there obviosly wrong
                          But your speed will also be reporting 0km so no data will be added to the counter, when you get signal back the distance from your last recorded point will be calculated, so if you drive in to a tunnel and lose gps for 2km (long tunnel) when you get back out the gps signal will come back, the speed will be > that 0 and the calculation will be based on your last known point (just before you went in the tunnel) to your current point, so it will still be very accurate.

                          EDIT Unless you’re in some alpine region and the tunnels go round in spirals

                          Comment


                          • #15
                            Hmmm, I'm surprised there are not more people interested in this. I would have thought a lot of people would have jumped on this idea even if just expressing an interest. Ash, let us know if there are further developments.
                            Only true postwhores remember everything they post

                            REP CLUB IS DEAD
                            LONG LIVE REP CLUB

                            Comment

                            Working...
                            X