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

asked 2019-07-27 02:39:25 -0500

jalamani gravatar image

updated 2019-07-28 19:31:15 -0500

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

  • I'm using ROS Melodic v20190415.1
  • I'm running on 64-bit Windows 10
  • Using the ROS command line
  • I've executed setup.bat

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.

edit retag flag offensive close merge delete

Comments

1

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

jayess gravatar imagejayess ( 2019-07-27 12:30:57 -0500 )edit

sure, done

jalamani gravatar imagejalamani ( 2019-07-27 18:46:31 -0500 )edit
1

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.

PeteBlackerThe3rd gravatar imagePeteBlackerThe3rd ( 2019-07-28 04:01:17 -0500 )edit
2

@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.

gvdhoorn gravatar imagegvdhoorn ( 2019-07-28 12:09:10 -0500 )edit

@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
jalamani gravatar imagejalamani ( 2019-07-28 19:07:37 -0500 )edit
Sean Yen gravatar imageSean Yen ( 2019-08-06 13:42:55 -0500 )edit