Hi!
I am running Ubuntu 12.04 with ROS Hydro on my workstation through VMware Workstation 12. This is connected to the robot with ROS Hydro as well.
I have been successful in running talker/listener examples between my workstation and robot, have been successful in joystick teleop control from my workstation to the robot. However, I have been unable to view the USB camera. My run code is `rosrun image_view image_view image:=/camera/image_color compressed`. A white box just pops out.
Doing `lsusb`shows the device
Bus 002 Device 005: ID 1e10:2004 Point Grey Research, Inc. Sony 1.3MP 1/3" ICX445 IIDC video camera [Chameleon]
Bus 005 Device 002: ID 2341:8036
Bus 007 Device 002: ID 1546:01a6 U-Blox AG
Bus 007 Device 003: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
However, I have been unable to get any response from my workstation with `rostopic echo /tf`, despite `/tf` showing up amongst a long list with `rostopic list`
I have tried changing the IP addresses and Hostname setup to rectify the issue, but have been unsuccessful. Here is my network setup with `nano .bashrc`
#export ROS_IP=192.168.1.51
#export ROS_MASTER_URI=http://192.168.1.105:11311
export ROS_IP=192.168.1.51
export ROS_MASTER_URI=http://CPR-SMIT03:11311
and with `nano /etc/hosts`
127.0.0.1 localhost
127.0.1.1 ubuntu
192.168.1.105 CPR-SMIT03
#The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
Is there any restrictions that was brought about through the use of VMware Workstation? Would be nice to have any advice on the issue I have on hand, as well as have any suggestions on solving my problem. I have been unable to use the camera with Skype due to the lack of driver suport, so unable to test if it's a functioning camera.
↧
Unable to echo rostopic on VMware Workstation 12
↧
Is it possible to use a certain data value of a topic for executing some code?
Hello, i will try to be as clear as possible.
I have a ROS topic in which are published only 0 and 1. In another node i have a subscriber that is subscribed to that topic. Then i had an idea to implement a callback function, that as some code to execute inside, that is called by the subscriber.
Let's say that every ten data valued 1 a data valued 0 will show up in the topic.
So my question is, is it possible to execute the code inside the callback function only when the subscriber reads 0 in the topic?
I mean with a sort of if(...) {...} mechanism or something similar.
I apologize if it's not clear, i can provide other details or explanations; just let me know.
Thank you in advance!
EDIT: here is the correct code of the callback function that i mentioned in the comment:
void orderCallback(const std_msgs::Bool::ConstPtr& msg)
{
if (msg->data == 0)
{
chdir("/home/marco/catkin_ws/src/heart_rate_monitor");
system("get_hrv -R my_data_file.txt >doc.txt");
}
}
↧
↧
running rosmsg show from code
Hi,
is there a way (possibly in Python) to call the command line command `rosmsg show` from code, passing as an argument the name of the message/service and getting an object representing the message/the class with the message structure? I know that some commands can be called from `rospy` (as `rostopic list`, for example), but I can't find how to run `rosmsg`.
↧
How do I parse rostopics from a ros bag in C++?
I want to write a node that would parse a ros topic given as the input argument and display the message published by it.
Can you please give me leads to point to existing examples that I could look into?
↧
How to pass topic names as input argument in the command line terminal?
Hello !
I have a problem that states "Read a rosbag, to parse a topic, that is passed as an input argument"
How do I pass the input argument using "rosrun" in the command line terminal?
My code snippet:
#include
#include i
#include
using namespace std;
void topicCallBack(const sensor_msgs::PointCloud2::ConstPtr&msg)
{
cout<<"Reading message of type PointCloud2\n"<header;
if(msg->width)
cout<< "\nInpoint Cloud\nwidth is"<width;
//THIS LINE WILL NOT WORK AS MSG IS OF TYPE POINT CLOUD
if(msg->transforms.transform.translation)
cout<< " reading message of type TF\n";
}
int main(int argc, char **argv)
{
ros::init(argc, argv,"parser");
ros::NodeHandle nh;
//intializing the subscriber
ros::Subscriber sub = nh.subscribe("/camera/depth/points",1000, topicCallBack);
ros::spin();
return 0;
}
Here I have given my topic name as "/camera/depth/points" which publishes the message of type sensor_msgs/PointCloud2. But in my command line terminal, if I pass the topic name as "/tf", how do I ask it to publish the message of type tf/tfMessage because the subscriber is of type PointCloud2?
In total, I have three topics that publish messages of type PointCloud2, tf, odom messages. But I am not able to see, how to pass different topic names in the command line argument and publish the respective message type
Thanks!
↧
↧
When using rostopic list only two topics are shown
I'm just starting to use ROS, so this must be really simple, but when I use rostopic list I get the following output:
turtlebot@m01:~$ rostopic list
/rosout
/rosoutagg
When my expected output is:
/odom
/mobile_base/commands/velocity
/mobile_base/commands/sound
/mobile_base/commands/reset_odometry
/mobile_base/sensors/bumper_pointcloud
/mobile_base/events/cliff
/camera/rgb/image_color/compressed
/scan
What can be causing this?
↧
What would be the best way to get messages of different topics(with time-synchronization))
I have to parse desired topics and get messages for a topic using time synchronization. I have been asked to clear all data-structures.
My understanding of this is, as we pass the topic name as the input argument, I am writing a callback that will publish the message relevant to the topic passed as the input argument. What kind of a data structure should I use?
**Method**: Create a class that has functions to a)parse the topic name, b)get corresponding messages, c) Other functionalities like time synchronization. Clear the object of this class after every publication.
What are your reviews on this? Am I missing something?
↧
How can I know the AR.Drone's height in order to control it?
I tried for getting the value of **"altd"** in /ardrone/navdata and what ever the position of the drone and even the state of drone like flying, landing, landed.. etc the **"altd"** value is always zero. I want to use this value for many things so please someone help me in getting the height of the drone.
Below is the screenshot of navdata of my drone when subscribed to /ardrone/navdata topic:
http://i58.tinypic.com/29wr2au.png
↧
Unable to echo rostopics
I have a workstation(hostname ubuntu) at 192.168.1.51, a machine(hostname CPR-SMIT03) at 192.168.1.105
I am able to teleop the machine with a joystick from my workstation. The publish/listener tutorial also works fine both ways.
However, I am unable to rostopic echo /tf
or any other topics for that matter, despite being able to run rostopic list
on the workstation.
On my machine, I could run both commands. I have read the pre-existing threads about being able to list rostopics but unable to echo them, but I they haven't helpful enough for me. Looking really for more instructive guidance.
On my workstation's .bashrc:
export ROS_IP=192.168.1.51
export ROS_MASTER_URI=http://192.168.1.105:11311
In my workstation's /etc/hosts:
127.0.0.1 localhost
127.0.1.1 ubuntu
192.168.1.105 CPR-SMIT03
On my machine's .bashrc:
export ROS_IP=192.168.1.105
export ROS_MASTER_URI=http://192.168.1.105:11311
In my machine's /etc/hosts:
127.0.0.1 localhost
127.0.1.1 CPR-SMIT03
192.168.1.51 ubuntu
↧
↧
rostopic pub geometry_msgs/PoseArray example
Can anybody give me an example of geometry_msgs/PoseArray message using rostopic pub? I keep on getting errors when i try and interpret the syntax from the ROS documentation, a solid example would be really helpful.
Thanks!
↧
rostopic pub multiarray
Quick question, how do I publish a multiarray? I use rostopic a lot, and its tremendously helpful. One thing I was never able to figure out, was how publish a multiarray(I also wasn't able to find a post on it).
This is the format it provides:
rostopic pub /topic_name std_msgs/Float32MultiArray "layout:
dim:
- label: ''
size: 0
stride: 0
data_offset: 0
data:
- 0"
That can publish a single element multiarray, but I couldn't figure out how to add another element on that array.
I've tried...
rostopic pub /topic_name std_msgs/Float32MultiArray "layout:
dim:
- label: ''
size: 0
stride: 0
data_offset: 0
data:
- [0.0, 1.0]"
and a bunch of other variants, but nothing works. If someone can help with the syntax, that would be appreciated!
↧
ROS with CAN μc
Hallo all,
I have two nodes in ROS which can receive (1st node) and transmit (2nd node) CAN messages over a Peak CAN USB Interface. My receive node receives CAN message from μc board, with rostopic pub command line tool I could able to send a CAN message to μc board which turn on LED on μc board.
My question is: if the received CAN message is with particular ID (which is published on receive topic)- which should send other CAN message to μc board to turn LED ON. Both the transmit and receive node have their own topics. Could anyone please suggest how to send a CAN message from ROS to μc board as soon as it receives from μc board to ROS.
↧
Compability ROS messages
Hi. I have Indigo on my Machine1 and Jade on my Machine2. I recorded a bag of messages under Indigo and I wanted to reuse this bag in Jade.When I try to listen to the topic in which I publish the messages, I got the following error.

I know it must have something to do with the version incompability or the fact that the messages are created on different machines.
Does anyone of you have a solution to this problem. Or an idea to convert the messages in order to satisfy the compability.
Thanks in advance !

I know it must have something to do with the version incompability or the fact that the messages are created on different machines.
Does anyone of you have a solution to this problem. Or an idea to convert the messages in order to satisfy the compability.
Thanks in advance !
↧
↧
active/connected rostopics to terminal list or file
Is there a way to get the active or connected (i.e. excluding leaf topics) ROS topics as a list to the terminal or a text file? The topics can limited to only the active topics from `rqt_graph` but are there any methods the `rostopic` or `rosnode` (or combination of the two) commands can generate a list? Can `rqt_graph` save the active topics or log them?
↧
ROS-i ABB driver - publish more than 6 variable through /joint_states
Dear all,
I am basically trying to send the translational and rotational positions of the tip (total 7 float variables) from RAPID to the ROS as a ros topic. I was thinking of using the /joint_states topic's velocity and acceleration vectors to contain these variables. The end result that I expect will be the /joint_states topic publishing the 6 out of 7 variables as a position vector element and the last variable as first element in velocity.
However, I cannot seem to send more than 6 variable (I tried to pack more raw data beyond 6) using the send_msg function in the ros-i abb's socket module and the ROS_StateServer module. Has anyone done this before? or is there any proper way or guide of publishing to ros from rapid?
Thank you in advance!
---
Edit: Hi gvdhoorn! Thank you so much for the quick, detailed and amazing reply!
Due to the time constraint, I went ahead with the measure 2 and I finally got it working! The issue was indeed the mapping from the ros pc side (industrial_robot_client).
However, the changes in `controller_joint_names` parameter did not work for me (for all robot models). Instead, I went to hard code the `joint_names` variable of `abb_robot_state_node.cpp` file in `abb_driver/src` and it worked out fine for me.
//initial configuration
// std::vector joint_names = rsi.get_joint_names();
//changed configuration
std::vector joint_names;
joint_names.push_back("trans_x");
joint_names.push_back("trans_y");
joint_names.push_back("trans_z");
joint_names.push_back("rot_q1");
joint_names.push_back("rot_q2");
joint_names.push_back("rot_q3");
joint_names.push_back("rot_q4");
Oh by the way, if it does not cause too much trouble for you, could you please tell me where I can do the
> and finally extend the robot_state node to publish a ROS geometry_msgs/Pose (or perhaps a TF frame directly)
of the measure 1?
This is so that I can change the name of rostopic and also cater for other type of messages. I could not find any function or variable that looks like it.
Again Thank you very much!

↧
How to publish topics at specific rate?(Python)
I have 5 topics publishing images at different rates. I want them to publish at the same rate and hence I am trying to set the rostopic hz to a constant rate for all the 5 topics. How can I do it in rospy?
My understanding is that rospy.Rate() will work only for that loop of code. How can I set the rate a which the messages are being published?
Thanks
↧
Using ROSTopicBandwidth.print_bw()
I seem to have some confusion on how to use ROSTopicBandwidth: this is the following code I used
import rostopic
topic = '/absodom'
bandwidth = rostopic.ROSTopicBandwidth(topic)
bandwidth.print_bw()
the last line of code that should print my bandwidth returns None
When I am running my rosbag and type rostopic bw /absodom in the terminal, I can get this number to display, seemingly accurately.
Am I using my print_bw() function incorrectly? I read the API:
http://docs.ros.org/kinetic/api/rostopic/html/rostopic-pysrc.html#ROSTopicBandwidth.print_bw
and I think i am doing this correctly.
the type on my bandwidth variable is a rostopic.ROSTopicBandwidth object so I think I initiated it correctly if nothing else.
↧
↧
How to publish Int16MultiArray from command line?
I have a C++ subscriber that listens for a message composed of a two integers, which I've implemented with a `std_msgs::Int16MultiArray` message type like:
void on_motor_speed(const std_msgs::Int16MultiArray& msg){
///do stuff
}
ros::Subscriber motor_speed_sub("motor/speed", &on_motor_speed);
Is there an easier way to do this?
How do I test this from the command line using `rostopic pub`? Based on [this question](http://answers.ros.org/question/189073/rostopic-pub-multiarray/), I think is should be something like:
rostopic pub motor/speed std_msgs/Int16MultiArray "{layout:{dim:[{label:'', size:0, stride:0}], data_offset:0}, data:[64, 64]}"
but I get the YAML parsing error:
Usage: rostopic pub /topic type [args...]
rostopic: error: Argument error: while scanning a plain scalar
in "", line 1, column 16:
{layout:{dim:[{label:'', size:0, stride:0}], da ...
^
found unexpected ':'
in "", line 1, column 21:
{layout:{dim:[{label:'', size:0, stride:0}], data_of ...
^
Please check http://pyyaml.org/wiki/YAMLColonInFlowContext for details.
As far as I know, YAML does support the inline syntax, and doesn't need to be multi-line. What am I doing wrong?
↧
Speed up 'rostopic list'
Hey there,
I'm running ROS-Base Indigo (Bare Bones) on a low-power computer and I noticed that when I run `rostopic list` it takes ~5 seconds to answer. As expected, also `rostopic pub` take the same amount of time.
Of course, I know the problem is on the computational power of the cpu but my question is if there is any way to speed up `rostopic` commands with, for instance, some kind of cache.
Thanks in advance
↧
Do all messages share a base class?
I would like to create a map of a topic name to a template function that constructs a message in the context of publishing to a topic. Essentially I would be following the pattern described in [this SO post](http://stackoverflow.com/a/582456/1406888).
However, the caveat is that the objects need to share a parent class. I was looking at the header files and it doesn't seem to be the case, but perhaps there is something that I don't see.
Is there a shared parent class for all messages?
↧