Skip to content

Instantly share code, notes, and snippets.

@srathi-monarch
Created October 30, 2023 05:09
Show Gist options
  • Select an option

  • Save srathi-monarch/15cc7143382632cf24eff056e23c7f11 to your computer and use it in GitHub Desktop.

Select an option

Save srathi-monarch/15cc7143382632cf24eff056e23c7f11 to your computer and use it in GitHub Desktop.
Example of using venvs with ROS.
<launch>
<node name="lanenet" pkg="lanenet" type="test_lanenet.py"
launch-prefix="$(find lanenet)/launch/with_venv.sh $(find lanenet)">
</node>
</launch>
#!/bin/bash
# Running
# with_venv.sh <lanenet package directory> <rosrun args...>
source "${1}/venv/bin/activate"
PYTHONPATH="${PYTHONPATH}:${1}/src/lanenet-lane-detection" python "${@:2}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment