mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-15 22:10:36 +08:00
Simulator: Added remote host option (#15443)
* Added an option to the Simulator module to connect to remote Gazebo servers. This is usefull when the Gazebo simulation is running on a different host than the PX4 instance. For example, we are running instances of PX4 with a companion application in multiple Dockers, for swarming simulations, which then connect to a remote Gazebo server. A "-t" input argument has been added and can be called from the rcS startup script as: simulator start -t "192.168.178.122" $simulator_tcp_port * _tcp_remote_ipaddr defaults to nullptr. This way testing against nullptr it can be determined if localhost or remote host is desired by the user. * Documented the option in usage(). Signed-off-by: Peter Blom <peterblom.mail@gmail.com>
This commit is contained in:
@@ -123,6 +123,7 @@ public:
|
||||
|
||||
void set_ip(InternetProtocol ip) { _ip = ip; }
|
||||
void set_port(unsigned port) { _port = port; }
|
||||
void set_tcp_remote_ipaddr(char *tcp_remote_ipaddr) { _tcp_remote_ipaddr = tcp_remote_ipaddr; }
|
||||
|
||||
#if defined(ENABLE_LOCKSTEP_SCHEDULER)
|
||||
bool has_initialized() { return _has_initialized.load(); }
|
||||
@@ -201,6 +202,8 @@ private:
|
||||
|
||||
InternetProtocol _ip{InternetProtocol::UDP};
|
||||
|
||||
char *_tcp_remote_ipaddr{nullptr};
|
||||
|
||||
double _realtime_factor{1.0}; ///< How fast the simulation runs in comparison to real system time
|
||||
|
||||
hrt_abstime _last_sim_timestamp{0};
|
||||
|
||||
Reference in New Issue
Block a user