private void OKButton_Click(object sender, EventArgs e) { ScanParameters t = new ScanParameters(); try { t.HRange = (byte) HRangeBox.SelectedIndex; t.HRes = (byte) HResBox.SelectedIndex; t.scanBottom = float.Parse(BottomBox.Text); t.scanRes = float.Parse(VResBox.Text); t.scanLines = Int32.Parse(ScanLineBox.Text); lock (parameters) { parameters.HRange = t.HRange; parameters.HRes = t.HRes; parameters.scanBottom = t.scanBottom; parameters.scanLines = t.scanLines; parameters.scanRes = t.scanRes; } Close(); } catch { // bring up an error box MessageBox.Show("Invalid Scan Parameters"); } }
public ScanParametersViewer(ref ScanParameters rp) { InitializeComponent(); parameters = rp; HRangeBox.SelectedIndex = rp.HRange; HResBox.SelectedIndex = rp.HRes; BottomBox.Text = "" + rp.scanBottom; ScanLineBox.Text = "" + rp.scanLines; VResBox.Text = "" + rp.scanRes; }
public RangeImageViewer(Robot Robot) { m_Robot = Robot; m_DrawStyle = DrawStyle.TrianglesColorByDistance; scanParams = new ScanParameters(); // these should probably be read in from a file or something... scanParams.HRange = 0; scanParams.HRes = 0; scanParams.scanBottom = -45; scanParams.scanLines = 360; scanParams.scanRes = (float).25; InitializeComponent(); }
/* Request the LADAR to scan */ public void Scan(ScanParameters p) { byte[] arr = new byte[14]; lock (p) { arr[0] = (byte)(p.HRange * 80 + 100); arr[1] = (byte)(p.HRes == 0 ? 25 : p.HRes * 50); Array.Copy(BitConverter.GetBytes(p.scanLines), 0, arr, 2, 4); Array.Copy(BitConverter.GetBytes(p.scanRes), 0, arr, 6, 4); Array.Copy(BitConverter.GetBytes(p.scanBottom), 0, arr, 10, 4); } SendMessage(0x0000000b, arr); }
/** * @brief Event handler. Called by button10 for click events. * @param sender An object - Source of the event * @param e An EventArgs - Event Information */ private void button10_Click(object sender, EventArgs e) { ScanParameters sp = new ScanParameters(); sp.HRange = 0; sp.HRes = 0; sp.scanBottom = -45; sp.scanLines = 1; sp.scanRes = (float).25; m_Robot.Scan(sp); sp.scanBottom = -45; }
/** * @brief Initializes the lidar scanning */ public void initLidarScanning() { scanParams = new ScanParameters(); // these should probably be read in from a file or something... scanParams.HRange = 0; scanParams.HRes = 0; scanParams.scanBottom = -45; scanParams.scanLines = 360; scanParams.scanRes = (float).25; }
public Navigation(Robot R) { InitializeComponent(); m_Robot = R; if (m_Robot == null) m_Map = new Map(1024, 1024, 0.1f); else m_Map = m_Robot.Map; m_History = new List<PointF>(); m_Scale = 0.05f; m_PathPen = new Pen(Color.Black, 2.0f); m_HistoryBrush = new SolidBrush(Color.Black); m_NoScanWaypointBrush = new SolidBrush(Color.Black); m_DirectionalScanWaypointBrush = new SolidBrush(Color.Green); m_FullScanWaypointBrush = new SolidBrush(Color.Blue); m_RobotBrush = new SolidBrush(Color.DarkGray); m_BlackPen = new Pen(Color.Black, 2.0f); m_Path = new Path(); m_MinorGridPen = new Pen(Color.Silver, 1.0f); m_MinorGridPen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot; m_MajorGridPen = new Pen(Color.Black, 1.0f); m_MajorGridPen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash; m_IndexToMove = -1; m_MovingPoint = false; UpdateMap(); if (m_Robot != null) ScrollToPosition(m_Robot.Telemetry.Position); //--------------------- //For RangeImage Viewer //--------------------- m_DrawStyle = DrawStyle.TrianglesColorByDistance; scanParams = new ScanParameters(); // these should probably be read in from a file or something... scanParams.HRange = 0; scanParams.HRes = 0; scanParams.scanBottom = -45; scanParams.scanLines = 360; scanParams.scanRes = (float).25; //InitGraphics(); InitializeComponent(); }