elvout / cs393r

CS 393R Graduate Autonomous Robots, Fall 2021 | Autobots
0 stars 0 forks source link

Inject repository path into ROS_PACKAGE_PATH #2

Closed elvout closed 3 years ago

elvout commented 3 years ago

I anticipate it may be annoying to constantly update the ROS_PACKAPGE_PATH env variable in the dotfiles on the robot and all of our personal machines for each assignment. Instead, we may be able to dynamically inject the assignment repository directory into ROS_PACKAGE_PATH whenever make is run.

In the shell this could be accomplished with something like:

export ROS_PACKAGE_PATH="${ROS_PACKAGE_PATH}:$(realpath .)"

However, I'm not sure if we can modify shell environment variables within a Makefile. Perhaps we could invoke an executable script file?

elvout commented 3 years ago

I couldn't figure out how to do this from the Makefile. In commit b263913, I added a ./make executable script that injects the assignment repository directory into ROS_PACKAGE_PATH and then runs make -j.