Plug and play attach component

Hi,
is there a possibility to attach a component (e.g. a gripper) to another component (e.g. a robot) by the plug ans play mechanism?

Best regards
Simon

Jes with “OneToOne” - or “OneToMany-Interface”

Hi Captain_Feature,

thanks for your answer. Do you have an example for the plag and play function by the IOneToOneInterface and OneToManyInterface?

I try it wit the AutoConnect function with theAutoConnect method like this:

            var simComponent1 = this.GetSimComponent("MyRobot");
            var simComponent2 = this.GetSimComponent("MyGripper");

            this.AutoPlugPlayService.ResolveParentToChildHierarchyConflicts = true;
            this.AutoPlugPlayService.UpdatePosition = true;

            this.AutoPlugPlayService.AutoConnect(simComponent1, simComponent2));

But it does not work.

Best regards
Simon

 

Remember you are using the interface in the component to make connection. I would first of all get the interfaces in both components and then connect them. For example

var robot = App.World.Components.First().Behaviors.First(i=>i.Name == "Tool") as IOneToOneInterface;
var gripper = App.World.Components.Last().Behaviors.First(i=>i.Name == "EOAT_MountInterface") as IOneToOneInterface;
robot.Connect(gripper, true);
IoC.Get<IRenderService>().RequestRender();

 

 

1 Like