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

Sentinal_Bias's profile - activity

2023-01-29 14:21:55 -0500 received badge  Nice Question (source)
2022-06-12 02:25:33 -0500 marked best answer Tf tutorial Cpp Question

The following is code from the TF cpp broadcaster tutorial. As i understand you are subscribing to a turtlesim topic/pose

In the callback function you are meant to give a pointer to the message

void poseCallback(const turtlesim::PoseConstPtr& msg){

I am wondering how do we find the name of such pointers? i checked the code api namespace and the pointer isn't listed...? http://ros.org/doc/groovy/api/turtlesim/html/namespaceturtlesim.html

I also checked the header file turtlesim.h

I prefer to know how to find these things independently using the Code API or wiki documentation, but I am kind of new to ROS

#include <ros/ros.h>
#include <tf/transform_broadcaster.h>
#include <turtlesim/Pose.h>

std::string turtle_name;
void poseCallback(const turtlesim::PoseConstPtr& msg){
  static tf::TransformBroadcaster br;
  tf::Transform transform;
  transform.setOrigin( tf::Vector3(msg->x, msg->y, 0.0) );
  transform.setRotation( tf::Quaternion(msg->theta, 0, 0) );
  br.sendTransform(tf::StampedTransform(transform, ros::Time::now(), "world", turtle_name));
}

int main(int argc, char** argv){
  ros::init(argc, argv, "my_tf_broadcaster");
  if (argc != 2){ROS_ERROR("need turtle name as argument"); return -1;};
  turtle_name = argv[1];

  ros::NodeHandle node;
  ros::Subscriber sub = node.subscribe(turtle_name+"/pose", 10, &poseCallback);

  ros::spin();
  return 0;
};
2021-04-29 17:38:40 -0500 received badge  Famous Question (source)
2021-02-15 16:07:56 -0500 received badge  Great Question (source)
2020-07-19 15:37:47 -0500 received badge  Good Question (source)
2019-09-25 19:39:22 -0500 received badge  Nice Question (source)
2019-09-21 14:45:38 -0500 received badge  Good Question (source)
2019-03-28 15:26:32 -0500 received badge  Famous Question (source)
2017-09-27 06:15:51 -0500 marked best answer rospy subscriber buffer length

Hi

This is from the C++ subscriber tutorial

   * The second parameter to the subscribe() function is the size of the message
   * queue.  If messages are arriving faster than they are being processed, this
   * is the number of messages that will be buffered up before beginning to throw
   * away the oldest ones.
   */
  ros::Subscriber sub = n.subscribe("chatter", 1000, chatterCallback);

In the python tutorial it is

rospy.Subscriber("chatter", String, callback)

//This declares that your node subscribes to the chatter topic which is of type std_msgs.msgs.String. When new messages are received, callback is invoked with the *message as the first argument.

I am wondering if the python version supports a message queue?

Also why is the same method different between C++ and Python for instance in the python subscriber you have to declare what type of message you are subscribing to...

Is this because python is an interpreted language?

Also do you find it easier to code in python over C++ in terms of development time for a ROS project?

2017-07-04 04:59:40 -0500 marked best answer debug ros node python

Hi I am new to ROS

how do you debug your ros node, say you code it in python.

Is it possible to use run a ros node in an ide and set break points ect? I saw a link on setting up ide's but they seemed like it was for C++ IDE's

2017-06-20 09:47:14 -0500 received badge  Nice Question (source)
2017-03-05 20:05:16 -0500 received badge  Nice Question (source)
2017-01-14 11:51:58 -0500 received badge  Nice Question (source)
2016-12-28 12:22:31 -0500 marked best answer Importing python module from another ROS package setup.py

Hi

I am trying to import a python module from another ROS package.

My package is utils 
utils
-----/src
------------file_io.py (python module) 
------------__init__.py

I have a node in Package A that wants to import a function in file_io.py

So far I have created a setup.py file for the package utils

    ## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD

from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup

# fetch values from package.xml
setup_args = generate_distutils_setup(
    packages=['utils'],
    package_dir={'': 'src'},
    requires=['roscpp', 'rospy', 'tf']
)

setup(**setup_args)

In my cmakeList file I made the following changes

install(PROGRAMS src/file_io.py
    DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})

and uncommented #catkin_python_setup()

In the package.xml of package A, I made the utils package a build and run dependency, modified the cmakList of package A and added the package utils to the find_package(catkin required COMPONENTS).

from utils.file_io import extractor results in the import error: No module name file_io.

Am I missing something? To be honest I did not really understand the tutorial, I am kind of new to python.

As I understand in order to import a python module it has to be in your python path, I thought this setup thing was meant to make ROS automatically add the files to the python path of any package that depends on utils...

2016-08-17 09:19:03 -0500 received badge  Famous Question (source)
2016-07-14 06:22:19 -0500 received badge  Famous Question (source)
2016-06-08 14:15:45 -0500 marked best answer gmapping without /odom

Hi

Is it possible to use gmapping without odometry information

In the Hector Slam tutorial it says if you do not require the use of a odom frame (for example because your platform does not provide any usable odometry) you can directly publish a transformation from map to base_link:

  http://www.ros.org/wiki/hector_slam/Tutorials/SettingUpForYourRobot
<param name="pub_map_odom_transform" value="true"/>
<param name="map_frame" value="map" />
<param name="base_frame" value="base_frame" />
<param name="odom_frame" value="base_frame" />

Is it possible to do the same with gmapping?

however I try the same in the gmapping launch file and nothing works. The map initial generates but when i move the kinect (which is the body of the rover) it doesn't update the position of the kinect...

I thought gmapping would use some kind of 2D ICP with the laser scan, i don't see why you need odometry information, though it should help.

It RIVZ there is no transform from odom to base_frame so i presume gmapping just created an odom frame and didn't use the base_frame as the odom frame

2016-04-12 07:37:20 -0500 received badge  Necromancer (source)
2016-03-07 00:50:55 -0500 received badge  Famous Question (source)
2016-03-02 18:22:32 -0500 received badge  Notable Question (source)
2016-01-20 10:08:14 -0500 marked best answer sync ros bag timestamps with ros system

Currently I am publishing frames from a ROS bag file, using recorded timestamps. When I try a publish a pointcloud using from a current node. Frames do not exist to publish the topic, this is because the frames are being broadcast from a bagfile and hence have old time stamps.

One solution was the re-write the timestamps in the bag files and then play them. However by the time you parse and re-write the bag files and play them the time stamps will be too old again.

I am wondering if there was a way to force the ROS system time to equal the earliest time in the bagfile, once the bag file play command is given?

My current idea, to publish a time stamp message from the ROS bag file. Then all nodes will subscribe to this, therefore when something is published from my nodes, it can refer to the bagfile time stamp. This method would fall apart when you are rely on third party nodes to publish certain things eg pcd2pointcloud node.

Another method, would be to figure out the offset in time between the current time and the bagfile time, therefore you could publish a pointcloud to the correct time. This method would mean you cannot play the bagfile at half speed.

2015-12-06 12:22:21 -0500 received badge  Notable Question (source)
2015-12-05 04:57:52 -0500 received badge  Popular Question (source)
2015-12-04 15:37:11 -0500 asked a question ROS Repositories by Organisation

Hi

I remember seeing a wiki article which broke down ROS packages by organisation. For example several universities had some ROS repositories and there was a link to them.

Was this on this page http://wiki.ros.org/Repositories?

I personally found it useful to get links to repositories by Organisation. Because you could explore what work was being done by a university.

Currently its a bit overwhelming searching through all ROS packages.

I would be happy to help maintain such a page.

Edit: Ok I see that was the page I remembered. But it wasn't really grouped by organisation it was just a list of packages

However I noticed, I couldn't search for a lot of the packages on the original page for example. I could not find: berkeley-ros-pkg or the mit ros packages.

2015-06-19 10:03:56 -0500 marked best answer turtlebot Failed to open port /dev/ttyUSB0

Hi

I am using a USB to serial (TTL logic level) FDTI cable to connect to the robot-icreate. I have checked the cable using minicom first using a loopback test and then i connected it to the create and when i turned it on i received some messages which were not gibberish.

I have looked at other forum post and tried what they suggested but nothing seems to work. When i try and launch turtlebot_bringup minimal.launch

it complains that it cannot connect to /dev/ttyUSBO. I used the same cable on my friends computer and it connects to the turtlebot

Ubantu12.04 fuerte 64bit
lsusb:
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:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 003 Device 002: ID 045e:0084 Microsoft Corp. Basic Optical Mouse
Bus 001 Device 005: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC

edit i have tested my system with the following drivers http://www.ros.org/wiki/irobot_create_2_1 (which work) however the turtlebot mimal.launch file does not work

ATTRS{idProduct}=="6001",ATTRS{idVendor}=="0403",MODE="666",GROUP="dialout"

in /etc/udev/rules.d/52-turtlebot.rules