osgar package

Submodules

osgar.bus module

Internal bus for communication among modules

class osgar.bus.BusHandler(logger, name='', out={})

Bases: object

is_alive()
listen()
publish(channel, data)
report_error(err)
shutdown()
sleep(secs)
exception osgar.bus.BusShutdownException

Bases: Exception

class osgar.bus.LogBusHandler(log, inputs, outputs)

Bases: object

listen()
publish(channel, data)
sleep(secs)
class osgar.bus.LogBusHandlerInputsOnly(log, inputs)

Bases: object

listen()
publish(channel, data)
sleep(secs)

osgar.logger module

class osgar.logger.LogAsserter(filename)

Bases: osgar.logger.LogReader

write(stream_id, data)
class osgar.logger.LogReader(filename)

Bases: object

close()
read_gen(only_stream_id=None)

packed generator - yields (time, stream, data)

class osgar.logger.LogWriter(prefix='naio', note='')

Bases: object

close()
register(name)
write(stream_id, data)
osgar.logger.lookup_stream_id(filename, stream_name)
osgar.logger.lookup_stream_names(filename)

osgar.replay module

Replay driver modules from log file

osgar.replay.replay(args, application=None)

osgar.ro2018 module

RoboOrienteering 2018 - experiments with osgar.logger and robot container

exception osgar.ro2018.EmergencyStopException

Bases: Exception

class osgar.ro2018.EmergencyStopMonitor(robot)

Bases: object

update(robot)
class osgar.ro2018.RoboOrienteering2018(config, bus)

Bases: object

EMERGENCY_STOP = 1
join()
navigate_to_goal(goal, timeout)
play()
play0()
register(callback)
request_stop()
set_speed(desired_speed, desired_wheel_heading)
start()
unregister(callback)
update()
wait(dt)
osgar.ro2018.geo_angle(pos1, pos2)
osgar.ro2018.geo_length(pos1, pos2)

return distance on sphere for two integer positions in milliseconds

osgar.ro2018.latlon2xy(lat, lon)

osgar.robot module

Robot - container for drivers

class osgar.robot.Robot(config, logger, application=None)

Bases: object

finish()
start()
update()

osgar.test_bus module

class osgar.test_bus.BusHandlerTest(methodName='runTest')

Bases: unittest.case.TestCase

test_alive()
test_bus_sleep()
test_listen()
test_log_bus_handler()
test_log_bus_handler_inputs_onlye()
test_named_publish()
test_publish()
test_publish_serialization()
test_publish_time()
test_report_error()
test_shutdown()
test_two_modules()
test_wrong_publish_channel()

osgar.test_logger module

class osgar.test_logger.LoggerTest(methodName='runTest')

Bases: unittest.case.TestCase

test_context_manager()
test_large_block()
test_log_asserter()
test_lookup_stream_id()
test_read_two_streams()
test_register()
test_writer_prefix()

osgar.test_ro2018 module

class osgar.test_ro2018.RO2018Test(methodName='runTest')

Bases: unittest.case.TestCase

test_emergency_stop_monitor()
test_geo_angle()
test_geo_lenght()
test_latlon2xy()

osgar.test_robot module

class osgar.test_robot.RobotTest(methodName='runTest')

Bases: unittest.case.TestCase

test_all_supported_config_files()
test_application()
test_config()
test_dummy_usage()
test_spider_config()

Module contents