Robo4j framework has received new major update of the core logic and architecture. The small first taste has been already mention in previous blog post as simple sketch. The sketch has pictured the relation between RoboUnits and RobotAgents. In simplified written words the RoboUnit contains the number of agents. Those agents are interacting between each other and providing the result of the RoboUnit according to its assignment.
Let's focused little bit on RoboAgents. RoboAgents behaviour can be simplified as the relation between Producers and Consumers.
The Producers are basically providing result of the external inputs to the Consumers. External Producers inputs can be defined by Sensors or the result of the external computation/process.
On the other-hand Consumers are applying desired logic on such inputs. Consumers are allowed to use bounded resources, which are provided to the RoboUnit.
Current Robo4j framework release contains 1st simple example of RoboUnit implementation by implementing Robo Front-Hand. The front-hand unit is located in the front part of the robot and it's able to carry small things.
The Robo Front-hand consists from one engine and one touch sensor. This is enough to employ Producer Consumer scenario where the sensors provides appropriate data to the consumer which is represented by the engine.
@RoboUnit(value = FrontHandUnit.UNIT_NAME, system = FrontHandUnit.SYSTEM_NAME, producer= FrontHandUnit.PRODUCER_NAME, consumer= FrontHandUnit.CONSUMER_NAME) public class FrontHandUnit extends DefaultUnit implements LegoUnit { /* all connected pars */ private static final int CONNECTED_ELEMENTS = 2; private static final int DEFAULT_SPEED = 300; private static final int AGENT_POSITION = 0; static final String UNIT_NAME = "frontHandUnit"; static final String SYSTEM_NAME = "legoBrick1"; static final String PRODUCER_NAME = "frontHandSensor"; static final String CONSUMER_NAME = "frontHand"; ... @Override public LegoUnit init(... this.agents.add(createAgent( "frontHandAgent", new FrontHandTouchProducer(exchanger, sensorCache.entrySet()
.stream() .filter(sensorEntry -> sensorEntry.getValue()
.getPart().equals(LegoEnginePartEnum.HAND)) .map(Map.Entry::getValue) .map(legoSensor ->
createTouchSensor(legoBrickRemote,
legoSensor.getPort())) .reduce(null, (e1, e2) > e2)), new FrontHandEngineConsumer(exchanger, engineCache.entrySet()
.stream() .filter(entry -> entry.getValue()
.getPart().equals(LegoEnginePartEnum.HAND)) .map(Map.Entry::getValue) .map(legoEngine ->
createEngine(legoBrickRemote,
legoEngine.getPort(), DEFAULT_SPEED)) .reduce(null, (e1, e2) > e2)))); ... @SuppressWarnings(value = "unchecked") @Override public boolean process(RoboUnitCommand command){ if(!active.get()){ return false; } ProcessAgent processAgent = (ProcessAgent) agents.get(AGENT_POSITION); return processAgent.process(command, (cm) -> { final FrontHandCommandEnum commandEnum = (FrontHandCommandEnum)cm; return logic.get(commandEnum).apply(processAgent); }).getStatus().equals(AgentStatusEnum.ACTIVE); } ... @SuppressWarnings(value = "unchecked") @Override protected Map<RoboUnitCommand, Function<ProcessAgent, AgentStatus > > initLogic(){ final Map<RoboUnitCommand, Function<ProcessAgent, AgentStatus > > result = new HashMap< >(); result.put(FrontHandCommandEnum.COMMAND, (ProcessAgent agent) -> { agent.setActive(true); agent.getExecutor().execute((Runnable) agent.getProducer()); final Future<Boolean> engineActive =
agent.getExecutor()
.submit((Callable<Boolean>) agent.getConsumer()); try { agent.setActive(engineActive.get()); } catch (InterruptedException | ConcurrentModificationException
| ExecutionException e) { throw new
FrontHandException("SOMETHING ERROR CYCLE COMMAND= ", e); } return new AgentStatus<String>(AgentStatusEnum.ACTIVE); }); result.put(FrontHandCommandEnum.EXIT, (ProcessAgent agent) -> { FrontHandEngineConsumer consumer = (FrontHandEngineConsumer)
agent.getConsumer(); FrontHandTouchProducer producer = (FrontHandTouchProducer)
agent.getProducer(); try { consumer.getMotorHandPortA().close(); producer.getTouchSensor().close(); } catch (RemoteException e) { throw new FrontHandException("RUN ERROR PROCESS: ", e); } agent.getExecutor().shutdown(); agent.setActive(false); active.set(false); return new AgentStatus<String>(AgentStatusEnum.OFFLINE); }); return Collections.unmodifiableMap(result); } ...
Following code has shown that RoboUnit consist from two agents one Producer and one Consumer. Producer is represented by TouchSensor and Consumer by Engine. The RoboUnit does accept two commands from outside as the input -> COMMAND and EXIT.
The following RoboUnit implementation allows Robo4j-Brick-Client to accept following POST request
{ "commands" : [ {"name" : "hand", "target" : "hand_unit", "value" : "command"} ] }
And this is not all we can add additional properties to the command as following example
{ "commands" : [ {"name" : "hand", "target" : "hand_unit", "value" : "command"}, {"name" : "move", "target" : "platform", "value" : "20", "speed" : "400" } ] }
...but more in the upcoming posts...
Stay tuned!!!
Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.
ReplyDeleteselenium training in chennai|
The young boys ended up stimulated to read through them and now have unquestionably been having fun with these things.."Devops Training in Chennai"
ReplyDeleteExisting without the answers to the difficulties you’ve sorted out through this guide is a critical case, as well as the kind which could have badly affected my entire career if I had not discovered your website.
ReplyDeletefull stack developer training in bangalore
It has been simply incredibly generous with you to provide openly what exactly many individuals would’ve marketed for an eBook to end up making some cash for their end, primarily given that you could have tried it in the event you wanted
ReplyDeletedigital marketing training in tambaram
Thank you for taking the time and sharing this information with us. It was indeed very helpful and insightful while being straight forward and to the point.
ReplyDeleteClick here:
python training in chennai
Click here:
python training in chennai
Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us and I never get bored while reading your article because, they are becomes a more and more interesting from the starting lines until the end.
ReplyDeleteData Science Training in Chennai
Data science training in bangalore
Data science online training
Data science training in pune
Thanks Admin for sharing such a useful post, I hope it’s useful to many individuals for developing their skill to get good career.
ReplyDeletejava online training | java training in pune
java training in chennai | java training in bangalore
I found this informative and interesting blog so i think so its very useful and knowledge able.I would like to thank you for the efforts you have made in writing this article.
ReplyDeleteMicrosoft Azure online training
Selenium online training
Java online training
Java Script online training
Share Point online training
Well somehow I got to read lots of articles on your blog. It’s amazing how interesting it is for me to visit you very often.
ReplyDeleteDevops Training in Chennai | Devops Training Institute in Chennai
This is a nice post in an interesting line of content.Thanks for sharing this article, great way of bring this topic to discussion.
ReplyDeletedevops online training
aws online training
data science with python online training
data science online training
rpa online training
Attend The Python training in bangalore From ExcelR. Practical Python training in bangalore Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Python training in bangalore.
ReplyDeletepython training in bangalore
Good to become visiting your weblog again, it has been months for me. Nicely this article that i've been waited for so long. I will need this post to total my assignment in the college, and it has exact same topic together with your write-up. Thanks, good share.
ReplyDeletepmp certification malaysia
This comment has been removed by the author.
ReplyDeleteI learned World's Trending Technology from certified experts for free of cost. I Got a job in decent Top MNC Company with handsome 14 LPA salary, I have learned the World's Trending Technology from Python Training in pune experts who know advanced concepts which can help to solve any type of Real-time issues in the field of Python. Really worth trying Freelance seo expert in bangalore
ReplyDeletekeep sharing to gain knowledge
ReplyDeleteinterview-questions/aptitude/permutation-and-combination/how-many-groups-of-6-persons-can-be-formed
tutorials/oracle/oracle-delete
technology/chrome-flags-complete-guide-enhance-browsing-experience/
interview-questions/aptitude/time-and-work/a-alone-can-do-1-4-of-the-work-in-2-days
interview-questions/programming/recursion-and-iteration/integer-a-40-b-35-c-20-d-10-comment-about-the-output-of-the-following-two-statements
Thank you so much for this useful article. Visit OGEN Infosystem for Web Designing and SEO Services in Delhi, India.
ReplyDeleteSEO Service in Delhi
Great post! I am actually getting ready to across this information, is very helpful my friend. Also great blog here with all of the valuable information you have. Keep up the good work you are doing here.
ReplyDeleteAdvertising Agency
3d Animation Services
Branding services
Web Design Services in Chennai
Advertising Company in Chennai
ReplyDeleteThanks for sharing,very impressive content.If u are looking for any courses visit our site
big data training institute in btm
Wow!!! It was really an Informational Article which provide me with much Insightful Information. I would like to first thank the author for such an Insightful Content. If someone here is looking for a Website Designing Company in India, then look no further than Jeewangarg.com as we are the Best website designing company in Delhi working in the arena for the last 8 years.
ReplyDeleteDigital Marketing company in Delhi
Thanks for posting such a great post. mostly person have many doubt that the product which is puchaging through online is really right for us! is this better product? That's why right select is standing infront of you to provide right products. Right Select help to select right products.
ReplyDeleteOut of them: Top 10 injection molding machine manufacturers in india
Hi...Thanks for sharing this useful article. RPA is the most trending now a days in Machine Learning and Artificial Intelligence. Your shared information is very useful for those who wants to shifts their business logic to robotics.Its a new upcoming technology so this information will play such a great role. And its very important to improve our knowledge for Robotics and their Architect, frameworks and logics.
ReplyDelete
ReplyDeleteI think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article.
Patient care home service in Dhaka
Oxygen Cylinder home service in dhaka
Oxygen Cylinder sell and rent
Nursing Home Services
day night Home care
medical equipment rent and sell in Dhaka
Orthopedic Care in Dhaka
NEUROLOGICAL CARE in Dhaka
NEUROLOGICAL CARE in Dhaka
POST SURGERY CARE in Dhaka
PALLIATIVE CARE in Dhaka
CANCER PATIENT CARE in Dhaka
caregiver service in dhaka
nurse service at home in dhaka
ambulance service in dhaka
emergency medical oxygen home service in dhaka
Dextrous Info Solutions is worldwide and Android App Development Company giving various end-to-end app development solutions at affordable pricing structure. putlocker
ReplyDeleteThis is a wonderful article. I really enjoyed reading this article. Thanks for sharing such detailed information. share somemore info
ReplyDeleteAi & Artificial Intelligence Course in Chennai
PHP Training in Chennai
Ethical Hacking Course in Chennai Blue Prism Training in Chennai
UiPath Training in Chennai
I have study your article, it is very informative and beneficial for me. I recognize the valuable statistics you offer in your articles. Thanks for posting it and is.
ReplyDeleteVisit us for custom cake packaging boxes.
ReplyDeleteThank you very much for your information. I have gained great information from your post.
This site is a very good site. I am sure that you will benefit from this web site.
Whatever you are looking for can be helpful. Click Here
Thank you very much for your information.I stumbled upon your top nursing blog sites page. I have gained great information from your post.
This site is a very good site. I am sure that you will benefit from this web site.
Whatever you are looking for can be helpful. Click Here
Really nice and interesting post. I was looking for this kind of information and enjoyed reading this one. Keep posting. Thanks for sharing.
ReplyDeletedigital marketing course in guduvanchery
Worth reading! Our experts also have given detailed inputs about these trainings & courses! Presenting here for your reference. Do checkout
ReplyDeleteoracle training in chennai & enjoy learning more about it.
Nice. I am really impressed with your writing talents and also with the layout on your weblog. Appreciate, Is this a paid subject matter or did you customize it yourself? Either way keep up the nice quality writing, it is rare to peer a nice weblog like this one nowadays. Thank you, check also event management and event vendor agreement template
ReplyDeleteGood information you shared. keep posting.
ReplyDeleteBest Artificial Intelligence course with placements
Extraordinary blog. I took pleasure in scrutinizing your articles. This is extremely a wonderful scrutinized for me. I have bookmarked it and I am suspecting scrutinizing new articles. Continue doing amazing!
ReplyDeletemuttertag lustige bilder
This is very interesting, You are a very skilled blogger. I've joined your feed and look ahead to searching for extra of your excellent post. Also, I have shared your website in my social network new years 2021
ReplyDeletel shaped gaming desk
NehaaGallerina Shop
It’аs really a great and helpful piece of info. adipurush film
ReplyDeleteI’аm happy that you simply shared this helpful info with us. sarkaru vaari paata download
Please keep us informed like this. Thanks for sharing. salaar film
I do not even know how I ended up here, hari hara veera mallu download
ReplyDeletebut I thought this post was great. central government schemes
I don't know who you are but definitely you are going to a famous blogger if you are not already telugu box office
I am really very happy to visit your blog. apsrtc bus pass
ReplyDeleteNow I am found which I actually want. pongal
I check your blog every day and try to learn something from your blog. andhra pradesh food
Thank you and waiting for your new post. government jobs online
that list of thousands but I'll get there.
ReplyDeleteBig Hunter Mod Apk
Great post! Thanks for sharing. I like your content its unique and interesting, I have been always a fan of those who have this unique talent of writing unique content
ReplyDeletedigital marketing agency pakistan
digitechtricks
ReplyDeleteCar Transportation, Pet Relocation,
Small and large companies worldwide can benefit from the Design Trip's branding services. Our branding team will contact you, as soon as possible, following completion of the form or visiting our website, to discuss your branding requirements.
ReplyDeleteBranding Services
Digital Marketing Services
Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.Kinemaster Gold
ReplyDeleteI'm glad I found this web site, alles gute im neuen jahr I couldn't find any knowledge on this matter prior to.Also operate a site reveillon de noel and if you are ever interested in doing some visitor writing for me feliz natal a todos if possible feel free to let me know, im always look for people to check out my web site.buon fine anno
ReplyDeleteTo success in today's competitive world, one need to grip the good digital marketing skills but as it is said not everybody can perfect every skill and hence I bring to you the best Digital Marketing Agency who provide services.
ReplyDeleteThanks for the information about Blogspot very informative for everyone
ReplyDeletedata analytics course in aurangabad
"If you are also one of them and want to know what the companies demand from the data scientists to do in their organization, you have come to the right place.data science course in kolkata"
ReplyDeleteThis is an excellent article. Oracle Fusion Financials Online Training
ReplyDeleteReally innovative as well as impressive
ReplyDeletebank ruptcy lawyers near me
abogado de bancarrota cerca de mí
virginia bankruptcy means test
I enjoyed reading about the latest trends and advancements in data science discussed in this post. . best data science training institute in Chennai
ReplyDeleteYour writing not only informs but also sparks curiosity. Thank you for cultivating a sense of wonder and interest among your readers.
ReplyDeleteMarble Flooring in Muweillah
I honestly didn’t think I’d ever get this topic, but this explanation really made it click. Kudos to the writer for making it all make sense! Visit our link for ISO Certification in Saudi Arabia
ReplyDeleteThe appeal of investing in Indian property for NRIs is underscored by the country's dynamic real estate market, which presents a range of options from luxury apartments to plots of land and commercial spaces. Various factors contribute to this trend, including favorable exchange rates, a booming rental market, and the potential for long-term capital appreciation.
ReplyDeleteMoreover, NRIs are often encouraged to research local market conditions, engage with reputable real estate agents, and consider factors such as location, infrastructure development, and neighborhood amenities to make informed investment decisions. By aligning their property investments with personal goals and market trends, NRIs can maximize their returns while fostering their ties to India.