GithubHelp home page GithubHelp logo

Comments (3)

jeking04 avatar jeking04 commented on May 5, 2024

Here was my general line of thinking, which may or may not be correct.

If an action fails for an expected reason, i.e. the planner fails, then we raise an ActionException. Our main script then only catches these ActionExceptions. Inside the exception is the name of the action that failed. this would allow us to easily log what failed in a particular trial.

If there is an unexpected failure, i.e. we mispell a function name, then the exception will just fail through and be spit to the command line. The idea here is that we want catestrophic failure in these cases because its something we need to fix.

Now, we leave it up to the actions themselves to define "expected" vs. "unexpected." For now, mostly expected failures are PlanningErrors. I am also raising ActionExceptions when a data file (i.e. saved trajectory) isn't found. This might be the wrong thing to do, as we probably want a complete failure there.

In general, I think a nice rule of thumb might be that if something fails that could possibly succeed by just running again, then we want to catch the failure and raise an ActionException. Planning failure is often a nice example of this. Basically, the ActionException signals that this trial is busted, but we should be able to just reset and run again and expect some chance of success. If there is a failure that will be persistent, i.e. we can't succeed without making a code change to fix it, then this should just be left to drop through and kill the demo.

The lack of ability to verify that we are catching all possible exceptions seems like a python limitation. But maybe there is something clever we can do. I'll leave those suggestions to the python masters.

from ada_meal_scenario.

siddhss5 avatar siddhss5 commented on May 5, 2024

Thanks, that makes a lot of sense. It'd be nice to start doing that in the demo. Right now we're just failing right?

Also, I imagine an action could raise several ActionExceptions, each of which might require a different intervention. How do we propose to deal with that?

from ada_meal_scenario.

jeking04 avatar jeking04 commented on May 5, 2024

I think we are already doing this in the demo. Here we catch the ActionException, log it and just allow the user to continue to another trial:

https://github.com/personalrobotics/ada_meal_scenario/blob/feature/action_framework/src/runBiteServing.py#L77

I think I am catching all known exceptions and reraising an ActionException. But there could be some places I missed. Let me know if you see anything specific.

As for the different interventions, one idea is to subclass ActionException and raise different exceptions based on the intervention we want. We should come up with some examples of interventions we are interested in to see if we can use this idea or if we need something different.

from ada_meal_scenario.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.