Robotics StackExchange | Archived questions

How do I get the 'roscp' command to work?

I am following the Creating a ROS msg and srv tutorial step 4.1.

ROS command line result:

~catkin_ws\src\beginner_tutorials>roscp rospy_tutorials AddTwoInts.srv srv/AddTwoInts.srv
'roscp' is not recognized as an internal or external command,
operable program or batch file.

Environment:

C:\Users\JP\catkin_ws\src\beginner_tutorials\src>set ros
ROS_DISTRO=melodic
ROS_ETC_DIR=C:/opt/ros/melodic/x64/etc/ros
ROS_MASTER_URI=http://localhost:11311
ROS_PACKAGE_PATH=C:/Users/JP/catkin_ws/src;C:\opt\ros\melodic\x64\share
ROS_PYTHON_VERSION=2
ROS_ROOT=C:/opt/ros/melodic/x64/share/ros
ROS_VERSION=1

I can also roscd the rosbash package and see roscp in the file.

Asked by jalamani on 2019-07-27 02:39:25 UTC

Comments

Can you please update your question with a link to the tutorial that you're referring to?

Asked by jayess on 2019-07-27 12:30:57 UTC

sure, done

Asked by jalamani on 2019-07-27 18:46:31 UTC

Can you show us the output of the following two commands printenv | grep ROS and printenv PATH | tr ":" "\n" | grep ros

It sounds as though your ROS environment has not been initialised properly, these two commands will help pinpoint what's missing.

Asked by PeteBlackerThe3rd on 2019-07-28 04:01:17 UTC

@PeteBlackerThe3rd: this is a ROSonWindows installation, I doubt printenv | grep ROS is going to work there.

@jalamani: for future questions: please tag your questions appropriately with the relevant Windows10 and RosOnWindows tags.

Asked by gvdhoorn on 2019-07-28 12:09:10 UTC

@PeteBlackerThe3rd i believe the windows equivalent to printenv is set and i get the following:

C:\Users\JP\catkin_ws\src\beginner_tutorials\src>set ros
ROS_DISTRO=melodic
ROS_ETC_DIR=C:/opt/ros/melodic/x64/etc/ros
ROS_MASTER_URI=http://localhost:11311
ROS_PACKAGE_PATH=C:/Users/JP/catkin_ws/src;C:\opt\ros\melodic\x64\share
ROS_PYTHON_VERSION=2
ROS_ROOT=C:/opt/ros/melodic/x64/share/ros
ROS_VERSION=1

Asked by jalamani on 2019-07-28 19:07:37 UTC

Cross-posted it here: https://github.com/ms-iot/ROSOnWindows/issues/139

Asked by Sean Yen on 2019-08-06 13:42:55 UTC

Answers