Using ROS.jl, and running rosrun to run a .jl file, the JLD load function says file not found

Hello all,

I am try to generate a precomputed matrix. And then use it within a online controller on the robots. I am using ROS.jl for the same. However when I am importing the saved matrix as:

vars = load("data2.jld")
track_center1 = vars["track"];

It says no file found as:

LoadError: ArgumentError: No file exists at given path: data2.jld

The file is at the correct location because when I run the code using include in julia terminal it works. I am able to print the data contained in the matrix.

The same happened while using mat file as well, using MAT.jl. It ran in julia repl but not when doing rosrun.

Any suggestion how to proceed?

I was able to solve it by providing the full location of the file. However I am not sure why it does not work if the file is in the folder and I mention just the file name. Seems like for ros the current directory is something else?