Skip to content

Commit

Permalink
changed for webots address
Browse files Browse the repository at this point in the history
  • Loading branch information
harunkurtdev committed Sep 27, 2024
1 parent ce6ea49 commit 6f1451e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
7 changes: 6 additions & 1 deletion libraries/SITL/SIM_Webots_Python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,16 @@ void WebotsPython::set_interface_ports(const char* address, const int port_in, c
socket_sitl.reuseaddress();
socket_sitl.set_blocking(false);

if (is_wsl()) {
/*
if (is_wsl()) {
_webots_address = "0.0.0.0"; // Use 0.0.0.0 in WSL
} else {
_webots_address = address; // Use localhost otherwise
}
*/

_webots_address = address; // Use localhost otherwise
_webots_port = port_out;
printf("Setting Webots interface to %s:%d \n", _webots_address, _webots_port);
}
Expand Down
24 changes: 12 additions & 12 deletions libraries/SITL/examples/Webots_Python/worlds/heron_ocean.wbt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ EXTERNPROTO "https://raw.githubusercontent.com/cyberbotics/webots/R2023a/project
WorldInfo {
}
Viewpoint {
orientation 0.11417842104655657 0.09038023497047008 -0.9893405385882043 2.0878534292029074
position -5.301313912561586 0.8769520435623269 1.1371233590956247
orientation 0.18802303494067113 0.008368575014304897 -0.9821289657086432 2.6567413787072653
position -3.5173698357397702 0.9533488761989521 1.9238550170857296
}
TexturedBackground {
}
Expand Down Expand Up @@ -40,10 +40,10 @@ DEF WATER Fluid {
locked TRUE
}
Heron {
hidden linearVelocity_0 0 0 3.6785733076437055e-13
hidden angularVelocity_0 8.936961868228959e-13 -3.0793909374941e-13 -1.8046085461297246e-16
translation -6.6784157308512615 -0.49028637658352825 0.44500582684416695
rotation -0.010053065114515154 -0.04147340372230338 -0.9990890314008507 0.5175970204287123
hidden linearVelocity_0 0 0 -3.545123546997953e-14
hidden angularVelocity_0 4.609404596900323e-14 6.687054702593327e-13 2.3099636435669426e-16
translation -6.6784157308512615 -0.49028637658352825 0.4450058268441469
rotation -0.010053065114475615 -0.041473403722977586 -0.9990890314008232 0.517597020428728
controller "ardupilot_vehicle_controller"
controllerArgs [
"--motors"
Expand All @@ -57,7 +57,7 @@ Heron {
"--camera-port"
"5599"
"--sitl-address"
"172.24.107.226"
"localhost"
]
bodySlot [
JetsonNano {
Expand All @@ -80,7 +80,7 @@ Heron {
]
}
OilBarrel {
hidden linearVelocity_0 0 0 7.783035268975111e-16
hidden linearVelocity_0 0 0 1.4387456326881762e-15
translation -5.769041604986175 5.7137363726152754 0.5595498919704248
rotation -0.1699998685374228 -0.9047911400234424 0.39045235001513096 1.7528084979303689
physics Physics {
Expand All @@ -97,9 +97,9 @@ OilBarrel {
]
}
OilBarrel {
hidden linearVelocity_0 0 0 7.783035268975111e-16
hidden linearVelocity_0 0 0 1.4387456326881762e-15
translation -10.052079249302796 2.4814946123187727 0.5595498919704248
rotation -0.2751133038851126 -0.6601076264091589 0.6989782482895187 -2.843722039686052
rotation -0.27511330388511257 -0.6601076264091592 0.6989782482895184 -2.843722039686051
name "oil barrel(1)"
physics Physics {
density 100
Expand All @@ -115,7 +115,7 @@ OilBarrel {
]
}
OilBarrel {
hidden linearVelocity_0 0 0 -7.631781365196398e-16
hidden linearVelocity_0 0 0 -1.5261006141050254e-15
translation -9.806804324970415 -3.2705951440882433 0.5595498919704249
rotation 0.9914248557443196 0.045597095586811014 0.12246493492588871 1.5859460279251565
name "oil barrel(2)"
Expand All @@ -133,7 +133,7 @@ OilBarrel {
]
}
OilBarrel {
hidden linearVelocity_0 0 0 7.783035268975111e-16
hidden linearVelocity_0 0 0 1.4387456326881762e-15
translation -9.046348837161165 3.2463636605243056 0.5595498919704248
rotation 0.7378366847241952 0.14393236835260417 -0.6594546989866846 -2.4506564948848384
name "oil barrel(3)"
Expand Down

0 comments on commit 6f1451e

Please sign in to comment.