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

Ana's profile - activity

2013-08-22 11:02:17 -0500 received badge  Famous Question (source)
2013-06-12 08:45:49 -0500 received badge  Necromancer (source)
2013-06-12 08:45:49 -0500 received badge  Teacher (source)
2012-11-26 15:07:45 -0500 received badge  Notable Question (source)
2012-11-26 12:45:52 -0500 received badge  Good Question (source)
2012-11-26 07:27:06 -0500 commented answer Assigning namespaces for topics from Kinect (Turtlebot)

Done. Thank you very much for the suggestion.

2012-11-26 07:26:33 -0500 received badge  Popular Question (source)
2012-11-26 02:37:33 -0500 received badge  Nice Question (source)
2012-11-25 14:59:11 -0500 commented answer Different cmd_vel msgs to multiple robots on Gazebo

In case somebody else still has the problem, I think I got a workaround: http://answers.ros.org/question/33981... (I am commenting here since I found both threads with the same question, not sure which one to post on)

2012-11-25 14:50:09 -0500 answered a question Multiple Turtlebots in Gazebo

Hi. I am also working with 2 Turtlebots in Gazebo (ROS Fuerte). I was able to separate both /cmd_vel and /odom topics. Here is what I did:

Go to gazebo_ros_create.h and add a new private variable:

std::string robot_namespace_;

Go to gazebo_ros_create.cpp. Add the following lines in the function GazeboRosCreate::Load (I added it around line 56)

this->robot_namespace_ = "";
if (_sdf->HasElement("robotNamespace")) { 
  this->robot_namespace_ = _sdf->GetElement("robotNamespace")->GetValueString() + "/";
}

With that line you are getting the namespace you assigned for the nodes (in my case turtle_1 and turtle_2). Modify the line corresponding to node_namespace in order to add the robotNamespace String on it:

this->node_namespace_ = "";
if (_sdf->HasElement("node_namespace")) {
  this->node_namespace_ = this->robot_namespace_ + _sdf->GetElement("node_namespace")->GetValueString() + "/";
}

Now go down and find the lines in which you subscribe/advertise the topics /cmd_vel, /odom and /sensor_state and change them to local names cmd_vel, odom and sensor_state. The lines should now look like this:

cmd_vel_sub_ = rosnode_->subscribe("cmd_vel", 1, &GazeboRosCreate::OnCmdVel, this );

sensor_state_pub_ = rosnode_->advertise<turtlebot_node::TurtlebotSensorState>("sensor_state", 1);
odom_pub_ = rosnode_->advertise<nav_msgs::Odometry>("odom", 1);
joint_state_pub_ = rosnode_->advertise<sensor_msgs::JointState>("joint_states", 1);

Finally, rosmake the package (make sure that you generate a new library, erase the ROS_NOBUILD if needed (otherwise the library won't be compiled and your changes won't be effective)

Hope it helps. If you found other way to work around this (other than editing the source code), please let me know.

Thanks!

Ana

2012-11-24 14:03:07 -0500 received badge  Student (source)
2012-11-24 13:58:55 -0500 received badge  Editor (source)
2012-11-24 13:58:15 -0500 asked a question Assigning namespaces for topics from Kinect (Turtlebot)

Hi,

I am doing a simulation with 2 Turtlebots in Gazebo (using ROS Fuerte). I used different namespaces (turtle1 and turtle2) for each robot in order to get their respective data. However, I noticed that some of the topics (topics with Kinect info) did not change their names. For instance after using this snippet:

<group ns="turtle2">
  <include file="$(find tortuninja)/launch/turtlebotNodes.launch" >
    <arg  name="model_name" value="turtle2" /> 
    <arg name="x" value = "-2.0" />
  </include>
</group>

Topics like /imu/data would become accordingly /turtle2/imu/data. But for others like /camera/depth/points I would still get /camera/depth/points.

I fixed the problem by editing the file ($find turtlebot_description)/urdf/gazebo.urdf.xacro . I changed the global topic names like /camera/depth/points to local ones camera/depth/points. After doing that I was able to get the corresponding namespace in front (and get info from both Kinects).

My question is: Is this the right approach? Or is there any other way to change the namespace for Kinect-topics in Turtlebot other than editing the gazebo.urdf.xacro file?

Thanks!

Ana