{"id":38592508,"url":"https://github.com/martinhej/robocloud","last_synced_at":"2026-01-17T08:25:16.469Z","repository":{"id":62524513,"uuid":"126492348","full_name":"martinhej/robocloud","owner":"martinhej","description":"robocloud - the space where robots chatter","archived":false,"fork":false,"pushed_at":"2018-07-30T15:22:13.000Z","size":139,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-18T21:51:57.600Z","etag":null,"topics":["aws","cloud","iot","kinesis","microservices","php","robocloud","robot","robotics"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/martinhej.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-23T13:55:48.000Z","updated_at":"2018-07-30T15:22:14.000Z","dependencies_parsed_at":"2022-11-02T14:46:29.091Z","dependency_job_id":null,"html_url":"https://github.com/martinhej/robocloud","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/martinhej/robocloud","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinhej%2Frobocloud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinhej%2Frobocloud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinhej%2Frobocloud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinhej%2Frobocloud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/martinhej","download_url":"https://codeload.github.com/martinhej/robocloud/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinhej%2Frobocloud/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28504364,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T06:57:29.758Z","status":"ssl_error","status_checked_at":"2026-01-17T06:56:03.931Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","cloud","iot","kinesis","microservices","php","robocloud","robot","robotics"],"created_at":"2026-01-17T08:25:16.375Z","updated_at":"2026-01-17T08:25:16.450Z","avatar_url":"https://github.com/martinhej.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# robocloud - the space where robots chatter\n\n## warning\nNote that this code is highly experimental and is expected to change\nin near future breaking the backwards compatibility.\n\nAs well as the concepts of robocloud and robotalk are experimental\nbeing far from complete.\n\nDespite of that it is already usable for simple things like maze \nsolving robots cooperation or targeting single or more robots with\na specific set of instructions to be executed. So do not hesitate \nto use it for your experimental robotic fun projects!!! :)\n\nThe functionality is built on top of the AWS Kinesis stream service: \nhttps://aws.amazon.com/kinesis/. In case you are not familiar with Kinesis\nfirst learn more about it. Yes, the plan is to decouple robocloud from\nKinesis in future. But as mentioned, currently the project is highly\nexperimental, being in the process of prototyping. \n\n## The high overview\nThe idea is to provide an infrastructure where two or more systems may\ncommunicate in all directions so that they can not only exchange\ndata but also problem solving instruction sets to also enable mutual \nlearning.\n\n### Robotalk\nRobotalk would be the \"language\" used to perform such communication.\n\n#### Messages and schemas\nEach message is defined by two schema files. The first one being the \ngeneral message schema that defines basic message structure that is\ncommon for all messages. The second one defines the \"data\" property\nstructure that varies based on the message \"purpose\".\n\nCurrently the message schemas library is part of this project under\nthe \"schema\" directory. Note that the message \"purpose\" property \ndefines the directory structure where the actual schema file resides.\n\n\n### Robocloud\nRobocloud would be the platform that technically enables the use of\nRobotalk.\n\n#### Provided functionality\nRobocloud provides functionality to push and read specific messages\nfrom a AWS Kinesis stream. It follows the concept of Kinesis message \nProducer and Consumer. It does most of the heavy lifting to utilize \nKinesis streams adding the possibility to validate messages and \nprocess messages when being consumed from a stream.\n\n#### Producer example\n\n```php\n\nuse robocloud\\Event\\KinesisProducerErrorConsoleLogger;\nuse robocloud\\Kinesis\\Client\\Producer;\nuse robocloud\\KinesisClientFactory;\nuse robocloud\\Message\\Message;\nuse robocloud\\Message\\MessageFactory;\nuse robocloud\\Message\\MessageSchemaValidator;\nuse Symfony\\Component\\Cache\\Simple\\FilesystemCache;\nuse Symfony\\Component\\EventDispatcher\\EventDispatcher;\n\n// Define the Kinesis stream name.\n$stream_name = 'robocloud';\n\n// Get an event dispatcher instance.\n$event_dispatcher = new EventDispatcher();\n\n// Add message schema validator.\n$event_dispatcher-\u003eaddSubscriber(new MessageSchemaValidator('schema/stream/robocloud/message'));\n\n// Add error processors. A few simple ones that passivly log errors\n// are available in robocloud/Event. To provide more robust error\n// processing like requeuing failed messages you need to provide\n// your own.\n$event_dispatcher-\u003eaddSubscriber(new KinesisProducerErrorConsoleLogger());\n\n// Now get the message facory that will create and validate messages\n// for you.\n$message_factory = new MessageFactory(Message::class, $event_dispatcher);\n\n// Use the message factory to set the message data.\n$message_factory-\u003esetMessageData([\n    'version' =\u003e 'v_0_1',\n    'roboId' =\u003e 'lost',\n    'purpose' =\u003e 'buddy.find',\n    'data' =\u003e [\n        'reason' =\u003e 'line_follower.line.lost',\n    ],\n]);\n\n// Create the actual message that will be sent to Kinesis.\n// This will throw exception if message data validation\n// fails or if schema files could not be found.\n$message = $message_factory-\u003ecreateMessage();\n\n// Create instance of the Kinesis client factory.\n$kinesis_factory = new KinesisClientFactory('2013-12-02', 'eu-west-1');\n\n// Provide cache that will be used to cache shard info.\n$cache = new FilesystemCache();\n\n// Create the Producer instance.\n$producer = new Producer(\n    $kinesis_factory-\u003egetKinesisClient('AKIAJG2QTSBDKBFNACDA', 'Pg2c2AzMfY/5koj6b0IO3GgOvgF/m5nUDayjBOh/'),\n    $stream_name,\n    $message_factory,\n    $event_dispatcher,\n    $cache\n);\n\n// Add the message and push it to the stream.\n$producer-\u003eadd($message);\nvar_dump(array_map(function($result) {\n    return (string) $result;\n}, $producer-\u003epushAll()));\n\n```\n\n#### Consumer example\n\n```php\n\n// Define the Kinesis stream name.\nuse robocloud\\Event\\KinesisConsumerErrorConsoleLogger;\nuse robocloud\\Kinesis\\Client\\Consumer;\nuse robocloud\\Kinesis\\Client\\ConsumerRecovery;\nuse robocloud\\KinesisClientFactory;\nuse robocloud\\Message\\Message;\nuse robocloud\\Message\\MessageFactory;\nuse robocloud\\Message\\MessageSchemaValidator;\nuse robocloud\\MessageProcessing\\Backend\\KeepInMemoryBackend;\nuse robocloud\\MessageProcessing\\Filter\\KeepAllFilter;\nuse robocloud\\MessageProcessing\\Processor\\DefaultProcessor;\nuse robocloud\\MessageProcessing\\Transformer\\KeepOriginalTransformer;\nuse Symfony\\Component\\Cache\\Simple\\FilesystemCache;\nuse Symfony\\Component\\EventDispatcher\\EventDispatcher;\n\n// Define the Kinesis stream name.\n$stream_name = 'robocloud';\n\n// Create event dispatcher instance.\n$event_dispatcher = new EventDispatcher();\n\n// Add message schema validator.\n$event_dispatcher-\u003eaddSubscriber(new MessageSchemaValidator('schema/stream/robocloud/message'));\n\n// Add error handler(s).\n$event_dispatcher-\u003eaddSubscriber(new KinesisConsumerErrorConsoleLogger());\n\n// Create filter instance that will be used to filter out only those messages\n// that you are interested in.\n$filter = new KeepAllFilter();\n// The transformer layer is responsible for extracting and processing the\n// message data into a form that is expected by your backend.\n$keep_original_transformer = new KeepOriginalTransformer();\n// Finally provide your backend that will finish the message processing.\n$keep_in_memory_backend = new KeepInMemoryBackend();\n\n// Add the message processor as the subscriber that will be used\n// during consuming to process the messages.\n$event_dispatcher-\u003eaddSubscriber(new DefaultProcessor($filter, $keep_original_transformer, $keep_in_memory_backend));\n\n// Get the message factory that will be used for creating the message objects\n// from the data pulled from Kinesis.\n$message_factory = new MessageFactory(Message::class, $event_dispatcher);\n\n// Create instance of the Kinesis client factory.\n$kinesis_factory = new KinesisClientFactory('2013-12-02', 'eu-west-1');\n\n// Provide cache that will be used to cache shard info.\n$cache = new FilesystemCache();\n\n// Provide the recovery object used to store last read position.\n$consumer_recovery = new ConsumerRecovery($stream_name, 'Shard-000001', '/tmp/consumer_recovery.rec');\n\n// Instantiate the consumer and consume messages from Kinesis stream.\n$consumer = new Consumer(\n    $kinesis_factory-\u003egetKinesisClient('AKIAINK5P33X2KBK2RAQ', 'EuUdvE7WW0SKaEpGWMWHvN5M+gIjGaoLAVTYzzhV'),\n    $message_factory,\n    $event_dispatcher,\n    $cache,\n    $consumer_recovery\n);\n\n// One process\n$consumer-\u003econsume(0);\n\n// Print the messages to see what we pulled from the stream.\nvar_dump($keep_in_memory_backend-\u003eflush());\n\n// Note that this example is very trivial not providing any real functionality.\n// To get better idea on how to use message processor see other filter,\n// transformer and backend classes in the MessageProcessing namespace.\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartinhej%2Frobocloud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmartinhej%2Frobocloud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartinhej%2Frobocloud/lists"}