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

djsw's profile - activity

2019-07-01 12:54:47 -0500 received badge  Student (source)
2019-05-07 11:49:25 -0500 received badge  Great Answer (source)
2018-12-21 07:14:20 -0500 received badge  Good Answer (source)
2017-11-28 16:21:13 -0500 received badge  Nice Answer (source)
2017-10-16 04:24:49 -0500 received badge  Famous Question (source)
2017-10-16 04:24:49 -0500 received badge  Notable Question (source)
2016-10-31 06:05:56 -0500 received badge  Famous Question (source)
2016-05-11 04:53:49 -0500 received badge  Notable Question (source)
2016-04-18 00:23:03 -0500 answered a question Call to publish() on an invalid Publisher

Has the publisher been initialised? This is an error I recently ran into, and from memory, this error will be thrown if you try to publish on a publisher that has been declared as a class variable, but not initialised either in the constructor or in the function body. If it's initialised in the constructor and the instance of the class is in a different scope to the call to publish(), that will also cause this error (say if you construct your instance in your main loop but try to call publish from a subscriber callback).

2016-04-13 02:19:14 -0500 received badge  Popular Question (source)
2016-04-12 18:07:32 -0500 commented question Rosbridge: Could not process inbound connection

I've edited the question to include them.

2016-04-12 18:07:16 -0500 received badge  Editor (source)
2016-04-12 01:50:44 -0500 received badge  Organizer (source)
2016-04-12 01:50:04 -0500 asked a question Rosbridge: Could not process inbound connection

I'm trying to implement a web server to initiate a trigger to ROS, but the way I've done it (consistent with the tutorials) seems to be causing a lot of info and warning messages. I have a button that reloads the page and sets ?button=true in the URL, and if the variable is set, the page publishes a message.

The problem is that every time it evaluates to true, the connection has to be made again, causing a delay of around 2 seconds. If I include the connection information outside of the statement evaluation, I get a series of warning messages and the messages will cease to publish when I expect them to. Am I going about this the right way?

The messages upon reloading the page are expected, since the page would be disconnecting and reconnecting to the rosbridge socket:

[INFO] [WallTime: 1460502279.235987] Client disconnected. 0 clients total.
[INFO] [WallTime: 1460502279.307687] Client connected.  1 clients total.

And the warning I receive when reloading the page but not publishing a messge:

[WARN] [WallTime: 1460502367.962932] Could not process inbound connection: [/rosbridge_websocket] is not a publisher of [/webtrig]. Topics are [['/rosout', 'rosgraph_msgs/Log']]{'message_definition': '\n', 'callerid': '/master', 'tcp_nodelay': '0', 'md5sum': 'd41d8cd98f00b204e9800998ecf8427e', 'topic': '/webtrig', 'type': 'std_msgs/Empty'}

This warning will be repeated about five times.

2016-03-30 19:03:42 -0500 received badge  Famous Question (source)
2016-03-30 19:03:42 -0500 received badge  Notable Question (source)
2016-03-15 16:16:29 -0500 received badge  Teacher (source)
2016-03-15 16:16:29 -0500 received badge  Self-Learner (source)
2016-03-15 13:57:02 -0500 received badge  Famous Question (source)
2016-02-24 03:08:56 -0500 received badge  Popular Question (source)
2016-02-23 22:17:50 -0500 answered a question Can't set up keys - server times out

Despite the fact that this issue persisted for a week, I tried again today and I did not receive this error. I assume it's the server's fault and there are just days at a time where you can't install ROS.

2016-02-21 04:20:58 -0500 asked a question Can't set up keys - server times out

I'm installing ROS Indigo on a fairly fresh install of Ubuntu 14.04. I try to do step 1.3 and:

sudo apt-key adv --keyserver hkp://pool.sks-keyservers.net --recv-key 0xB01FA116

Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.iYA2SKI7oY --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d/webupd8team-y-ppa-manager.gpg --keyserver hkp://pool.sks-keyservers.net --recv-key 0xB01FA116

gpg: requesting key B01FA116 from hkp server pool.sks-keyservers.net

gpg: keyserver timed out

gpg: keyserver receive failed: keyserver error

Googling hasn't helped and previous answers on this forum are outdated. I tried to install it a week ago and I got the same error. Any ideas?

2016-02-17 19:38:27 -0500 received badge  Famous Question (source)
2016-02-04 01:07:47 -0500 received badge  Notable Question (source)
2016-02-03 17:14:23 -0500 commented answer Subscribing to templated message type

Turns out it was a silly mistake. Thanks for the answer.

2016-02-03 16:58:04 -0500 commented answer Subscribing to templated message type

It's not a scope issue - the class subscribes to two topics: one subscriber is const typename T::ConstPtr& and one is const std_msgs::Empty::ConstPtr&, and the second subscriber does exist. I checked with rqt_graph and rostopic info and the first subscriber does not exist.

2016-02-03 16:47:44 -0500 received badge  Popular Question (source)
2016-02-02 21:42:36 -0500 asked a question Subscribing to templated message type

I have a templated class that accepts a message type as a parameter and a topic as an argument. I define the subscriber in the constructor:

    subscriber = n.subscribe(sub_topic, 1000, &TemplatedClass::callbackFunction, this);

and the callback function is defined as:

template<class T>
void TemplatedClass<T>::callbackFunction(const typename T::ConstPtr& incoming_msg) 
{
     ...
}

But the callback function is never called. When I subscribe to the topic from main using a subscriber that isn't from a templated class, the callback function is called, so the topic is being published to. I considered that it could be that the signature const typename ... might be causing issues, but of course the program won't compile without typename. Any ideas?


Turns out the issue was that I'd instantiated two subscribers in my constructor, but forgot to adjust the name of the second one. I had:

    subscriber1 = n.subscribe(sub_topic1, 1000, &TemplatedClass::callbackFunction1, this);
    subscriber1 = n.subscribe(sub_topic2, 1000, &TemplatedClass::callbackFunction2, this);

so subscriber1 was being overwritten and subscriber2 was never defined. My code was otherwise right, so I'm leaving it here in case anybody else needs the syntax for subscribers in templated classes.

2016-01-29 09:51:51 -0500 received badge  Popular Question (source)
2016-01-14 18:28:12 -0500 received badge  Enthusiast
2016-01-13 00:11:42 -0500 received badge  Scholar (source)
2016-01-13 00:11:41 -0500 commented answer Echoing custom messages over SSH error

I made a package specifically to hold the message I was using, then copied it across to my master and built the package (i.e., "install the custom message on the master machine"). This fixed the problem.

2016-01-12 18:30:01 -0500 asked a question Echoing custom messages over SSH error

I have a node running on an embedded platform publishing a custom message (just a float32[]). I have a ros master running on a different machine, and both ROS_MASTER_URIs and ROS_IPs are set correctly. On the master machine, if I run rostopic echo <topic>, I get:

 ERROR: Cannot load message class for [<package>/<msg>]. Are your messages built?

If I ssh into the embedded platform and run a rostopic echo <topic>, I get the data printed out.

I think I understand why it's not working - I haven't sourced the workspace on the embedded platform from the master - but I don't know the solution to this problem, since I want to be able to run nodes on multiple platforms, including the master.

2016-01-08 10:16:58 -0500 received badge  Notable Question (source)
2016-01-08 01:01:41 -0500 received badge  Popular Question (source)
2016-01-08 00:52:52 -0500 answered a question ImportError: No module named rospy

I worked out what the problem was.

I wanted access to the Raspberry Pi GPIO ports, so I had used launch-prefix="sudo" in my launch file. What this meant was that the file was launched in the root workspace which wasn't set up to use ROS. There is apparently a workaround that I wasn't able to get to work.

So my problem was solved by removing that from the launch file.

In case anybody finds this on google, I can use the GPIO ports in a ROS node by running pigpio. Some googling will produce an example script but this is either out-of-date or wrong - use the examples on the site.

2016-01-06 19:37:44 -0500 asked a question ImportError: No module named rospy

When I roslaunch my node, the error I receive is

ImportError: No module named rospy

But when I open up the python environment and run import rospy, it imports successfully and I can access rospy.__file__, which returns

/opt/ros/indigo/lib/python2.7/dist-packages/rospy/__init__.pyc

which is on my PYTHONPATH:

declare -x PYTHONPATH="/usr/lib/python2.7/dist-packages:/home/<user>/indigo_ws/devel/lib/python2.7/dist-packages:/opt/ros/indigo/lib/python2.7/dist-packages"

I do have a custom installation of Python that seems to have messed up some catkin_pkg installation, which is why it's had to be appended to the path. When I remove it to run roslaunch as a debug, I just get the same error.

Running Ubuntu 14.04 on a Raspberry Pi, if that helps.