roslaunch env tag not functioning correctly
I'm attempting to establish an environment variable from a roslaunch .launch file that I may use in my C++ ROS node. My roslaunch file is below:
<launch>
<!--
<include file="$(find px4)/launch/mavros_posix_sitl.launch">
</include>
-->
<include file="$(find terp)/config/pilot.xml"/>
<env
name="MISSION_FILE_PATH"
value="$(find terp)/mission/mission_schedule.txt"/>
</launch>
Edit: The rest of it
I intend to use "MISSION_FILE_PATH" in my project. I call it with the following call:
ifstream mission_file(getenv("MISSION_FILE_PATH"));
However, this call is unable to open the file specified by "MISSION_FILE_PATH" in my .launch file. Does the environment created in the .launch file stick around while the program is running? If so, what is incorrect about my call to getenv()? If not, are there any easy workarounds other than hard-coding a file path?
This is not a question, this is just stating what you want to do...
What is the expected behaviour, what the observed one? Which OS are you using, which ROS distro?
Did you check the wiki page?