BCLab-UNM / SC2

Swarmathon Team Code for the NASA Space Challenge 2 Competition
MIT License
2 stars 0 forks source link

Working search #42

Closed Carter90 closed 4 years ago

Carter90 commented 4 years ago

clean, build, run sim, source

roslaunch ./launch/scoot.launch "name:=scout_1" "name_tf:=scout_1_tf"
rosrun scoot repl.py
    scout.searchRandomWalk.main(scoot)
    scoot.drive(2,ignore=Obstacles.IS_VOLATILE|Obstacles.IS_LIDAR) #to get away from the volatile if found
    #Lather, rinse, repeat

Expected output when running searchRandomWalk

Search Node Started
[INFO] [#, #]: Wandering...
I saw an obstacle!
[INFO] [#,#]: Wandering...
I found a volatile! ice
An exception has occurred, use %tb to see the full traceback.

SystemExit: 0

Task would have code that would suppress the systemexit exception

    def launch(self, prog):
        try:
            rval = prog(has_block=self.has_block)
            if rval is None:
                rval = 0
        except SystemExit as e:
            rval = e.code
        return rval