You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.4 KiB
40 lines
1.4 KiB
using RobotLib;
|
|
using RobotLib.Communication;
|
|
|
|
namespace RobotConsoleClient
|
|
{
|
|
internal class Program
|
|
{
|
|
static void Main(string[] args)
|
|
{
|
|
var com = MqttPublisherSubscriber.Instance;
|
|
com.Connect("192.168.20.22", "ADIS", "TEST");
|
|
var robotStationary = new Robot(com);
|
|
var robotMobile = new Robot(com);
|
|
robotStationary.SplitFlap.SplitFlapDisplayChanged += SplitFlap_SplitFlapDisplayChanged;
|
|
//Console.ReadLine();
|
|
Thread.Sleep(1000);
|
|
robotStationary.SplitFlap.ConfigureSplitflap(setupId: 1, hardwareId: 21);
|
|
Thread.Sleep(1000);
|
|
robotStationary.SplitFlap.InitializeAllSplitflaps();
|
|
|
|
Thread.Sleep(1000);
|
|
robotMobile.Movement.AddSpeed(1000);
|
|
robotMobile.Movement.Turn(-10);
|
|
robotMobile.Movement.AddSpeed(-500);
|
|
robotMobile.Movement.Stop();
|
|
robotMobile.Movement.SetMobilityMode(automatic: true);
|
|
|
|
}
|
|
|
|
private static void SplitFlap_SplitFlapDisplayChanged(object? sender, RobotLib.SplitFlap.SplitFlapDisplayEventArgs e)
|
|
{
|
|
Console.WriteLine($"SplitFlap changed Display to '{e.DisplayMessage}'");
|
|
}
|
|
|
|
//private static void Battery_BatteryChanged(object? sender, BatteryEventArgs e)
|
|
//{
|
|
// Console.WriteLine($"Received Battery Changed event. New Battery voltage = {e.Voltage} V");
|
|
//}
|
|
}
|
|
} |