osgar.drivers package

Submodules

osgar.drivers.canserial module

Wrapper for CAN-serial communication and control of CAN bridge

class osgar.drivers.canserial.CANSerial(config, bus)

Bases: threading.Thread

check_and_restart_module(module_id, status)
process_gen(data)
process_packet(packet)
read_packet()
request_stop()
reset_all_modules()

Reset all modules: - broadcast “reset node” - make sure every node reaches pre-operational state - switch all nodes to operational state

return: list of operational modules

run()

Method representing the thread’s activity.

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.

send_data(module_id, data)
static split_buffer(data)
osgar.drivers.canserial.CAN_packet(msg_id, data)
osgar.drivers.canserial.get_node_id(msg_id)
osgar.drivers.canserial.is_nmt_message(msg_id)
osgar.drivers.canserial.parse_header(data)
osgar.drivers.canserial.print_packet(data, dbc={})

osgar.drivers.eduro module

Driver for robot Eduro

class osgar.drivers.eduro.Eduro(config, bus)

Bases: threading.Thread

check_restarted_modules(module_id, status)
process_gen(data, verbose=False)
process_packet(packet, verbose=False)
request_stop()
run()

Method representing the thread’s activity.

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.

send_leds(blue, red)
send_speed()
send_speed_ref()
update_buttons(data)
update_emergency_stop(data)
update_encoders(msg_id, data)
update_pose()
osgar.drivers.eduro.sint32_diff(a, b)

osgar.drivers.gps module

GPS Driver

class osgar.drivers.gps.GPS(config, bus)

Bases: threading.Thread

process_gen(data)
process_packet(line)
request_stop()
run()

Method representing the thread’s activity.

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.

osgar.drivers.gps.checksum(s)
osgar.drivers.gps.parse_bin(data)
osgar.drivers.gps.parse_line(line)
osgar.drivers.gps.print_output(packet)
osgar.drivers.gps.split_buffer(data)
osgar.drivers.gps.str2ms(s)

convert DDMM.MMMMMM string to arc milliseconds(int)

osgar.drivers.imu module

Simple IMU data analysis

class osgar.drivers.imu.IMU(config, bus)

Bases: threading.Thread

process_gen(data)
process_packet(line)
request_stop()
run()

Method representing the thread’s activity.

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.

static split_buffer(data)
osgar.drivers.imu.parse_line(line)

osgar.drivers.logserial module

Wrapper & timestamper of input serial byte stream

class osgar.drivers.logserial.LogSerial(config, bus)

Bases: object

join(timeout=None)
request_stop()
run_input()
run_output()
start()

osgar.drivers.logsocket module

Wrapper & timestamper of input/out over socket

class osgar.drivers.logsocket.LogHTTP(config, bus)

Bases: object

join(timeout=None)
request_stop()
run_input()
start()
class osgar.drivers.logsocket.LogSocket(socket, config, bus)

Bases: object

join(timeout=None)
request_stop()
run_input()
run_output()
start()
class osgar.drivers.logsocket.LogTCP(config, bus)

Bases: osgar.drivers.logsocket.LogSocket

class osgar.drivers.logsocket.LogUDP(config, bus)

Bases: osgar.drivers.logsocket.LogSocket

osgar.drivers.sicklidar module

SICK Tim571 LIDAR Driver

class osgar.drivers.sicklidar.SICKLidar(config, bus)

Bases: threading.Thread

static parse_raw_data(raw_data)
process_gen(data)
process_packet(packet)
request_stop()
run()

Method representing the thread’s activity.

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.

split_buffer(data)

osgar.drivers.simulator module

Simple Spider Simulator

class osgar.drivers.simulator.SpiderSimulator(config, bus)

Bases: threading.Thread

get_position()

combine pose with ref GPS position

get_wheels_angles_raw()
request_stop()
run()

Method representing the thread’s activity.

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.

step(dt)

osgar.drivers.spider module

Spider3 Rider Driver

osgar.drivers.spider.CAN_packet(msg_id, data)
class osgar.drivers.spider.Spider(config, bus)

Bases: threading.Thread

static fix_range(value)

into <-256, +256) interval

process_gen(data, verbose=False)
process_packet(packet, verbose=False)
request_stop()
run()

Method representing the thread’s activity.

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.

send(data)
static split_buffer(data)

osgar.drivers.test_canserial module

class osgar.drivers.test_canserial.CANSerialTest(methodName='runTest')

Bases: unittest.case.TestCase

test_can_bridge_initialization()
test_can_packet()
test_invalid_config()
test_reset_module()
test_split_buffer()

osgar.drivers.test_eduro module

class osgar.drivers.test_eduro.EduroTest(methodName='runTest')

Bases: unittest.case.TestCase

test_buttons()
test_encoders_overflow()
test_sint32_diff()
test_sync()

osgar.drivers.test_gps module

class osgar.drivers.test_gps.GPSTest(methodName='runTest')

Bases: unittest.case.TestCase

test_checksum()
test_invalid_coordinates()
test_parse_line()
test_parse_position_velocity_time_solution()
test_parse_rel_position()
test_parse_velocity_and_heading()
test_parsing_old_GPGGA()
test_split()
test_split_with_binary_data()
test_str2ms()

osgar.drivers.test_imu module

class osgar.drivers.test_imu.IMUTest(methodName='runTest')

Bases: unittest.case.TestCase

nmea_line = b'$VNYMR,-095.878,+008.933,-009.419,+00.1785,+00.1474,+00.5479,+00.252,-03.706,-03.874,-01.012502,-00.234810,+00.247165*66'
test_parse_line()
test_processing()
test_start_stop()

osgar.drivers.test_logserial module

class osgar.drivers.test_logserial.LogSerialTest(methodName='runTest')

Bases: unittest.case.TestCase

test_config_reset()
test_timeout_config()
test_twoway_communication()

osgar.drivers.test_logsocket module

class osgar.drivers.test_logsocket.LogSocketTest(methodName='runTest')

Bases: unittest.case.TestCase

test_tcp_send()
test_udp_send()

osgar.drivers.test_sicklidar module

class osgar.drivers.test_sicklidar.SICKLidarTest(methodName='runTest')

Bases: unittest.case.TestCase

test_parse_raw_data()
test_sleep()
test_start_stop()

osgar.drivers.test_simulator module

class osgar.drivers.test_simulator.SpiderSimulatorTest(methodName='runTest')

Bases: unittest.case.TestCase

test_get_position()
test_get_wheels_angles_raw()
test_usage()

osgar.drivers.test_spider module

class osgar.drivers.test_spider.SpiderTest(methodName='runTest')

Bases: unittest.case.TestCase

test_can_packet()
test_publish_status()
test_split_buffer()
test_uninitialized_can_bridge()

Module contents