forked from autowarefoundation/autoware
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Oguz Ozturk <[email protected]>
- Loading branch information
1 parent
154cda5
commit 92f4a2a
Showing
6 changed files
with
56 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Source ROS2 and Autoware | ||
source "/opt/ros/$ROS_DISTRO/setup.bash" | ||
source /opt/autoware/setup.bash | ||
|
||
# Check if VNC is enabled | ||
if [ "$VNC_ENABLED" = "true" ]; then | ||
|
||
# Start VNC server | ||
echo "Starting VNC server..." | ||
vncserver :1 -auth $HOME/.Xauthority -geometry 1024x768 -depth 16 -pixelformat rgb565 >/dev/null 2>&1 | ||
VNC_RESULT=$? | ||
|
||
if [ $VNC_RESULT -ne 0 ]; then | ||
echo "Failed to start VNC server (exit code: $VNC_RESULT)" | ||
exit $VNC_RESULT | ||
fi | ||
|
||
sleep 2 | ||
|
||
# Start NoVNC | ||
echo "Starting NoVNC..." | ||
websockify --daemon --web=/usr/share/novnc/ --cert=/etc/ssl/certs/novnc.crt --key=/etc/ssl/private/novnc.key 6080 localhost:5901 | ||
|
||
# Get local IP address (works on Linux) | ||
LOCAL_IP=$(hostname -I | awk '{print $1}') | ||
NOVNC_URL="${LOCAL_IP}:6080" | ||
|
||
# Configure ngrok if NGROK_AUTHTOKEN is set | ||
if [ -n "$NGROK_AUTHTOKEN" ]; then | ||
echo "Starting ngrok..." | ||
ngrok config add-authtoken $NGROK_AUTHTOKEN | ||
|
||
# Start ngrok tunnel for NoVNC | ||
ngrok http --url=$NGROK_URL 6080 --log=stdout >ngrok.log & | ||
|
||
NOVNC_URL=https://$NGROK_URL | ||
fi | ||
|
||
# Start Rviz | ||
rviz2 -d /autoware/simulation/scenario_simulator.rviz | ||
|
||
# Print message | ||
echo -e "\033[32m-------------------------------------------------------------------------\033[0m" | ||
echo -e "Note: In order to access VNC and NoVNC on localhost, you need to expose ports 5901 and 6080 to the outside world respectively." | ||
echo -e "\033[32mVNC server is running and accessible at localhost:5901 via VNC viewer\033[0m" | ||
echo -e "\033[32mNoVNC web interface available at $NOVNC_URL/vnc.html via web browser\033[0m" | ||
echo -e "\033[32m-------------------------------------------------------------------------\033[0m" | ||
fi | ||
|
||
# Run command | ||
exec "$@" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.