Slashdot Mirror


Software Patch Fixes Mars Curiosity Rover's Auto-focus Glitch

An anonymous reader writes: Scientists from Los Alamos National Laboratory have successfully uploaded and applied a software patch to NASA's Curiosity Rover on Mars. The patch fixes a focusing problem that cropped up in November when the laser that helps to focus one of its cameras failed. "Without this laser rangefinder, the ChemCam instrument was somewhat blind," said Roger Wiens, ChemCam principal investigator at Los Alamos. "The main laser that creates flashes of plasma when it analyzes rocks and soils up to 25 feet [7.6 meters] from the rover was not affected, but the laser analyses only work when the telescope projecting the laser light to the target is in focus." Before the fix, scientists had to shoot images at nine different focus settings to distill a decent set of data. Now, they say the new software results in better images in a single shot than even before the laser broke down. The program that runs the instrument is only 40 kilobytes in size.

53 comments

  1. Los Alamos by Anonymous Coward · · Score: 1

    I worked at Los Alamos National Lab for a number of years. There are some very skilled people there who are very dedicated. America can do good science when it has the will. Which unfortunately isn't so often.

  2. Glitch? by Anonymous Coward · · Score: 0

    What is this?

  3. Distance by Anonymous Coward · · Score: 0

    I've only had to patch up systems from about 6900 Kilometers ( ~4300 miles ) away.

    1. Re:Distance by frostfreek · · Score: 1

      Could you imagine if the patch bricked the system, ON MARS? Do not unplug device during firmware update.

  4. Source code? by Anonymous Coward · · Score: 5, Interesting

    Apollo space program is documented in great detail. Even the software running in the flight computers is nowdays available and you can run the whole thing in a virtualized guidance computer. http://www.ibiblio.org/apollo/

    Does anyone have any idea what's the case with probes and landers? I know they are mostly running VxWorks, but I'd love to take a peek on how some of the routines are actually implemented.

    1. Re:Source code? by jonwil · · Score: 3, Insightful

      Me, I wish the code for the Space Shuttle was available. The shuttles are now decommissioned and sitting in museums and no country wanting to build any kind of shuttle or space plane is going to be replicating a 40 year old American design when there are far better ways to do it nowadays so there shouldn't be any risk to national security in releasing the code (not to mention that the code alone isn't enough to rebuild the computer system, let alone the whole shuttle).

    2. Re:Source code? by Anonymous Coward · · Score: 1

      Conceivably some of the shuttle guidance systems and such could be useful for ballistic missile development? At least, it could be informational for developing such systems, if not directly usable.

    3. Re:Source code? by Anonymous Coward · · Score: 1

      Regardless, the software in the rover that the article is talking about doesn't contain anything related to missile launching and is developed using public funding.
      The only reason to not make the rover software publicly available is that it could benefit other nations space programs. This in itself wouldn't harm the US space program, unless you consider dick-waving to be the most important thing in the world.
      Sharing software makes the world richer, not poorer. Considering that the software written on the taxpayers expense making the software publicly available is also the morally right thing to do.

    4. Re:Source code? by Anonymous Coward · · Score: 0

      The software is extremely old. I suspect any nation capable of building the hardware will have no problems writing the software. With moderns tools and processors a lot of the problems faced back then are probably removed completely.
      Heck, I wouldn't be surprised if computer games today have more advanced pathing for NPCs.
      The main reason it isn't released is probably because there is no benefit for the government in doing so.

    5. Re:Source code? by Anonymous Coward · · Score: 0

      First and foremost the physics are understood. Putting them into software is just an act of engineering, which gets more easy with increasing processing power. Any clever ideas to reach "good enough" given the constraints no longer matter, as practically no more constraints exist.

    6. Re:Source code? by Anonymous Coward · · Score: 0, Insightful

      Sharing software makes the world richer, not poorer...

      Can you prove this? I'd say that is totally untrue. Nice try, though, Mr Socialist.

    7. Re:Source code? by Anonymous Coward · · Score: 0

      It's not that they worry about people not being able to write the software. What they worry about is people analyzing software to get information on the hardware.

    8. Re:Source code? by Anonymous Coward · · Score: 0

      Nice try, though, Mr Socialist.

      One of these days, perhaps I will encounter someone on slashdot that actually knows what that word means.

    9. Re:Source code? by Anonymous Coward · · Score: 1

      If you really don't understand what the word 'richer' means in the context in which the parent poster was using it, then I truly feel sorry for you.

    10. Re: Source code? by Anonymous Coward · · Score: 1

      http://code.nasa.gov/#/

    11. Re: Source code? by Anonymous Coward · · Score: 0, Redundant

      Sadly this country is full of twerps who believe that anything that doesn't lead to a private entity making a profit immediately isn't worry anything. They think that doing anything that benefits others is useless, even if it also benefits them. Of course they have no concept of what words like socialism actually mean, and simply hurl then around as though everyone will and should perceive them as an insult.

      It's a mental illness, and not only do they not seem to have a treatment for it, nobody's actually looking for one either.

    12. Re:Source code? by camperdave · · Score: 1

      Suppose I didn't know what relocateable code was. Everything I wrote had to be in a specific memory location, or it wouldn't work. Then I see relocateable code and learn how it works. Now I can write code that is able to be loaded anywhere in memory. The world is now richer.

      --
      When our name is on the back of your car, we're behind you all the way!
    13. Re: Source code? by Anonymous Coward · · Score: 0

      Of course they have no concept of what words like socialism actually mean, and simply hurl then around as though everyone will and should perceive them as an insult.

      What does voluntary sharing of software and source code have to do with the forced extraction of labor from the public by the state (socialism)?

      Voluntary sharing is a free market idea, not a socialist idea, and you are dishonest to try and justify the violence of socialism with the charity of voluntarism.

  5. Still a hack, but way better than nothing. by Mal-2 · · Score: 4, Interesting

    This fix still requires much of the resources of the previous method, essentially bracketing the shot and picking the best one. This means it will still take just as long to obtain each image, but apparently that wasn't a huge problem. What this saves is something precious though: bandwidth. Now the rover is picking the best shot, instead of sending a bunch of blind guesses and making us sort it out. I suspect that if the bandwidth wasn't precious, they wouldn't have bothered improving on the existing workaround, so it must have been worth all the trouble.

    --
    How is the Riemann zeta function like Trump rallies? Both have an endless number of trivial zeros.
    1. Re:Still a hack, but way better than nothing. by itzly · · Score: 1

      This means it will still take just as long to obtain each image

      Not having to send the images to earth saves a lot of time.

    2. Re:Still a hack, but way better than nothing. by Anonymous Coward · · Score: 2, Interesting

      Technically you don't even need a range finder.

      It's possible to do autofocus through-the-lens with phase detection or contrast detection:

      Contrast detection places different constraints on lens design when compared with phase detection. While phase detection requires the lens to move its focus point quickly and directly to a new position, contrast detection autofocus instead employs lenses which can quickly sweep through the focal range, stopping precisely at the point where maximum contrast is detected. This means that lenses designed for phase detection often perform poorly on camera bodies which use contrast detection.

      From a link in TFA:

      They figured out that if they discarded a lot of the old code on board their distant subject, they could make room for software that could command the instrument to take the nine images on its own and analyze them on-board to find the best focus.

      I guess they didn't have room on the device to code up a binary search of the contrast method before acquiring a single image?

    3. Re:Still a hack, but way better than nothing. by Anonymous Coward · · Score: 0

      Yeah, but since the update it now tracks the websites you visit and sends you customized adds whenever you open a new tab.

    4. Re:Still a hack, but way better than nothing. by citizenr · · Score: 3, Informative

      so it sounds like a simple FFT to pick one with biggest high frequency coefficients. You can do it yourself smapping pictures at different focus and simply comparing file sizes: better focus = finer detail = more high frequency content = more information to store. Think JPG Quantization table and quality setting.

      --
      Who logs in to gdm? Not I, said the duck.
    5. Re:Still a hack, but way better than nothing. by Anonymous Coward · · Score: 0

      And more importantly, it saves a lot of power. The MMRTG power supply is supposed to last 14 years. However, that's at very low consumption levels. Transmitting requires a good deal of power. The upper limit of transmission due to power consumption is about 3 hours a day. This adds a further constraint beyond just the basic bandwidth as we would typically consider it, since it's 24x7. The rover can transmit at 128kbps for those 3 hours to the orbiters. But the orbiters are overhead for about 8 minutes at a time. So the upper limit of data per transmission is around 60Mb(its) or around 7MB.

      The orbiters transmit to Earth for around 16 hours a day, and have solar panels for power.

    6. Re:Still a hack, but way better than nothing. by Immerman · · Score: 1

      Well you'd still have to take images to tell the current state of the contrast, after all the camera can only "see" through the lenses when taking a picture. Also a binary search is likely suboptimal for such things, an interpolation search is likely to be far more efficient since you presumably have enough information after the first few images to make a good guess as to where in the spanned range the "sweet spot" will be.

      --
      --- Most topics have many sides worth arguing, allow me to take one opposite you.
    7. Re:Still a hack, but way better than nothing. by Anonymous Coward · · Score: 2, Informative

      And more importantly, it saves a lot of power. The MMRTG power supply is supposed to last 14 years. However, that's at very low consumption levels

      RTGs do not work that way; they're decaying whether you use the energy or not.

    8. Re:Still a hack, but way better than nothing. by Arkh89 · · Score: 1

      You could also not have to do it at all and use an EDOF system (such as shown in this demo). Its just not a software solution and has to be constructed from the beginning with the lens and the camera (you voluntary insert aberrations that will make the system blurry "the same way" in some larger range, but this blur is easily invertible by a simple image Wiener deconvolution).

    9. Re:Still a hack, but way better than nothing. by slashkitty · · Score: 1

      Nice long explanation of jpg quantization https://www.youtube.com/watch?... I'm assuming they are using jpg

      --
      -- these are only opinions and they might not be mine.
    10. Re:Still a hack, but way better than nothing. by Anonymous Coward · · Score: 0

      RTGs do not work that way; they're decaying whether you use the energy or not.

      Only vaguely true. RTGs decay rate can be controlled by insertion and removal of a moderator in the same fashion as a fission reactor.

  6. "Only" 40 Kilobytes ?! by NotInHere · · Score: 3, Funny

    thats four times LiteOS! Get some Huawei developers work on this, and they'll reduce this patch to 64 bytes.

    1. Re:"Only" 40 Kilobytes ?! by Tablizer · · Score: 4, Funny

      thats four times LiteOS! Get some Huawei developers work on this, and they'll reduce this patch to 64 bytes.

      "64 bytes oughtta be enough for any Martian."
          - Marvin Gates

    2. Re:"Only" 40 Kilobytes ?! by Applehu+Akbar · · Score: 4, Funny

      "Get some Huawei developers work on this, and they'll reduce this patch to 64 bytes."
      And the hardened, high-capacity espionage backdoor channel to the PLA will serve mankind well should a solar flare takes out our primary communications channel with Curiosity.

    3. Re:"Only" 40 Kilobytes ?! by Anonymous Coward · · Score: 0

      China has the worse developers period. 5000 lines subroutines without any comments!!! Yikes

    4. Re:"Only" 40 Kilobytes ?! by Hadlock · · Score: 1

      Yeah I was going to say, I wrote a crude flight simulator, including the display drivers for my Arduino and SSD1306 OLED display, that weighs in at 31KB. A piece of code to focus a laser should be less than that.

      --
      moox. for a new generation.
    5. Re:"Only" 40 Kilobytes ?! by Anonymous Coward · · Score: 0

      Huawei's patch:

      HCF
      .DB "china rulez"

    6. Re:"Only" 40 Kilobytes ?! by itzly · · Score: 1

      It's not clear what exactly the piece of code does. The "instrument" could refer to the ChemCam.

    7. Re:"Only" 40 Kilobytes ?! by Anonymous Coward · · Score: 0

      You can do a lot in 40kB. My first computer only had 64kB - practical programs limited to 38K. Making small programs is easy enough when you don't bother with any kind of "user interfaces", and use a simple language like C. Assembly is not needed to write small code - it is more for weird stuff that even low-level languages don't support.

  7. The program that runs the instrument is only 40 ki by Runaway1956 · · Score: 2

    We need these guys to work on Firefox. Chromium too! Hell, just turn them loose on Windows!

    --
    "Windows is like the faint smell of piss in a subway: it's there, and there's nothing you can do about it." - Charlie Br
  8. Not a fix... by Alwin+Henseler · · Score: 5, Informative

    ..but an improved workaround.

    If I read the article(s) correctly, problem was caused by failure of a small 2nd laser used for range finding. It seems that failure wasn't solved. Permanently out of action? Who knows.

    Workaround was to take several shots at different focus settings, and have home base sort out the data. Improved workaround is to take several shots at different focus settings, have software on-site figure out which are the best, and only send that data back home.

    1. Re:Not a fix... by Anonymous Coward · · Score: 0

      Not exactly correct, the new workaround is to take several shots, use those to determine the correct focus settings, and then take one to send back.

  9. To the editors by Crashmarik · · Score: 4, Interesting

    If you are going to have a story like this it would be good form to remember the H, aka HOW from who,what,when,where, why and HOW of a journalism article. At some point in the past this was a site oriented to the technical community, most of whom are very interested in the how. You might even think that for the most part the when, why, where and who are all at the who cares level. (Mars being an exception)

    1. Re:To the editors by umghhh · · Score: 2

      I do not know this so I am guessing but it may be that the number of people that are so limited (deep Asperger and any such)) as to not care about anything other than 'how' is limited which means that as the /. crowd grew, they became increasingly outnumbered. You may be displeased by this of course but if you are old enough you will understand that this is unavoidable. I dislike all the information foam around subjects too. I still learned how to cope. Filter the necessary stuff yourself it is not that difficult. BTW: In some cases the infofoam carries some vital clues needed to communicate with the rest of humanity. I did not believe that either but painful lessons of the past taught me to change my perspective.

    2. Re:To the editors by Anonymous Coward · · Score: 1

      The summaries are generally written by the submitters. The Slashdot "editors" mostly just select articles and post them to the front page, rarely fixing even the most obvious of spelling errors.

    3. Re:To the editors by Anonymous Coward · · Score: 0

      Slashdot is just a clickbait aggregator.

  10. Huawei? Hope you're joking.. by Anonymous Coward · · Score: 0

    Get some Huawei developers work on this, and they'll reduce this patch to 64 bytes.

    Get some Huawei developers working on this and the thing will fail. We all know Asia's legacy of "quality"
    There would probably be some dodgy malware thrown in for free in a few KB's.

    NASA should definitely not EVER consider contracting Huawei developers or any such developers for that matter.
    Huawei is just a cheap Chinese rip off of Cisco, Motorola and others, like any company that comes out of that part of the world..

  11. Export Controls, Licenses & Money by Anonymous Coward · · Score: 1

    Software for spacecraft is potentially export controlled either under ITAR or EAR, so just throwing it out on github or source-forge isn't likely. It's true that much of what's running on Curiosity probably is NOT subject to export control (or is "dual-use"), but it would be difficult and tedious (read - expensive) to separate out the pieces and get them reviewed for public release. Space missions are always budget constrained, so do you want to collect more science data or get software released?

    As it happens, too, JPL does release a lot of software that feeds into the rover as separate stuff. Check out the NASA Tech Briefs and similar places. People do publish articles in journals and at conferences, and you can contact the author and ask if you can get the software, and they might be able to push it through the release process fairly easily: it's already segregated from the main body of "flight code" (or is in the "before it has been integrated state") both of which make it less likely it is considered "flight code".

    Export controls are half of the "public release" issue: the other is the "IP licensing" aspect.

    One other thing to bear in mind is that although the taxpayer funded the development, it might include non-taxpayer funded pieces, or pieces from the past. That might make it harder to open-source. Because JPL is part of CalTech, technology developed by JPL is subject to the Bayh-Dole act, so Caltech retains the rights, and the government gets what's called a "government purposes" license. So if you were building another widget for the US government, you could get a free license.

    Also practically speaking, Caltech is very liberal with research/non-commercial use licenses: they're free, and the only condition is a "if you make changes, can you send them back to us" kind of clause. Non-exclusive commercial licenses are at fairly low single digit percentage royalties: Caltech would rather the technology get used than sit on the shelf, and having some "skin" in the game ensures that this is so, and pays for the people to review the license application.

  12. Re:The program that runs the instrument is only 40 by Bing+Tsher+E · · Score: 1

    40k is a lot of code, when it's not been written in layers of glop-gloop abstraction.

  13. Re:The program that runs the instrument is only 40 by v1 · · Score: 1

    was just gonna say that... 40kb is quite a lot of assembly, or even C as long as it's not using bloated libraries.

    Does anyone here happen to know if they code the rovers in assembly? or code the patches in assembly?

    --
    I work for the Department of Redundancy Department.
  14. Re:The program that runs the instrument is only 40 by itzly · · Score: 2

    Nobody in their right mind is going to write rover code in assembly. Too much work, and too much chance of a silly mistakes fucking things up, while the actual code saving is not much. It's much easier and cheaper to add some extra memory instead.

  15. and pay some technical debt by Ducho_CWB · · Score: 2

    "Now, they say the new software results in better images in a single shot than even before the laser broke down."

    So it was a good Oportunity to pay some technical debt.

  16. Re:The program that runs the instrument is only 40 by Anonymous Coward · · Score: 0

    for a low level piece of code probably written in a low level language without the need for a crapload of libraries, gui's etc 40k is actually a bloody big program.

  17. Re:The program that runs the instrument is only 40 by Anonymous Coward · · Score: 1

    Nobody in their right mind is going to write rover code in assembly. Too much work, and too much chance of a silly mistakes fucking things up, while the actual code saving is not much. It's much easier and cheaper to add some extra memory instead.

    This guy obviously hasn't had to pay for radhard SEU immune SRAM.

  18. That's one printf! by Etherwalk · · Score: 1

    40 kb? So that's like one call to printf("%s",szMars) ...