Skip to content

Commit 1c3de1f

Browse files
add host_ip argument to camera bridge
1 parent e0197d9 commit 1c3de1f

3 files changed

Lines changed: 17 additions & 8 deletions

File tree

docs/getting-started.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Getting started
22

33
When running this simulator there are two main components: the simulator and the ros bridge.
4-
Your autonomous system and the ros bridge should use the same ros core, either by running on the same computer or through a network connection. It is required that the simulator and the ros bridge have the same version!
4+
Your autonomous system and the ros bridge should use the same ros core, either by running on the same computer or through a network connection.
5+
It is required that the simulator and the ros bridge have the same version!
56

67
This page is an overview of the different methods to get these components up and running.
78

@@ -77,7 +78,8 @@ It might show an error like 'This project was made with a different version of t
7778
When asked to rebuild the 'Blocks' and 'AirSim' modules, choose 'Yes'.
7879
This is the step where the plugin part of AirSim is compiled.
7980

80-
After some time Unreal Engine will start and you can launch the game.
81+
After some time Unreal Engine will start and you can launch the game.
82+
Run the game in standalone mode or or selected viewport mode, simulate and eject mode do not support camera's.
8183

8284
If you make changes to AirLib you have to run `build.cmd` again.
8385

@@ -95,9 +97,9 @@ If you want to run it like it would run when packaged, choose 'Run as standalone
9597
The simulator exposes an RPC api that is used by the ros bridge to communicate with the vehicle.
9698
The ros bridge should preferable run on the same computer as the simulator to ensure low latency and high bandwidth.
9799

98-
> It is theoretically possible to run the ros bridge on a different computer than the simulator.
99-
However, this has not been tested recently and it might be broken.
100-
You should look into the fsds_ros_bridge.launch file and check the `host_ip` variable.
100+
It is possible to run the ros bridge on a different computer than the simulator.
101+
To get this to work you should use the `host` argument in the `fsds_ros_bridge.launch` file.
102+
The ros bridge will connect to the simulator on port 41451.
101103

102104
The ros bridge only works on Ubuntu.
103105
If you have the simulator running on windows we reccommend Windows Subsystem for Linux.
@@ -174,4 +176,4 @@ roslaunch fsds_ros_bridge fsds_ros_bridge.launch
174176
The ros bridge will read the settings from `~/Formula-Student-Driverless-Simulator/settings.json`.
175177
Make sure this is the same configuration file as the simulator uses.
176178

177-
[Read all about configuring the ros bridge here.](ros-bridge.md)
179+
[Read all about configuring the ros bridge here.](ros-bridge.md)

ros/src/fsds_ros_bridge/launch/fsds_ros_bridge.launch

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@
2727
<env name="OPERATOR_ACCESS_TOKEN" value="$(arg access_token)"/>
2828
</node>
2929

30-
<node pkg="fsds_ros_bridge" name="cameralauncher" type="cameralauncher.py" output="screen" required="true"/>
30+
<node pkg="fsds_ros_bridge" name="cameralauncher" type="cameralauncher.py" output="screen" required="true">
31+
<param name="host_ip" type="string" value="$(arg host)" />
32+
</node>
3133

3234
</group>
3335

ros/src/fsds_ros_bridge/scripts/cameralauncher.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,14 @@
44
import json
55
import signal
66
import sys
7+
import rospy
78

89
CAMERA_FRAMERATE = 30
9-
AIRSIM_HOSTIP = "localhost"
10+
11+
rospy.init_node('cameralauncher', anonymous=True)
12+
AIRSIM_HOSTIP = rospy.get_param("~host_ip")
13+
14+
print(AIRSIM_HOSTIP)
1015

1116
settings = {}
1217

0 commit comments

Comments
 (0)