ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

We see this:

if __name__ == '__main__':
    try:
        [..]
        serv = server(
            "~/arm_cws/src/arm_data_frame/data/testCoordinates.csv")
        [..]

you are using a relative path for filePath.

roslaunch changes the CWD for all nodes before starting them.

So this will work with rosrun, but not with roslaunch.

If you want to know more about it, please search ROS Answers with Google (append site:answers.ros.org to your query).

To make things work: use absolute paths, and to avoid hard-coding an absolute path into your scripts, use the $(find <your_pkg_name>) substitution arg supported by roslaunch. That would allow you to use package relative paths.

But you of course don't have to use that. As long as the parameter contains an absolute path, it should work.

We see this:

if __name__ == '__main__':
    try:
        [..]
        serv = server(
            "~/arm_cws/src/arm_data_frame/data/testCoordinates.csv")
        [..]

you are using a relative path for filePath.

roslaunch changes the CWD for all nodes before starting them.

So this will work with rosrun, but not with roslaunch.

If you want to know more about it, please search ROS Answers with Google (append site:answers.ros.org to your query).

To make things work: use absolute paths, and to avoid hard-coding an absolute path into your scripts, use the $(find <your_pkg_name>) substitution arg supported by roslaunch. That would allow you to use package relative paths.

But you of course don't have to use that. As long as the parameter contains an absolute path, it should work.

We see this:this in your "Server" script:

if __name__ == '__main__':
    try:
        [..]
        serv = server(
            "~/arm_cws/src/arm_data_frame/data/testCoordinates.csv")
        [..]

you are using a relative path for filePath.

roslaunch changes the CWD for all nodes before starting them.

So this will work with rosrun, but not with roslaunch.

If you want to know more about it, please search ROS Answers with Google (append site:answers.ros.org to your query).

To make things work: use absolute paths, and to avoid hard-coding an absolute path into your scripts, use the $(find <your_pkg_name>) substitution arg supported by roslaunch. That would allow you to use package relative paths.

But you of course don't have to use that. As long as the parameter contains an absolute path, it should work.

We see this in your "Server" script:

if __name__ == '__main__':
    try:
        [..]
        serv = server(
            "~/arm_cws/src/arm_data_frame/data/testCoordinates.csv")
        [..]

you are using a relative path for filePath.

roslaunch changes the CWD for all nodes before starting them.them. See the answer by ipso on #q38045 for a (very old) Q&A about this, and the links to the roslaunch documentation where this is explained.

So this will work with rosrun, but not with roslaunch.

If you want to know more about it, please search ROS Answers with Google (append site:answers.ros.org to your query).

To make things work: use absolute paths, and to avoid hard-coding an absolute path into your scripts, use the $(find <your_pkg_name>) substitution arg supported by roslaunch. That would allow you to use package relative paths.

But you of course don't have to use that. As long as the parameter contains an absolute path, it should work.

We see this in your "Server" script:

if __name__ == '__main__':
    try:
        [..]
        serv = server(
            "~/arm_cws/src/arm_data_frame/data/testCoordinates.csv")
        [..]

you are using a relative path for filePath.

roslaunch changes the CWD for all nodes before starting them. See the answer by ipso on #q38045#q235337 for a (very old) previous Q&A about this, and the links to the roslaunch documentation where this is explained.

So this will work with rosrun, but not with roslaunch.

If you want to know more about it, please search ROS Answers with Google (append site:answers.ros.org to your query).

To make things work: use absolute paths, and to avoid hard-coding an absolute path into your scripts, use the $(find <your_pkg_name>) substitution arg supported by roslaunch. That would allow you to use package relative paths.

But you of course don't have to use that. As long as the parameter contains an absolute path, it should work.