cortex.parsers package

Submodules

cortex.parsers.color_image_parser module

cortex.parsers.color_image_parser.color_image_parser_callback(channel, method, properties, body)

a callback for the parsing feelings function. PROJECT: this allows decoupiling between MQ and actual parsing function

cortex.parsers.color_image_parser.color_image_parser_main(mq_url)

cortex.parsers.depth_image_parser module

cortex.parsers.depth_image_parser.depth_image_parser_callback(channel, method, properties, body)

a callback for the parsing feelings function. PROJECT: this allows decoupiling between MQ and actual parsing function

cortex.parsers.depth_image_parser.depth_image_parser_main(mq_url)

cortex.parsers.feelings_parser module

cortex.parsers.feelings_parser.feelings_parser_callback(channel, method, properties, body)

a rabbitMQ callback function

cortex.parsers.feelings_parser.feelings_parser_main(mq_url)

cortex.parsers.parsers_main module

cortex.parsers.parsers_main.subscribe(parser_name)

this functions allows parsers to enroll in an AVAILABLE_PARSERS set which is then used by the server, to publish back to clients indicating which parsing functionalities are available for us. exactly those which are implemented.

cortex.parsers.pose_parser module

cortex.parsers.pose_parser.pose_parser_callback(channel, method, properties, body)

a callback for the parsing pose function. PROJECT: this allows decoupiling between MQ and actual parsing function

cortex.parsers.pose_parser.pose_parser_main(mq_url)

Module contents

cortex.parsers.run_parser(parser_name, data)

this should return the result of the parsing on the data HOW TO ADD PARSER: In order to add a new parser, a number of functions/modules have to be implemented. for example smell_parser: 1: you have to create a new module with the parser’s name inside parsers directory. example: smell_parser.py 2: you have to implemente a parsing function, that does the processing of smell, noteably they’re called “fucking” function: example: parse_that_fucking_smell 3: the function above should be decorated with a subscribe(‘smell’) decorator, to add it to the list of the server’s parsers that he receives from clients 3.25: you should implement the relevant MQ (RabbitMQ in our case) callback function, in order to decouple it from the parsing function itself. 3.5: you should implement a main function inside your module, to process MQ information and decouple the processing function from it. 4: in order to expose your module to the rest of the program, you must import it in the __init__.py of parsers package 5: (optoinal) to suppprt usage of parser in the run_parser function, you must add an if-clause with the parser’s

name, simiilar to how other parsers are done.