Re: [ros-users] two robot_state_publishers?

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: User discussions
Date:  
To: wim, User discussions
Subject: Re: [ros-users] two robot_state_publishers?
Thanks for the tips. I gave it a second try and things seem to be working fine now. I think it was just a tf issue. I needed to add a transform between the robot and sim trees.

    tf::Transform transform;
    transform.setOrigin( tf::Vector3(0, 0, 0) );
    transform.setRotation( tf::Quaternion(0, 0, 0, 1) );
    br.sendTransform(tf::StampedTransform(transform, 
                                          ros::Time::now(), 
                                          "worldBase", 
                                          "robot/base"));
    br.sendTransform(tf::StampedTransform(transform, 
                                          ros::Time::now(), 
                                          "worldBase", 
                                          "sim/base"));


Also, how can I provide a tf prefix for the /robot_description parameter? Now, my Robot Model in rviz doesn't display my robot because of this error: "No transform from [base] to [/worldBase]".

Thanks,
-Ben


-----Original Message-----
From: [mailto:ros-users-bounces@code.ros.org] On Behalf Of Wim Meeussen
Sent: Monday, October 18, 2010 2:40 PM
To: User discussions
Subject: Re: [ros-users] two robot_state_publishers?

Ben,

Are you saying that the second robot state publisher does not connect
to the 'sim_joint_states' topic? If that's the case, try to run
'rosnode info sim_state_publisher' and 'roswtf' to see what's going
on. Are you publishing the joint states periodically or just once? If
you publish only once, it is possible that the nodes are not connected
yet when you send that data, and your data will get lost in that case.

Wim



On Fri, Oct 8, 2010 at 9:23 AM, Axelrod, Benjamin <> wrote:
> I am trying to run two robot_state_publisher nodes in parallel.  My
> publications do not seem to be getting to the second one.  Here is some
> info:
>
>
>
> Here is a part of my launch file:
>
>
>
>   <param name="robot_description" textfile="$(find foo)/bar.urdf" />
>
>
>
>   <node name="robot_state_publisher" pkg="robot_state_publisher"
> type="state_publisher" output="screen" >
>
>     <param name="tf_prefix" value="robot" />
>
>   </node>
>
>
>
>   <node name="sim_state_publisher" pkg="robot_state_publisher"
> type="state_publisher" output="screen" >
>
>     <remap from="joint_states" to="sim_joint_states" />
>
>     <param name="tf_prefix" value="sim" />
>
>   </node>
>
>
>
> And here are my publishers:
>
>     joint_pub_ = handle_.advertise<sensor_msgs::JointState>("/joint_states",
> 1);
>
>     sim_joint_pub_ =
> handle_.advertise<sensor_msgs::JointState>("/sim_joint_states", 1);
>
>     ...
>
>     joint_pub_.publish(joint_state_);
>
>     sim_joint_pub_.publish(sim_joint_state_);
>
>
>
> In rxgraph, I don't see any connections going into the second
> robot_state_publisher (named sim_state_publisher).  Am I missing something?
> I am using Boxturtle, are there some features listed in the wiki that aren't
> in this version?
>
>
>
> Thanks,
>
> -Ben
>
>
>
>
>
> Ben Axelrod
>
> Research Scientist
>
> iRobot Corporation
>
> 8 Crosby Drive, Mail Stop 8-1
>
> Bedford, MA 01730
>
> (781) 430-3315 (Tel)
>
> (781) 960-2628 (Fax)
>
>
>
>
>
> _______________________________________________
> ros-users mailing list
>
> https://code.ros.org/mailman/listinfo/ros-users
>
>




--
--
Wim Meeussen
Willow Garage Inc.
<http://www.willowgarage.com)
_______________________________________________
ros-users mailing list

https://code.ros.org/mailman/listinfo/ros-users