Embedded Poster

Uploaded from authorPOINT Lite
Download as
 PPT
Presentation Description 

No description available

Views: 67
Like it  ( Likes) Dislike it  ( Dislikes)
Added: January 07, 2008 This Presentation is Public 
Presentation Category : Education All Rights Reserved
Tags Add Tags
Presentation Statistics
Views on authorSTREAM: 64 | Views from Embeds: 3
Others - 3 views
Presentation Transcript

Slide1: A FRAMEWORK for EMBODIED AGENTS A FRAMEWORK for EMBODIED AGENTS TICK AGENT using System; using System.Xml; using BrainMap; namespace AgentTest { public class Beat : AgentMessage { public long tick = DateTime.Now.Ticks; } [OutputMessage(typeof(Beat)), Friend(NetworkAgent.Wifi.AgentName)] public class FuffaAgent : AgentBase { public const string AgentName = "FuffaAgent"; public FuffaAgent() : base(AgentName) {} protected override void Run() { while (true) { SendState(new Beat()); System.Threading.Thread.Sleep(1000); }} static void Main(string[] args) { AgentBroker.Start(); }}} NET SCAN public class BK1Body : BodyMap { private netTest form; private int central, left, right; private double lastx, lasty; public BK1Body(netTest t) { form = t; central = left = right = 0; } private void SetSpeed() { XmlDocument d = null; XmlNode n = null; int lsp = (int)Math.Floor((1 - Math.Max(central, Math.Max(left, right)/4) / 100.0) * 30); int asp = (int)Math.Floor((Math.Max(central, Math.Max(left, right)) / 100.0) * 30); form.lspeed.PowerLevel = lsp; form.aspeed.PowerLevel = asp; d = (XmlDocument)AgentsW["MoveAgent"]; n = d.SelectSingleNode("/*/InputMessages/anyType[@*='SetSpeed']").CloneNode(true); n.SelectSingleNode("/speedr").InnerText = asp.ToString(); n.SelectSingleNode("/speedd").InnerText = lsp.ToString(); SendState(n); } protected override void OnSignal(System.Xml.XmlDocument doc) { if (!AgentsW.ContainsKey("MoveAgent")) // Wait for the interface return; XmlDocument d = null; XmlNode n = null; if (doc.SelectSingleNode("/NetworkInfo") != null) { XmlNode r = doc.CreateNode(XmlNodeType.Element, "Position", null); XmlNode v = doc.CreateNode(XmlNodeType.Element, "X", null); v.InnerText = lastx.ToString(); r.AppendChild(v); v = doc.CreateNode(XmlNodeType.Element, "Y", null); v.InnerText = lasty.ToString(); r.AppendChild(v); doc.ChildNodes[1].AppendChild(r); } else if (doc.SelectSingleNode("/Sensor") != null) { central = (int)double.Parse(doc.SelectSingleNode("/*/Sensor2").InnerText); left = (int)double.Parse(doc.SelectSingleNode("/*/Sensor3").InnerText); right = (int)double.Parse(doc.SelectSingleNode("/*/Sensor1").InnerText); form.center.PowerLevel = central; form.left.PowerLevel = left; form.right.PowerLevel = right; } else if (doc.SelectSingleNode("/MotorState") != null && double.Parse(doc.SelectSingleNode("/MotorState/angularspeed").InnerText) == 0) { lastx = double.Parse(doc.SelectSingleNode("/MotorState/pos/x").InnerText); lasty = double.Parse(doc.SelectSingleNode("/MotorState/pos/y").InnerText); if (central > 60) { d = (XmlDocument)AgentsW["MoveAgent"]; n = d.SelectSingleNode("/*/InputMessages/anyType[@*='Move']").CloneNode(true); n.SelectSingleNode("/amount").InnerText = ((left > right) ? -120.0 : 120.0).ToString(); n.SelectSingleNode("/rotate").InnerText = "true"; SendState(n); } else if(Math.Max(left, right) > 60 && Math.Abs(left-right)>30) { int delta = left-right; d = (XmlDocument)AgentsW["MoveAgent"]; n = d.SelectSingleNode("/*/InputMessages/anyType[@*='Move']").CloneNode(true); n.SelectSingleNode("/amount").InnerText = (delta/5.0).ToString(); n.SelectSingleNode("/rotate").InnerText = "true"; SendState(n); } else if (double.Parse(doc.SelectSingleNode("/MotorState/angularspeed").InnerText) < 1 && double.Parse(doc.SelectSingleNode("/MotorState/linearspeed").InnerText) == 0) { SetSpeed(); d = (XmlDocument)AgentsW["MoveAgent"]; n = d.SelectSingleNode("/*/InputMessages/anyType[@*='Move']").CloneNode(true); n.SelectSingleNode("/amount").InnerText = "10000"; n.SelectSingleNode("/rotate").InnerText = "false"; SendState(n); }}}}} ...Embodiment is linked to a concept of a body and is not necessary given when running a control program on a robot hardware... ...Embodiment should always be seen as a characteristic of an individual and socially embedded cognitive system... Body is first class in Human Architecture Embodiment mimics the human morphology by introducing the notion of Body as an object of the system. The body plays the role of defining a boundary between INSIDE and OUTSIDE. Moreover it abstracts the complexity and the large amount of data acquired by the five senses. Body, Emotions, and Reasoning Neurophysiologists believe that emotions play a significant role in the human reasoning. As remarkably discussed in “Descartes’ Error”, emotions and the sense of self is based on the continuous projection of the body’s state on the sensorial cortex. The body is a lens of the mind over the world and it seems worth representing as a well defined entity in robotics software Why R2D2? R2D2 is a project combining several interests in a single “research platform”. The main interest is in writing the software controlling a robot that shares the “human-space”: being human sized people perceives it as an entity sharing the same metric space, making easier the interaction. It is also an example of a PC with wheels: what is the computer starts to follow us? Representing the body of a simple robot is difficult: the structure isn’t complex enough to be meaningful in the definition of a software architecture representing the body. The Mind, The Body and The Environment To the mind the body is the environment, and the mind has full knowledge about it. We developed a software architecture (and framework) with the same structure. The framework has been implemented in .NET, and has been design to be independent from the particular robot. The framework provides support to build a software representation of the body of a robot. The state of the body is mapped on a particular structure called the Body Map. All the modules (hardware and software) forming the body write their state on this map and read from it the actions they understand. The Body Map is an XML tree containing symbolic information. We use customizable reflection and serialization to automatically provide the communication infrastructure. The Software We developed several agents to support different architectures. We have a set of agents to control ER1 kit from Evolution Robotics (and R2D2 of course). There are agents responsible to control the state of: Network (WiFi), Camera, Audio, Battery state, and System counters. All the software is written in .NET (with some PInvoke). We are currently using [a]C#, an extention to C# that allow to use custom attributes inside the Method bodies. The People Several people have made R2D2 possible: Medialab Laboratory at CS Department Univ. of Pisa (http://medialab.di.unipi.it) Dream Team Antonio Cisternino Diego Colombo Giorgio Ennas Daniele Picciaia Robot Mechanics Prof. Marco Carcassi Ing. Gennaro Cerchiara Michele Rosellini Alessio Capperi Mario Gerardi Robot Skin Alberto Arzilli Luca Mariotti Support Letizia Petrellese Roberto Ricci Robotics4.NET The software developed within this project will be soon available on-line! http://www.robotics4.net/ We propose to use our infrastructure as a framework for developing software to control Robots using .NET. Together with the basic infrastructure we will release several agents, including those we use to control the ER1 robot. The Experiment We used our framework to program ER1 to map the signal strength of the Wireless Networks at our department. The robot autonomously explored the Department building recording all the signals received from the WiFi NIC (through the WiFi agent). Now we are working to use these signals as a mean to find robot’s position.