Skip to content

Commit

Permalink
Always use connectRemoteUdp when using UdpIp connection to remote HIL…
Browse files Browse the repository at this point in the history
…. This sould also work in the localhost case.
  • Loading branch information
lovettchris committed Feb 23, 2017
1 parent eab7513 commit 46b00c2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions AirLib/src/control/MavLinkHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,12 @@ struct MavLinkHelper::impl {
void createHILUdpConnection(const std::string& ip, int port)
{
close();
if (ip == LocalHostIp) {
connection_ = MavLinkConnection::connectLocalUdp("hil", ip, port);
}
else {
connection_ = MavLinkConnection::connectRemoteUdp("hil", LocalHostIp, ip, port);
}
// In this case the HIL is already waiting for us to connect (in other words the HIL is the server)
// so in this case we use connectRemoteUdp. This will work for both localhost and remote UDP addresses.
// But if the hil is not localhost then LocalHostIp will also need to be changed to be a real ip address
// of one of your local network adapters that can reach the remote HIL. You can do that using your
// !/Documents/AirSim/settings.json file.
connection_ = MavLinkConnection::connectRemoteUdp("hil", LocalHostIp, ip, port);
main_node_ = std::make_shared<MavLinkNode>(SimSysID, SimCompID);
main_node_->connect(connection_);
}
Expand Down

0 comments on commit 46b00c2

Please sign in to comment.