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

How to get ROS version?

asked 2012-05-11 00:34:15 -0500

liborw gravatar image

updated 2014-04-20 14:09:39 -0500

ngrennan gravatar image

Hi, is there a way how to get ROS version which I'm using. I mean not the one of electric, fuerte and so on, but if I'm using beta or not?

edit retag flag offensive close merge delete

Comments

As this is a popular question and a top google result, maybe the accepted answer should be changed to a current solution, like the one presented by merosss

bi613en gravatar image bi613en  ( 2018-04-19 04:20:48 -0500 )edit

3 Answers

Sort by ยป oldest newest most voted
59

answered 2014-10-08 06:41:09 -0500

merosss gravatar image

updated 2022-05-11 06:05:17 -0500

As of Indigo the correct command for ROS1 is:

rosversion -d

For ROS2 instead use:

echo $ROS_DISTRO
edit flag offensive delete link more

Comments

rosversion -d

also works for hydro

Will Chamberlain gravatar image Will Chamberlain  ( 2016-01-13 23:06:37 -0500 )edit

rosversion -d gives me "jade" rosversion roscpp gives me "1.11.16" Does it mean I am using 1.11.16 jade version? Thank you

willSapgreen gravatar image willSapgreen  ( 2016-05-01 22:02:59 -0500 )edit
2

work for Kinetic

lhnguyen gravatar image lhnguyen  ( 2016-09-02 02:45:45 -0500 )edit

This does not work on ROS2.

breandan gravatar image breandan  ( 2019-03-23 01:34:35 -0500 )edit
1

@breandan I've updated the answer ;)

merosss gravatar image merosss  ( 2019-03-23 14:33:51 -0500 )edit

Thanks. It also worked for indigo

raj199322 gravatar image raj199322  ( 2020-04-30 12:33:20 -0500 )edit
1

It also works for noetic

Roberto Z. gravatar image Roberto Z.  ( 2022-05-11 03:49:01 -0500 )edit
5

answered 2012-05-11 00:59:22 -0500

Lorenz gravatar image
rosversion ros

This will print a version number. The current Fuerte release has version number 1.8. Everything above should be unstable at the moment.

edit flag offensive delete link more

Comments

To clarify: it currently prints 1.8.6, anything starting with 1.9.0 should be unstable. You should not see the unstable version unless you explicitly install it.

joq gravatar image joq  ( 2012-05-11 01:55:30 -0500 )edit
9

It says <unversioned>

salman gravatar image salman  ( 2013-04-08 23:54:53 -0500 )edit
1

It fails for me on Hydro, too. That may be a new bug. It should say 1.10.0. Probably worth a defect ticket: https://github.com/ros/ros/issues/new

joq gravatar image joq  ( 2013-04-09 04:08:33 -0500 )edit

for me too it says < unversioned >

leo pauly gravatar image leo pauly  ( 2014-02-22 23:03:19 -0500 )edit
8

It has to be an actual package name. I don't think there is a package named **ros** any more. Try it with ``rosversion roscpp``.

joq gravatar image joq  ( 2014-02-23 04:07:08 -0500 )edit

rosvrrsion roscpp works perfectly for hydro, thanks

bhanu gravatar image bhanu  ( 2015-12-18 05:22:37 -0500 )edit

$ rosversion ros <unversioned> with current kinetic (1.12.2) mmh?

user23fj239 gravatar image user23fj239  ( 2016-08-18 07:33:10 -0500 )edit
1

For me (ros jade on Ubuntu 14.04) this just prints "Cannot locate [ros]"

antonio gravatar image antonio  ( 2017-04-14 16:13:35 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2012-05-11 00:34:15 -0500

Seen: 232,212 times

Last updated: May 11 '22