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

SofiaGr's profile - activity

2020-07-29 16:47:07 -0500 received badge  Famous Question (source)
2019-08-28 08:11:32 -0500 received badge  Notable Question (source)
2019-05-20 01:50:37 -0500 marked best answer ROS_MASTER_URI set, but program gives related error.

Hello, I have ubuntu 14.04 , Ros indigo and Gazebo 2.2.6. I am running a gazebo_ros_control simulation, a simple robot with two movable joints. I can move the robot with rostopic commands. The problem is, that I am trying to publish messages to the topics from another program running in the same PC, but I get the following error:

 ROS_MASTER_URI is not defined in the environment. Either type the following or (preferrably) add this to your ~/.bashrc 
 file in order set up your local machine as a ROS master:

 export ROS_MASTER_URI=http://localhost:11311

 then, type 'roscore' in another shell to actually launch the master program.

I have set ROS_MASTER_URI and ROS_IP to my .bashrc file and sourced it. I have tried setting ROS_MASTER_URI and ROS_HOSTNAME. I have tried setting all three of them. I have tried using "192.168.1.2 " instead of "localhost". I have tried to echo the variables and I get the expected result. Ι even tried to format my pc and reinstall everything, in case of broken packages. I always get the same error. What could be the problem?


edit: The output of env | grep -i ros | sort

ROS_ROOT=/opt/ros
ROS_PACKAGE_PATH=/home/sofia/catkin_ws/src:/home/sofia/catkin_ws/src:/opt/ros/indigo/share:/opt/ros/indigo/stacks
ROS_MASTER_URI=http://192.168.1.2:11311
LD_LIBRARY_PATH=/home/sofia/catkin_ws/devel/lib:/opt/ros/indigo/lib
CPATH=/home/sofia/catkin_ws/devel/include:/opt/ros/indigo/include
PATH=/opt/ros/bin:/opt/ros/indigo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin
ROSLISP_PACKAGE_DIRECTORIES=/home/sofia/catkin_ws/devel/share/common-lisp
ROS_DISTRO=indigo
PYTHONPATH=/home/sofia/catkin_ws/devel/lib/python2.7/dist-packages:/opt/ros/indigo/lib/python2.7/dist-packages
ROS_IP=192.168.1.2
PKG_CONFIG_PATH=/home/sofia/catkin_ws/devel/lib/pkgconfig:/opt/ros/indigo/lib/pkgconfig
CMAKE_PREFIX_PATH=/home/sofia/catkin_ws/devel:/opt/ros/indigo
ROS_ETC_DIR=/opt/ros/indigo/etc/ros

the lines I added to .bashrc

source /opt/ros/indigo/setup.bash
source ~/catkin_ws/devel/setup.bash
export GAZEBO_MODEL_PATH=/home/sofia/catkin_ws/src/
export GAZEBO_PLUGIN_PATH=$PWD:$GAZEBO_PLUGIN_PATH
export ROS_PACKAGE_PATH=/home/sofia/catkin_ws/src:$ROS_PACKAGE_PATH
export ROS_ROOT=/opt/ros
export PATH=$ROS_ROOT/bin:$PATH
export ROS_MASTER_URI=http://192.168.1.2:11311
export ROS_IP=192.168.1.2 
export ROS_HOSTNAME=192.168.1.2

Edit2: The only reason I started changing ROS variables was the error I am getting by the program.

env | grep -i ros output without exporting any ROS enviroment variables:

CMAKE_PREFIX_PATH=/home/sofia/catkin_ws/devel:/opt/ros/indigo
CPATH=/home/sofia/catkin_ws/devel/include:/opt/ros/indigo/include
LD_LIBRARY_PATH=/home/sofia/catkin_ws/devel/lib:/opt/ros/indigo/lib
PATH=/opt/ros/indigo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin
PKG_CONFIG_PATH ...
(more)
2018-07-06 04:23:59 -0500 received badge  Notable Question (source)
2018-03-17 02:43:22 -0500 received badge  Famous Question (source)
2017-11-22 20:11:10 -0500 received badge  Notable Question (source)
2017-11-04 12:59:52 -0500 commented answer ROS_MASTER_URI set, but program gives related error.

Sorry for the delay. Yes, I did. All I got printed was "Boot file filename.fboot could not be opened"

2017-10-27 03:21:22 -0500 commented answer ROS_MASTER_URI set, but program gives related error.

The ros::init is in the "other executable". I will do that in a day or two, because I have to export some data, now that

2017-10-27 03:20:09 -0500 commented answer ROS_MASTER_URI set, but program gives related error.

I will do that in a day or two, because I have to export some data, now that it works. Too afraid to rebuild it XD

2017-10-27 03:20:09 -0500 received badge  Commentator
2017-10-26 12:53:25 -0500 commented answer ROS_MASTER_URI set, but program gives related error.

hmmm.. I am not doing anything to run it as root. The program runs another executable. But I didn't have the time to loo

2017-10-26 11:31:25 -0500 received badge  Famous Question (source)
2017-10-26 11:30:39 -0500 answered a question ROS_MASTER_URI set, but program gives related error.

After noticing that throught the program, getenv() would return null, I exported ROS_MASTER_URI to a .sh file in /etc/pr

2017-10-26 03:54:23 -0500 commented question ROS_MASTER_URI set, but program gives related error.

Well... it has tons of libraries, so I don't know what to remove first! I will ask the person who wrote it. Thank you fo

2017-10-26 03:34:09 -0500 commented question ROS_MASTER_URI set, but program gives related error.

I assumed that the error comes from roscpp's master.cpp, and such error would occur if getenv("ROS_MASTER_URI")=NULL. Al

2017-10-25 11:23:30 -0500 received badge  Notable Question (source)
2017-10-25 09:35:26 -0500 commented question ROS_MASTER_URI set, but program gives related error.

I just tested simple publisher and subscriber and they work. I will try to look at the code, which is not mine. I though

2017-10-25 09:00:00 -0500 received badge  Popular Question (source)
2017-10-25 08:38:11 -0500 edited question ROS_MASTER_URI set, but program gives related error.

ROS_MASTER_URI set, but program gives related error. Hello, I have ubuntu 14.04 , Ros indigo and Gazebo 2.2.6. I am runn

2017-10-25 07:16:34 -0500 commented question ROS_MASTER_URI set, but program gives related error.

Ok, I edited my question. Thank you.

2017-10-25 07:16:01 -0500 edited question ROS_MASTER_URI set, but program gives related error.

ROS_MASTER_URI set, but program gives related error. Hello, I have ubuntu 14.04 , Ros indigo and Gazebo 2.2.6. I am runn

2017-10-25 06:31:21 -0500 received badge  Famous Question (source)
2017-10-25 06:31:19 -0500 received badge  Popular Question (source)
2017-10-25 06:31:11 -0500 received badge  Popular Question (source)
2017-10-25 06:26:33 -0500 asked a question ROS_MASTER_URI set, but program gives related error.

ROS_MASTER_URI set, but program gives related error. Hello, I have ubuntu 14.04 , Ros indigo and Gazebo 2.2.6. I am runn

2017-10-18 03:47:48 -0500 commented question How to get ROS control kinematics equation?

Much simpler than that. It is something like rrbot, here http://gazebosim.org/tutorials/?tut=ros_urdf#GettingRRBot

2017-10-18 02:12:14 -0500 received badge  Popular Question (source)
2017-10-17 11:50:55 -0500 asked a question How to get ROS control kinematics equation?

How to get ROS control kinematics equation? I am using ros control to move a simulated model, on Gazebo. Is there a way

2017-10-12 16:05:42 -0500 commented question Fail to run hector_gazebo_plugins OSX 10.9

Do you remember If you found what the problem was? I am having exactly the same error message when I try to connect 4dia

2017-09-21 16:16:40 -0500 asked a question Nothing happens when I rosrun controller_manager list

Nothing happens when I rosrun controller_manager list I am trying to figure out why my robot isn't moving in gazebo. I a

2017-09-08 10:20:06 -0500 received badge  Notable Question (source)
2017-09-07 11:42:59 -0500 marked best answer Can sw_urdf_exporter be intalled in ubuntu?

Hello, I want to use sw_urdf_exporter but I see that the installation guide concerns Windows users only. The problem is, I don't have Windows on my computer. Should I compile the source code with a C# compiler other than Visual Studios? Should I run the .exe in VirtualBox?

2017-09-07 11:42:59 -0500 received badge  Scholar (source)
2017-09-07 11:32:21 -0500 asked a question Can sw_urdf_exporter be intalled in ubuntu?

Can sw_urdf_exporter be intalled in ubuntu? Hello, I want to use sw_urdf_exporter but I see that the installation guid

2017-06-14 15:27:04 -0500 received badge  Popular Question (source)
2017-06-12 17:01:37 -0500 asked a question Cpp error: expected initializer before ‘:’ token

Cpp error: expected initializer before ‘:’ token Hello, I am using Ubuntu 14.04 and ROS Indigo with Gazebo 2.2.6. I am t

2017-05-28 09:25:17 -0500 received badge  Enthusiast
2017-05-28 09:25:17 -0500 received badge  Enthusiast
2017-05-26 11:56:01 -0500 received badge  Supporter (source)
2017-05-26 11:32:18 -0500 commented question ros_control: Difficulty getting custom hardware interface to run

hello, what needs to be added in cyborg-x1's example so that the robot can move? Can I add rostopic commands into the pr

2017-05-12 09:34:41 -0500 received badge  Famous Question (source)
2017-05-11 10:44:27 -0500 edited question Error while building simple code from gidhub

Error while building simple code from gidhub I am trying to build this program https://github.com/ros-controls/ros_cont

2017-05-11 10:41:36 -0500 edited question Error while building simple code from gidhub

Error while building simple code from gidhub I am trying to build this program https://github.com/ros-controls/ros_cont

2017-05-11 10:06:36 -0500 edited question Error while building simple code from gidhub

Error while building simple code from gidhub I am trying to build this program https://github.com/ros-controls/ros_cont

2017-05-11 10:05:51 -0500 edited question Error while building simple code from gidhub

Error while building simple code from gidhub I am trying to build this program https://github.com/ros-controls/ros_cont

2017-05-11 10:05:12 -0500 received badge  Editor (source)
2017-05-11 10:05:12 -0500 edited question Error while building simple code from gidhub

Error while building simple code from gidhub I am trying to build this program https://github.com/ros-controls/ros_cont

2017-05-11 10:03:14 -0500 commented question Error while building simple code from gidhub

I have added the executables. Sorry for tha delay. Thanks in advance

2017-05-11 10:02:34 -0500 edited question Error while building simple code from gidhub

Error while building simple code from gidhub I am trying to build this program https://github.com/ros-controls/ros_cont