Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mavlink sending message and didn’t response message #22

Open
heotaein opened this issue Dec 12, 2017 · 3 comments
Open

Mavlink sending message and didn’t response message #22

heotaein opened this issue Dec 12, 2017 · 3 comments

Comments

@heotaein
Copy link

heotaein commented Dec 12, 2017

I use "Silicon Labs CP210x USB to UART Bridge (COM6)".

/////////////////////////////////////////////////////////////////////////////////////////////////////////
step1. connect Serialport - success
In pixhawk2.1, the default information is displayed. (GPS, etc.)
/////////////////////////////////////////////////////////////////////////////////////////////////////////
public MavLinkSerialPortTransport mavLinkSerialPortTransport = null;
public Ardupilot()
{
mavLinkSerialPortTransport = new MavLinkSerialPortTransport();
mavLinkSerialPortTransport.SerialPortName = SerialPortName;
mavLinkSerialPortTransport.BaudRate = BaudRate;
mavLinkSerialPortTransport.OnPacketReceived += new PacketReceivedDelegate(recvPacket);
mavLinkSerialPortTransport.Initialize();
}

private void recvPacket(object sender, MavLinkNet.MavLinkPacket packet)
{
Console.WriteLine(packet.Message.MessageId);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
step2. Test Sending Message - sucess
But the delegate does not respond. 😭
/////////////////////////////////////////////////////////////////////////////////////////////////////////
public void MissionCount()
{
UasMissionCount uasMissionCount = new UasMissionCount()
{
MissionType = MavMissionType.Mission,
TargetComponent = 1,
TargetSystem = 1,
};
mavLinkSerialPortTransport.SendMessage(uasMissionCount);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////
I sent a lot of other messages, but not all of them answered.

@dsuarezv
Copy link
Owner

There is a sample that uses the library here: https://github.com/dsuarezv/mavlinkclient-cs

I don't have a pixhawk to test the protocol, but some autopilots need a specific sequence of messages to get a response. Try to find information on the specific protocol you are using, or ultimately, write a small proxy with mavlink.net to intercept all the messages and see how ground station or other software talks to the autopilot.

@heotaein
Copy link
Author

heotaein commented Dec 13, 2017

Thank you for answering.
I would like to know if I use fewer methods to connect using serialport.
For applications that are to be used as other devices, is this method correct?
I don't use UDP Connect.

@heotaein
Copy link
Author

heotaein commented Dec 13, 2017

#17

https://github.com/amin347/TestMavlink.net
It's made using the "MavlinkNet.dll" file in the URL.
it seems to be a problem with the latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants