Пример #1
0
        public SimLidar(SensorPose toBodyTransform, int id)
        {
            INetworkAddressProvider addressProvider = new HardcodedAddressProvider();

            simLidarClient              = new GenericMulticastClient <SimMessage <ILidarScan <ILidar2DPoint> > >(addressProvider.GetAddressByName("SimLidar"), new CSharpMulticastSerializer <SimMessage <ILidarScan <ILidar2DPoint> > >(true));
            simLidarClient.MsgReceived += new EventHandler <MsgReceivedEventArgs <SimMessage <ILidarScan <ILidar2DPoint> > > >(simLidarClient_MsgReceived);
            this.toBodyTransform        = toBodyTransform;
            robotID = id;
        }
Пример #2
0
        public VFHPathFollower(double maxVelocity, double maxTurn)
        {
            INetworkAddressProvider na = new HardcodedAddressProvider();

            sick = new SickLMS(na.GetAddressByName("Sick"), new SensorPose());
            sick.ScanReceived += new EventHandler <ILidarScanEventArgs <ILidarScan <ILidar2DPoint> > >(sick_ScanReceived);
            sick.Start();

            histogram = new double[361];

            this.maxVelocity = maxVelocity;
            this.maxTurn     = maxTurn;
        }
Пример #3
0
 public HokuyoURG(string port, int scannerId, bool useHokuyoTimestamp)
 {
     this.port               = port;
     this.scannerId          = scannerId;
     this.sensorPose         = new SensorPose(0, 0, 0, 0, 0, 0, 0);
     this.useHokuyoTimestamp = useHokuyoTimestamp;
     if (!useHokuyoTimestamp)
     {
         INetworkAddressProvider addressProvider = new HardcodedAddressProvider();
         segway = new SegwayRMP50(addressProvider.GetAddressByName("SegwayFeedback"), addressProvider.GetAddressByName("SegwayControl"), false, 1);
         segway.Start();
         segway.WheelPositionUpdate += new EventHandler <TimestampedEventArgs <Magic.Common.Robots.IRobotTwoWheelStatus> >(segway_WheelPositionUpdate);
     }
 }
Пример #4
0
        public SegwayRMP50(NetworkAddress feedback, NetworkAddress control, bool simmode, bool isBackwards, int id)
            : this(feedback, control, isBackwards, id)
        {
            if (simmode)
            {
                INetworkAddressProvider addrProvider = new HardcodedAddressProvider();
                simRobotCommandServer = new GenericMulticastServer <SimMessage <RobotTwoWheelCommand> >(addrProvider.GetAddressByName("RobotSimCommands"), new CSharpMulticastSerializer <SimMessage <RobotTwoWheelCommand> >(true));
                simRobotCommandServer.Start(NetworkAddress.GetBindingAddressByType(NetworkAddress.BindingType.Wired));

                //Fake Segway feedback (for Odom)
                simSegwayFeedback              = new GenericMulticastClient <SimMessage <IRobotTwoWheelStatus> >(addrProvider.GetAddressByName("SimSegwayFeedback"), new CSharpMulticastSerializer <SimMessage <IRobotTwoWheelStatus> >(true));
                simSegwayFeedback.MsgReceived += new EventHandler <MsgReceivedEventArgs <SimMessage <IRobotTwoWheelStatus> > >(simSegwayFeedback_MsgReceived);
                simSegwayFeedback.Start(NetworkAddress.GetBindingAddressByType(NetworkAddress.BindingType.Wired));
            }
            this.simMode = simmode;
        }
Пример #5
0
 public HokuyoURG(string port, int scannerId, SensorPose sensorPose, bool useHokuyoTimestamp)
 {
     this.port               = port;
     this.scannerId          = scannerId;
     this.sensorPose         = sensorPose;
     this.useHokuyoTimestamp = useHokuyoTimestamp;
     if (!useHokuyoTimestamp)
     {
         INetworkAddressProvider addressProvider = new HardcodedAddressProvider();
         //segway = new SegwayRMP50(addressProvider.GetAddressByName("SegwayFeedback"), addressProvider.GetAddressByName("SegwayControl"), false, 1);
         //segway.Start();
         //segway.WheelPositionUpdate += new EventHandler<TimestampedEventArgs<Magic.Common.Robots.IRobotTwoWheelStatus>>(segway_WheelPositionUpdate);
         ILidar2D lidar = new SickLMS(addressProvider.GetAddressByName("Sick"), new SensorPose(), true);
         lidar.ScanReceived += new EventHandler <ILidarScanEventArgs <ILidarScan <ILidar2DPoint> > >(lidar_ScanReceived);
         lidar.Start();
     }
 }