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

RafBerkvens's profile - activity

2023-07-18 08:01:20 -0500 received badge  Good Question (source)
2021-08-28 17:10:34 -0500 received badge  Favorite Question (source)
2021-03-11 02:04:32 -0500 marked best answer How to turn off Pioneer 3dx rear sonars using ROSARIA?

I have a Pioneer 3dx mobile robot, which has eight front sonars installed. It is also possible to have eight additional sonars at the rear of the robot, but I don't have these. However, when subscribing to the ROSARIA sonar topic, a distance is published for sixteen sonars, eight of them continuously reporting a distance of 0.

Of course, this is unwanted behavior. I could not find an appropriate parameter on the ROSARIA tutorial page, http://www.ros.org/wiki/ROSARIA/Tutorials/How%20to%20use%20ROSARIA.

What is the correct way to receive only distances on the sonar topic for sonars actually installed?

2021-03-11 02:04:32 -0500 received badge  Self-Learner (source)
2019-10-18 04:35:41 -0500 received badge  Famous Question (source)
2017-08-21 06:42:06 -0500 received badge  Nice Question (source)
2017-04-13 11:56:09 -0500 received badge  Good Question (source)
2016-04-28 07:54:22 -0500 marked best answer How to calculate sensor_msgs/Imu data from IMU sensor

I've got a Shimmer2R module from which I obtain 9 axis: Acceleration X, Y, and Z; Gyroscope X, Y, and Z; and Magnetometer X, Y, and Z.

I would like to transmit this data using standard ROS messages. I found the sensor_msgs/MagneticField messages for the magnetometer. I thought the sensor_msgs/Imu messages would be appropriate for the other data.

However, the Imu message seems to present the data in a different way than how I obtain it. I am unfamiliar with this representation and I'm looking for guidance on how to convert my data to the sensor_msgs/Imu representation. An internet search didn't provide me with any useful pointers.

On a side note, I have also read that to obtain a heading from the magnetometer, the data from the Gyroscope is also necessary. Is there any ROS node that does this calculation?

2016-03-11 06:17:03 -0500 received badge  Great Question (source)
2015-07-29 16:35:59 -0500 marked best answer What is the proper way to create a Header with python?

I seem unable to find what the proper procedure is to fill a std_msgs/Header field in a message using python.

I have found this for C++:

my_message message; // using a std_msgs/Header called header
message.header.stamp = ros::Time::now();
message.header.seq++;

This example builds its own timestamp, increases the sequence number (which was not predefined), and ignores the frame field. Is this correct, and, more importantly, what is the equivalent Python code?

2015-07-21 13:20:16 -0500 marked best answer gscam can no longer be run

I have used gscam for a while and I'm quite happy with it. However, since a week it will no longer start. I get the known 'PAUSED' error, but I don't think any settings have changed. This is the output of running it:

$ rosrun gscam gscam
[ INFO] [1375955831.001182268]: Using gstreamer config from env: "v4l2src 
device=/dev/video0 ! video/x-raw-rgb,framerate=25/1, width=640,height=360 ! ffmpegcolorspace"
[ INFO] [1375955831.004123416]: using default calibration URL
[ INFO] [1375955831.004218662]: camera calibration URL: file:///home/raf/.ros/camera_info/camera.yaml
[ERROR] [1375955831.004328229]: Unable to open camera calibration file [/home/raf/.ros/camera_info/camera.yaml]
[ WARN] [1375955831.004371869]: Camera calibration file /home/raf/.ros/camera_info/camera.yaml not found.
[ INFO] [1375955831.004409639]: Loaded camera calibration from 
[FATAL] [1375955831.121288814]: Failed to PAUSE stream, check your gstreamer configuration.
[FATAL] [1375955831.121384226]: Failed to initialize gscam stream!

The settings of the webcam at dev/video0 are:

$ ls -l /dev/video0
crw-rw-rw-+ 1 raf video 81, 0 aug  7 08:24 /dev/video0

Note that I have read and write permissions set for every user and am myself owner of the device.

I also tried to remove and reinstall gscam, to no avail. Does anyone know what else I can try?

2015-07-21 13:20:15 -0500 received badge  Self-Learner (source)
2015-05-11 04:42:49 -0500 received badge  Notable Question (source)
2015-04-06 19:41:24 -0500 received badge  Popular Question (source)
2015-04-06 16:11:53 -0500 commented question Timer fires all at once

Hi aletoind. The timer is initialized in a subscriber method. I think my design can be improved, but it does the trick for now. I've answered my own question, because I found where I did something wrong. Thanks for thinking with me!

2015-04-06 16:10:17 -0500 answered a question Timer fires all at once

It seems that I simply have been reading the signs wrong. As I said, the Timer callback did a publish, and I looked at the published message to establish the time it was send. However, the time of that message was not updated before it was published. I now update the time of the message with the event's time, solving my issue.

2015-04-06 15:18:46 -0500 asked a question Timer fires all at once

I'm on Ubuntu 14.04 with ROS Indigo. I'm trying to repeat a published message for a few times, with some delay in between. It seemed that a ros::Timer was the tool for the job. However, I'm getting unexpected results. Instead of the timer calling the function once every ros::Duration(0.1), the repetitions are called instantly.

Here's some pseudo code to illustrate the program, I haven't the checked this code:

class MyClass{
  private:
    void myFunction();
    void myTimerCallback(const ros::TimerEvent& event)
    ros::NodeHandle nh_;
    ros::Timer *timer_;
  ...
}

void MyClass::myFunction(){
  ...
  timer_ = new ros::Timer(nh_.createTimer(
    ros::Duration(0.1),
    &MyClass::myTimerCallback, 
    this));
  ...
}

void MyClass::myTimerCallback(const ros::TimerEvent& event){
  // do stuff
}

int main(int argc, char **argv){
  ros::init(argc, argv, "pseudo_timer");
  MyClass my_class;
  ros::spin();
}

What I expect is that myTimerCallback is called once every 0.1 seconds, until I call timer_->stop(). However, what I see is that myTimerCallback is called the number of times I want it to be called in less than 0.001 seconds. In other words, there's no timing whatsoever.

Any ideas on what might be going wrong here?

2015-01-30 05:01:10 -0500 commented answer start and stop rosbag within a python script

I don't fully understand it, but it works for me!

2015-01-23 10:32:40 -0500 marked best answer No gazebo-ros package after update?

After the recent 2.0.0 Gazebo update, I can no longer run gazebo_ros. It has been deinstalled during the update. When trying to install gazebo-ros-pkgs, I get the following output:

The following packages have unmet dependencies:
 ros-hydro-gazebo-ros-control : Depends: ros-hydro-gazebo-ros but it is not going to be installed
 ros-hydro-gazebo-ros-pkgs : Depends: ros-hydro-gazebo-plugins but it is not going to be installed
                             Depends: ros-hydro-gazebo-ros but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

When trying to install the mentioned ros-hydro-gazebo-ros, this is the output:

The following packages have unmet dependencies:
 ros-hydro-gazebo-ros : Depends: gazebo but it is not going to be installed
                        Depends: ros-hydro-gazebo-plugins but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Yet, gazebo is installed and can be run.

Is there something broken in the repository?

EDIT: This issue: https://github.com/ros-simulation/gazebo_ros_pkgs/issues/126 does indeed state a problem in the repository, but it is not released yet. I'm looking for people who have the same problem or have found a workaround.

2014-12-12 14:15:43 -0500 received badge  Famous Question (source)
2014-10-24 18:55:03 -0500 received badge  Notable Question (source)
2014-10-10 08:36:57 -0500 marked best answer Compressed camera images from rosbag to matlab

I have a bag file containing lots of sensor messages, including compressed camera images. I would like to use this stream of camera images in MATLAB.

I know of two possible approaches: either by exporting all images to JPG and load those into MATLAB, or by using ROSMATLAB.

I think that the first approach would involve creating a Python script to collect the camera images form the image_transport node republish. This seems to involve an awful lot of decompressing and compressing (when saving back to JPG), so I'm looking for a way to directly collect the images from the bag file and save those. I believe that the compressed images in the bag file are JPG compressed, so it should be possible to directly map them.

The second approach would also involve the republish node, I think, since ROSMATLAB does not yet seem to support image transport. Also, I've run into problems collecting the images on the subscriber. I've seen this great tutorial on creating an image publisher, but I found it hard to reverse it. I've also seen this question on ROS answers, which does a good job showing some of the basics, but I couldn't replicate it.

Long story short: can anyone provide a best practice to manage images from a rosbag in MATLAB?

2014-10-10 08:36:56 -0500 commented answer Compressed camera images from rosbag to matlab

You can do it without saving to the harddrive using the code sequence discussed in this thread: http://www.mathworks.com/matlabcentral/answers/157391-how-to-convert-a-cell-array-into-an-image.

2014-10-10 06:33:47 -0500 commented answer Compressed camera images from rosbag to matlab

I have written the entire data part from the matlab_rosbag image structure as a binary file called "image.jpg". Next, I loaded that using imread, giving me a valid MATLAB image. This is undoubtedly slow, using a lot of hard drive writing, but it gets me somewhere. Thanks!

2014-10-10 05:58:21 -0500 received badge  Popular Question (source)