GithubHelp home page GithubHelp logo

ros / robot_state_publisher Goto Github PK

View Code? Open in Web Editor NEW
83.0 22.0 163.0 1.07 MB

Allows you to publish the state of a robot (i.e the position of its base and all joints) via the "tf" transform library

Home Page: http://www.ros.org/wiki/robot_state_publisher

License: BSD 3-Clause "New" or "Revised" License

CMake 5.74% C++ 52.55% Python 41.71%

robot_state_publisher's Introduction

Robot State Publisher

This package contains the Robot State Publisher, a node and a class to publish the state of a robot to tf2. At startup time, Robot State Publisher is supplied with a kinematic tree model (URDF) of the robot. It then subscribes to the joint_states topic (of type sensor_msgs/msg/JointState) to get individual joint states. These joint states are used to update the kinematic tree model, and the resulting 3D poses are then published to tf2.

Robot State Publisher deals with two different "classes" of joint types: fixed and movable. Fixed joints (with the type "fixed") are published to the transient_local /tf_static topic once on startup (transient_local topics keep a history of what they published, so a later subscription can always get the latest state of the world). Movable joints are published to the regular /tf topic any time the appropriate joint is updated in the joint_states message.

Examples showing how to pass the robot_description parameter using a launch file are available in the 'launch' subdirectory.

Published Topics

  • robot_description (std_msgs/msg/String) - The description of the robot URDF as a string. Republishes the value set in the robot_description parameter, which is useful for getting informed of dynamic changes to the URDF. Published using the "transient local" quality of service, so subscribers should also be "transient local".
  • tf (tf2_msgs/msg/TFMessage) - The transforms corresponding to the movable joints of the robot.
  • tf_static (tf2_msgs/msg/TFMessage) - The transforms corresponding to the static joints of the robot.

Subscribed Topics

  • joint_states (sensor_msgs/msg/JointState) - The joint state updates to the robot poses. The RobotStatePublisher class takes these updates, does transformations (such as mimic joints), and then publishes the results on the tf2 topics.

Parameters

  • robot_description (string) - The original description of the robot in URDF form. This must be set at robot_state_publisher startup time, or the node will fail to start. Updates to this parameter will be reflected in the robot_description topic.
  • publish_frequency (double) - The maximum frequency at which non-static transforms (e.g. joint states) will be published to /tf. Defaults to 20.0 Hz.
  • ignore_timestamp (bool) - Whether to accept all joint states no matter what the timestamp (true), or to only publish joint state updates if they are newer than the last publish_frequency (false). Defaults to false.
  • frame_prefix (string) - An arbitrary prefix to add to the published tf2 frames. Defaults to the empty string.

robot_state_publisher's People

Contributors

clalancette avatar cottsay avatar dhood avatar dirk-thomas avatar dlu avatar fsuarez6 avatar isucan avatar jacobperron avatar jacquelinekay avatar karsten1987 avatar marcoag avatar mikaelarguedas avatar nlamprian avatar nuclearsandwich avatar paudrow avatar piyushk avatar pohzhiee avatar rcodddow avatar remod avatar rhaschke avatar russelljoyce avatar sbarthelemy avatar schnilz avatar scpeters avatar sloretz avatar smnogar avatar tfoote avatar toliver avatar vrabaud avatar wjwwood avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

robot_state_publisher's Issues

Use new urdf SharedPtr typedefs

Urdf has moved to a new SharedPtr type which results in a compile error:

/opt/ros/ros_catkin_ws/src/robot_state_publisher/src/joint_state_listener.cpp: In function 'int main(int, char**)':
/opt/ros/ros_catkin_ws/src/robot_state_publisher/src/joint_state_listener.cpp:164:98: error: conversion from 'std::map<std::__cxx11::basic_string<char>, std::shared_ptr<urdf::Joint> >::iterator {aka std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, std::shared_ptr<urdf::Joint> > >}' to non-scalar type 'std::map<std::__cxx11::basic_string<char>, boost::shared_ptr<urdf::Joint> >::iterator {aka std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, boost::shared_ptr<urdf::Joint> > >}' requested
   for(std::map< std::string, boost::shared_ptr< urdf::Joint > >::iterator i = model.joints_.begin(); i != model.joints_.end(); i++){

(3600 lines following this)

Replacing
boost::shared_ptr<urdf::JointMimic>
with
urdf::JointMimicSharedPtr

fixes this error.

use_sim_time = false makes /robot_state_publisher die!

In ROS Melodic on Ubuntu 18.04 LTS, when I use <arg name="use_sim_time" default="false"/>, then robot state publisher dies with following messages:

terminate called after throwing an instance of 'std::runtime_error'
  what():  Duration is out of dual 32-bit range
[catvehicle/robot_state_publishercatvehicle-3] process has died [pid 5998, exit code -6, cmd /opt/ros/melodic/lib/robot_state_publisher/robot_state_publisher /joint_states:=/catvehicle/joint_states __name:=robot_state_publishercatvehicle __log:=/home/ivory/.ros/log/8f8c35ca-8f15-11e8-b7c7-8c1645b122d9/catvehicle-robot_state_publishercatvehicle-3.log].
log file: /home/ivory/.ros/log/8f8c35ca-8f15-11e8-b7c7-8c1645b122d9/catvehicle-robot_state_publishercatvehicle-3*.log

You can refer to https://github.com/rahulbhadani/catvehicle for the package I am using.

In catvehicle_empty.launch, set <arg name="use_sim_time" default="false"/>
Step 1. roslaunch catvehicle catvehicle_empty.launch
Step 2. roslaunch catvehicle catvehicle_custom.launch

log4cxx missing

I am compiling ROS Hydro desktop for my operating system with catkin.

When I attempt to compile robot_state_publisher I get the following error:

ld: cannot find -llog4cxx

In the CMakeLists.txt file the log4cxx library is simply added to target_link_libraries without searching for it:

target_link_libraries(${PROJECT_NAME} ${PROJECT_NAME}_solver log4cxx ${orocos_kdl_LIBRARIES})

I have compiled the log4cxx library for my operating system. How do you pick up the right binary during compilation? Is there any way of making this cross plattform, for example by using the package config file log4cxx supplies during compilation?

use_tf_static should be false by default

The behaviour of publishing fixed joints changed significantly since the introduction of use_tf_static. By default, fixed joint transforms are published once to tf_static with the earliest possible timestamp that robot transformations can have.
When publishing joint positions and logging the robot state (as the set of its TFs) some time after the robot_state_publisher has been started, the resulting bagfile will contain static TFs from a time before the logging actually started and hence is not a correct representation of the robot state.

Although the static transforms are latched (and hence logged), they are not latched by default when replaying a rosbag. As a consequence it is not possible to start any node that needs the full robot state (e.g. RViz) after the replay started.

When reading the TFs into a TF buffer (which caches TFs for 10s by default), this creates distinct TF trees and results in failed lookups:

Lookup would require extrapolation at time 1551113242.324176550, but only time 1551109106.787312031 is in the buffer
Lookup would require extrapolation at time 1551113242.357692480, but only time 1551109106.787312031 is in the buffer
Lookup would require extrapolation into the future.  Requested time 1551113242.391208649 but the latest data is at time 1551113242.357692480
Lookup would require extrapolation into the future.  Requested time 1551113242.424724579 but the latest data is at time 1551113242.357692480

In this particular case the static transforms were published at 1551109106.787312031 and the non-static transforms were published at 1551113242.391208649.

By publishing fixed joints as static TF periodically together with the non-static TF, the robot_state_publisher would provide a complete state of the robot at any point in time and the before mentioned issues would be circumvented.

Support supplying static joint values as parameters

In cases where robots have passive joints (casters, suspension, etc) which have no sensing, you end up having to have a process somewhere which publishes dummy joint_state values for those joints so that robot_state_publisher can supply them with TFs.

It would be more straightforward to simply supply a param map of static joint values to robot_state_publisher.

Reload robot model (e.g. during calibration)

During the calibration process of my robot, I automatically generate a new urdf that is also written to the parameter server. So far, there is no way to load this parameter without restarting the process.

I propose some ways to allow for a reload:

a) a regular update (e.g. every 5 seconds)
b) update via short msg (std_msgs/Empty) on a robot_state_publisher/reload_robot_model topic
c) update via service so that a problem (malformed robot_description-parameter) can be returned.

(I'd be happy to implement it if someone else is going to use it (and it will be merged))

robot-state-publisher crashes on an empty URDF

Create a launch file with the following content. It initializes robot_description to contain a urdf that has no links.

<?xml version="1.0"?>
<launch>
  <param name="robot_description" value='&lt;robot name="foo" xmlns:xacro="http://ros.org/wiki/xacro"&gt;&lt;/robot&gt;'/>
  <node pkg="robot_state_publisher" name="robot_state_publisher" type="robot_state_publisher" output="screen"/>
</launch>

robot_state_publsiher crashes with the following output.

process[robot_state_publisher-2]: started with pid [316]
[ERROR] [1518481302.405483470]: No link elements found in urdf file
[robot_state_publisher-2] process has died [pid 316, exit code -11, cmd /opt/ros/indigo/lib/robot_state_publisher/robot_state_publisher __name:=robot_state_publisher __log:=/home/developer/.ros/log/dd4738a0-1053-11e8-81e1-0242ac110005/robot_state_publisher-2.log].
log file: /home/developer/.ros/log/dd4738a0-1053-11e8-81e1-0242ac110005/robot_state_publisher-2*.log

The node should exit in this case since there's nothing it can do with an empty URDF, but it shouldn't crash.

Unintended actuator behavior

Hi,

I have a robot description

Superchick

which includes a mannequin head and three actuators. Each actuator is supposed to control the each of three degree of freedoms of the head, i.e., (i) head vertically up, (ii) head and neck moving northwest, or (iii) head and neck moving northeast from the table top where the head lies in a supine position.

In my URDF model, I position one bladder directly under the head to control the pitch motion, position one left of neck-base and the last one right of neck base. I modeled the joints as continuous joints.

This is what I found though, when I run the model in rviz (by calling roslaunch superchick display.launch) I find that only the right actuator controller exerts an effect on the head. When I comment out any other two controllers and roslaunch the urdf, I find that each of the actuators work as intended independent of the other actuators. The problem seems to be when I try to use them all simultaneously in rViz.

I tried to change the joint types to floating but the urdf parser seems to convert it to "fixed" every time spewing stuff like joint type is unknown; joint x will be converted to fixed

I am at a loss on what I could be missing.

Would appreciate any help or insight.

Thanks!

[Windows][melodic] add Windows build support

This is an enhancement ticket for robot_state_publisher. I am using this ticket to track all the required work to bring up robot_state_publisher to be able to build on Windows/MSVC (which is verified in https://aka.ms/ros project). And hope the maintainers can take a look. Thanks!

  • update how compiler flags are added #104
  • update install destination in CMakeLists.txt #103

robot_state_publisher stops working until the /clock topic is equal to the last timestep before the reset

Hello.
There is a delay when I perform a reset_simulation for /clock topic.

Below is my code:

def resetSimulation(self):
    rospy.wait_for_service('/gazebo/reset_simulation')
    try:
        self.reset_proxy()
    except rospy.ServiceException as e:
        print ("/gazebo/reset_simulation service call failed")
    while tfData is None:
      try:
          tfData = rospy.wait_for_message('/ground_truth/state', Odometry, timeout=5)
      except:
          rospy.loginfo("Current drone pose not ready yet, retrying to get robot pose")

The reset is successful but it takes a lot of time for the simulation to start again. The robot_state_publisher stops working until the clock is equal to the last timestep before the reset.

Using equations as mimic multipliers

Hello,
I am currently working on a urdf and I want to create a mimic joint which moves in relation to the previous joint using the formula y=0.010x^2-0.540x+30.5 where y = the value of the mimic joint and x = the angle of the parent link. Is there a way to do this?

Thank you

Parameter tf_prefix does not work with ROS for Windows

When I use the robot_state_publisher on a ROS Melodic on Windows installation the tf_prefix parameter is not used.
On my ROS Melodic on Ubuntu 18.04. installation the tf_prefix is used as expected by the robot_state_publisher.

Because I needed to make my ROS package compatible for both systems, I had to use an ugly workaround where replaced my URDF file with a XACRO file which I gave the tf_prefix to prepend it to all joint and link names.

Can you reproduce this behaviour and is it fixable?

Mandatory dependency on rostest

Hi,

I have noticed that the dependency on rostest is always there. In other packages (TF example) rostest is only find-packaged if CATKIN_ENABLE_TESTING is true. Reference issue

I wonder whether there is a reason for not doing the same in this package.

reenable rostests

and after doing that please update the urls for test data from pr.willowgarage.com to download.ros.org.

  • robot_state_publisher/CMakeLists.txt

ROS 2: switch the license back to BSD

The original ROS 2 port of this package switched the license to Apache 2.0, but it is clearly derived from the original ROS port which is under the BSD license. Thus, the license on the ROS 2 port should be switched back to BSD. Looking at the contributor list, it is largely OSRF people who contributed, but there are a few external contributors:

@pohzhiee
@pbeeson
@crdelsey
@bponsler

Could you reply here and tell us if you are OK with us relicensing your original contributions back to BSD? Thanks in advance.

Missing support for subclassing

I'd like to customize the behavior of both joint_state_listener and robot_state_publisher, but the interface doesn't allow for that. In joint_state_listener, all the methods are private. And both in joint_state_listener and robot_state_publisher, no method is virtual to support subclassing. Furthermore, there's no way to "plug in" a different class than RobotStatePublisher to the joint_state_listener.

I'd like to ask you to make this package more friendly for subclassing.

If you'd like to know my motivation for subclassing - in our project, we're forced to fake some fixed joints by prismatic joints with zero limits. And I'd like the robot_state_publisher to recognize these fake fixed joints as fixed and to treat them so. And I'd also like to use the /tf_static topic for publishing the transforms for fixed joints.

ROS 2: Restore original publish frequency and parameters from ROS 1

mimic tag support

Mimic tag support has been added to URDF/JointModel, but currently it is not supported in robot_state_publisher. Similar functionality is provided in joint_state_publisher but this is a non-ideal hack. Support for the mimic tag has been added to MoveIt's RobotState, but this does not help when using for example the RobotModel Rviz plugin.

@isucan :)

ROS 2: Switch back to parameter for description?

Original issue is at ros2#33. Here's the thread:


jacobperron:

The ROS 1 version uses a parameter to read the robot description. The ROS 2 version reads the description from a file, with the path provided as a command line argument. Two questions:

  1. What was the reason for this change? I guess it was related to parameters not being available in ROS 2 at the time.

  2. Are there plans to switch back to using a parameter?

I ask because this has impact for users porting launch scripts from ROS 1. For example, (I think) typical usage with xacro in a launch file would look something like this:

<launch>
  <param name="robot_description" command="$(find xacro)/xacro '$(find foo_description)/urdf/foo.urdf.xacro'" />
  <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" />
</launch>

Translating this file into a ROS 2 launch script, I would expect it to look like:

<launch>
  <node name="robot_state_publisher" pkg="robot_state_publisher" exec="robot_state_publisher">
    <param name="robot_description" cmd="$(exec-in-pkg xacro xacro) '$(find-pkg-share foo_description)/urdf/foo.urdf.xacro'" />
  </node>
</launch>

Ignoring the fact that xacro isn't ported to ROS 2 yet and the cmd attribute isn't a valid attribute for the <param> tag (but it should be I think), I expect many people will run into the challenge of updating launch files similar to this example.

Is there an alternative workflow you imagine?


clalancette:

1. What was the reason for this change? I guess it was related to parameters not being available in ROS 2 at the time.

@Karsten1987 Did the initial port here. I'm guessing that the current state is because there were no parameters at the time, but I'm not sure.

2. Are there plans to switch back to using a parameter?

Personally, I'm on the fence with it. I sort of think of parameters as "optional" things you might configure on a node. In this case, the description is really core to what robot_state_publisher does, so it kind of makes sense that you have to provide it as a command-line parameter at startup time. There is another argument here that you may want to launch robot_state_publisher without any description and then provide one later (this is sort of the base case of having the description be dynamic at runtime). But I would argue that you still don't want to use a parameter, since it is somewhat hard to notify all downstream users of changes. You can do it via the /parameter_events topic, but then you have to filter out all of the non-robot-description updates in your downstream subscriber callbacks, or use a namespace. It seems to be simpler to just have a topic and a service on robot_state_publisher; current_description (latched), and set_description. That way it is easy to update all of the downstream consumers.

All of that being said, these are just some thoughts floating around my head, and I haven't really run them by anyone yet. So there may be significant downsides to doing something like that. Let me ask a different question: other than the porting effort, do you see a significant problem with the current state of affairs?


sloretz:

  1. Are there plans to switch back to using a parameter?

A parameter is only on one node, but multiple nodes may need it (ex: MoveIt RobotModel() needs a URDF). I think this is why robot_state_publisher publishes a "latched" robot_description topic. I don't think there are plans to change, but a good option may be to make robot_state_publisher a consumer of the robot_description topic published by a brand new robot_description_publisher. That would enable someone to load descriptions from someplace other than the filesystem by replacing robot_description_publisher without needing to reimplement robot_state_publisher too. It would also make it easier to enable robot_state_publisher to handle changing robot descriptions, since it would have to do something when it received a message.


jacobperron:

Don't get me wrong, I think current latched publisher makes sense. What I think is awkward with the current implementation is that we have to start robot_state_publisher by loading a URDF from a file. It would be better, IMO, to read a URDF as a string (like in ROS 1), or support both options.

The issue with the current state of affairs is that I can't run a tool like xacro (which can output URDF as a string) and pass it to robot_state_publisher. E.g.

ros2 run robot_state_publisher robot_state_publisher $(xacro /path/to/my/model.urdf)

It requires a two step process, first write the output of xacro to a file and then pass it to robot_state_publisher. I don't have a strong opinion on if we use a parameter (like in ROS 1) or a regular CLI arg to pass the URDF as a string, but it seems like a valid use-case to me.


clalancette:

I see the problem, and yeah, that sucks.

But I don't think a parameter is the solution. I discussed this with @IanTheEngineer, and we came up with a different solution. What if we instead allowed - as the filename, and then took the URDF from stdin? That would be more Linux-y, solve this particular problem, and be relatively easy to implement (there is a slight concern about this working on Windows, but I think we can figure something out). We'd also probably want to add some launch support syntax for it, though that can come later. Thoughts?


jacobperron:

What if we instead allowed - as the filename, and then took the URDF from stdin?

Sounds fine to me.


karsten1987:

a bit late here, but yes. The initial plan was to load the urdf content as a parameter, but as the functionality wasn't there at the time, the only workaround I've seen was to load it from file.
There is a respective PR for rviz which then displays the robot model from that parameter.

@clalancette What's the problem with the parameter? I think in Dashing we can set the parameter e.g. via a launch file which would reflect pretty much the behavior ROS1 does. Does it not? That would then even rule out things as cross platform, because all xacro has to do is output the final urdf content.


clalancette:

@clalancette What's the problem with the parameter? I think in Dashing we can set the parameter e.g. via a launch file which would reflect pretty much the behavior ROS1 does. Does it not? That would then even rule out things as cross platform, because all xacro has to do is output the final urdf content.

We can do that, but I'm questioning whether we should. In particular, see my comments in ros2#33 (comment) ; I think we should be moving more to a world where the URDF can be dynamically changed, and I think that is easier with a topic than with a parameter.


jacobperron:

I think we should be moving more to a world where the URDF can be dynamically changed, and I think that is easier with a topic than with a parameter.

To be fair, parameters are dynamically reconfigurable 😁


clalancette:

To be fair, parameters are dynamically reconfigurable grin

They are, but it is much more cumbersome to get notified of it. Yes, you can subscribe to /parameter_events, but then you have to filter parameter updates from the rest of the system. You could put it in a namespace to workaround that, but it just seems easier as a topic.

I also go back to my earlier statement that it just doesn't seem like the correct semantics for a parameter. It is integral to how robot_state_publisher works, not something optional/default, so it seems more like it belongs as a command-line/topic, rather than a parameter. But I'll admit this is subjective.


jacobperron:

Maybe we're talking about two different things.
Correct me if I'm wrong, but I thought the flow of data is:

URDF loaded by -> robot_state_publisher -> publishes description on a topic

Those who want to be notified of description changes can subscribe to the published topic. But, I'm concerned with how robot_state_publisher is loading it. In fact, I don't think the description can be updated dynamically with the current implementation. Using a parameter would give us that for free.


clalancette:

Maybe we're talking about two different things.
Correct me if I'm wrong, but I thought the flow of data is:

I'm sort of conflating them, sorry.

URDF loaded by -> robot_state_publisher -> publishes description on a topic

Right, that's the current situation.

Those who want to be notified of description changes can subscribe to the published topic. But, I'm concerned with how robot_state_publisher is loading it. In fact, I don't think the description can be updated dynamically with the current implementation. Using a parameter would give us that for free.

Having the URDF is central to what robot_state_publisher does, so I think that passing it on the command-line makes sense (that is, it is a required component). Making it a parameter is convenient, but it also seems like a misuse of the semantics of parameters. You are right that it is currently not possible to update the URDF, but my earlier proposal was to add a service that allowed you to do so.


mogumbo:

I'm one of the users Jacob was originally talking about. The trouble I see with the current state of affairs: writing xacro results to a file and then loading them is awkward and extra effort, robot_state_publisher publishes an empty /robot_description topic, and I can't figure out any syntax for feeding xacro results to robot_state_publisher in an XML launch file.

Having dynamic robot descriptions sounds great, but it also sounds like a huge can of worms. I currently only need static robot descriptions and would love to have easy solutions for spawning robots in both python and XML right away. My current solution is to save xacro results to a temporary file and pass the filename to spawn_entity.py. XML isn't an option for me yet.


clalancette:

I'm one of the users Jacob was originally talking about. The trouble I see with the current state of affairs: writing xacro results to a file and then loading them is awkward and extra effort,

Agreed. My proposal of using the stdin trick for the file would allow you to pipe the results from xacro directly into robot_state_publisher.

robot_state_publisher publishes an empty /robot_description topic

That shouldn't be. It will currently only publish once it has gotten its first update; are you sure that is happening?

and I can't figure out any syntax for feeding xacro results to robot_state_publisher in an XML launch file.

I think we'd be able to do something with the XML launch file and the stdin trick, but I'll have to check on that.

Having dynamic robot descriptions sounds great, but it also sounds like a huge can of worms. I currently only need static robot descriptions and would love to have easy solutions for spawning robots in both python and XML right away.

Sure, but it is a huge can of worms that we have been kicking down the road for years. I'm not saying that I want to solve the dynamic problem today, but I do want to make it so that the solution we start here at least allows a little more dynamicity. I also want to make sure that we are using features as they are semantically intended, and it is not clear to me that the description as a parameter is that.


mogumbo:

I don't know what kind of update robot_state_publisher is expecting. I see that it subscribes to /joint_states, but no information will be generated on that topic until after the robot is spawned and libgazebo_ros_joint_state_publisher.so starts publishing.

Anyway, the particulars of this problem are a bit out of scope for this thread. Maybe I should take it elsewhere.

BSD or LGPL?

The robot_state_publisher package is marked as BSD, but treefksolverposfull_recursive.cpp and treefksolverposfull_recursive.hpp have header comments identifying those files as LGPL. Since this source code gets compiled in with the rest of the code and cannot be separated via dynamic linking, I don't see how the whole package can be used without complying with the LGPL license.

Node crashes on Indigo

Hi, I am using the robot_state_publisher in Indigo on an Ubuntu 14.04, and no matter what I do, it crashes without further notice.

/opt/ros/indigo/lib/robot_state_publisher/robot_state_publisher
Segmentation fault (core dumped)

It's installed as binary package, version is 1.10.4.
Is there any other info, I could provide?

Best regards,
Sebastian

Could not load the file sensor_msgs/JointState.h

Hi,

I have an error with the package robot_state_publisher when I'm try to catkin_make_isolated with ROS Melodic on Raspbian 9 (stretch).

Specifically, I get an error from the file robot_state_publisher/include/robot_state_publisher/joint_state_listener.h on line 43.

fatal error: sensor_msgs/JointState.h: No such file or directory

However, the dependency sensor_msgs is correctly loaded in the package.xml file and the searched file exists at the indicated path.

Could you help me ?

Best regards,

Robin Hède.

tf_prefix no longer used in ROS2 node

Is there a reason why tf_prefix can no longer be sent to the robot_state_publisher in ROS2?

In ROS1, we use multiple robot_state_publishers as predictive displays for planning, each having a different namespace that maps /namespace/joint_states to the appropriate namespace in tf information. So one urdf ends up creating multiple namespaced TF trees for the robot.

Attempting to migrate to ROS2 seemingly makes such functionality un-migratable.
Is there an expected different way of doing this in ROS2?

Jade Release

Just a friendly ping for a potential jade release to help some blocking packages for the upcoming beta.

Why is there a leading slash?

When starting robot state publisher with my urdf or also with the MARA robot one, I always have a leading slash in my frames.
Whereas when publishing dynamic transforms via tf publishers I don't have them.

ros2 run tf2_ros tf2_monitor 

RESULTS: for all Frames

Frames:
Frame: /base_link, published by <no authority available>, Average Delay: 0.0310374, Max Delay: 0.337976
Frame: /base_robot, published by <no authority available>, Average Delay: 0.0310414, Max Delay: 0.337976
Frame: /ee_link, published by <no authority available>, Average Delay: 0.0310442, Max Delay: 0.337978
Frame: /motor1_cover, published by <no authority available>, Average Delay: 0.0310411, Max Delay: 0.337976
Frame: /motor3_cover, published by <no authority available>, Average Delay: 0.0310387, Max Delay: 0.337975
Frame: /motor5_cover, published by <no authority available>, Average Delay: 0.0310388, Max Delay: 0.337977
Frame: /tool0, published by <no authority available>, Average Delay: 0.0310385, Max Delay: 0.337976

I found this error through debugging this and this error.

no public default constructor.

is there any reason for not providing any public default constructor? This prevents any declaration of a robot state publisher as a member variable and initialize it on runtime.

Error building on Mac OS 10.10 (Yosemite)

While building (based on http://wiki.ros.org/indigo/Installation/OSX/Homebrew/Source), using Mac OS X.10 and home-brew, after running:

./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release

I get this error:

Scanning dependencies of target state_publisher
Scanning dependencies of target robot_state_publisher
[ 75%] [100%] Building CXX object CMakeFiles/state_publisher.dir/src/joint_state_listener.cpp.o
Building CXX object CMakeFiles/robot_state_publisher.dir/src/joint_state_listener.cpp.o
Linking CXX executable /Users/michael/ROS/ros_catkin_ws/devel_isolated/robot_state_publisher/lib/robot_state_publisher/state_publisher
Linking CXX executable /Users/michael/ROS/ros_catkin_ws/devel_isolated/robot_state_publisher/lib/robot_state_publisher/robot_state_publisher
ld: library not found for -llog4cxx
ld: library not found for -llog4cxx
clang: error: linker command failed with exit code 1 (use -v to see invocation)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: make[2]: *** [/Users/michael/ROS/ros_catkin_ws/devel_isolated/robot_state_publisher/lib/robot_state_publisher/robot_state_publisher] Error 1*** [/Users/michael/ROS/ros_catkin_ws/devel_isolated/robot_state_publisher/lib/robot_state_publisher/state_publisher] Error 1

make[1]: *** [CMakeFiles/robot_state_publisher.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/state_publisher.dir/all] Error 2
make: *** [all] Error 2
<== Failed to process package 'robot_state_publisher':
  Command '/Users/michael/ROS/ros_catkin_ws/install_isolated/env.sh make -j8 -l8' returned non-zero exit status 2

Reproduce this error by running:
==> cd /Users/michael/ROS/ros_catkin_ws/build_isolated/robot_state_publisher && /Users/michael/ROS/ros_catkin_ws/install_isolated/env.sh make -j8 -l8

Command failed, exiting.

Note that log4cxx is installed:

ros_catkin_ws| brew install log4cxx
Warning: log4cxx-0.10.0 already installed

Not sure, but might be related to this: ros-perception/image_common#28

Thanks!

robot-state-publisher sending NaN data to tf

The following code when run causes the robot-state-publisher to publish bad data.
Also see: http://answers.ros.org/question/79151/updated-robot-state-publisher-causing-error-in-tfwith-eg-code/

HERE IS THE LAUNCH FILE

 <launch>
 <param name="robot_description" textfile="$(find rrbot_description)/urdf_error/rrbot.urdf" />

  <!-- Show in Rviz   -->
  <node name="rqt_gui" pkg="rqt_gui" type="rqt_gui"/>

  <node pkg="joint_state_publisher" type="joint_state_publisher" 
        name="joint_state_publisher" output="screen">
        <param name="use_gui" value="True"/>
  </node>

  <node pkg="robot_state_publisher" type="robot_state_publisher" 
        name="robot_state_publisher" output="screen">
  </node>


</launch>

HERE IS THE URDF

<?xml version="1.0"?>
<robot name="rrbot">

   <link name='base_link'>
      <collision name='collision'>
        <origin xyz="0 0 .1" rpy="0 0 0"/>
        <geometry>
          <box  size=".4 .2 .1"/>
        </geometry>
      </collision>
      <visual name='visual'>
        <origin xyz="0 0 .1 " rpy="0 0 0"/>
        <geometry>
          <box  size=".4 .2 .1"/>
        </geometry>
      </visual>
  </link> 

  <link name="left_wheel">
    <collision name="collision">
      <origin xyz="0.05 0.15 0.1" rpy="0 1.5707 1.5707"/>
      <geometry>
         <cylinder  length="0.05" radius="0.1"/>
      </geometry>
    </collision>
    <visual name="visual">
      <origin xyz="0.05 0.15 0.1" rpy="0 1.5707 1.5707"/>
      <geometry>
        <cylinder  length="0.05" radius="0.1"/>
      </geometry>
    </visual>
  </link>

  <joint type="revolute" name="joint1">
    <origin xyz="0.05 0.08 0.05" rpy="1.5707 1.5707 0"/>
    <child link="left_wheel"/>
    <parent link="base_link"/>
    <axis>
         <xyz>0 1 0</xyz>
     </axis>
     <limit upper="0" lower="-1.57" velocity="10" effort="10"/>
  </joint>

</robot>

runtime failure with robot_state_publisher 1.9.10

I am receiving the following error when I try and run robot_state_publisher 1.9.10 (from shadow-fixed):

/opt/ros/hydro/lib/robot_state_publisher/robot_state_publisher: error while loading shared libraries: liborocos-kdl.so.1.1: cannot open shared object file: No such file or directory
[robot1/robot_state_publisher-5] process has died [pid 12772, exit code 127, cmd /opt/ros/hydro/lib/robot_state_publisher/robot_state_publisher __name:=robot_state_publisher __log:=/home/piyushk/.ros/log/07df68f0-647b-11e3-9ef1-74e50b28476e/robot1-robot_state_publisher-5.log].

I updated robot_state_publisher and orocos_kdl from shadow-fixed to 1.9.10 and 1.2.1 respectively. Compiling robot_state_publisher from source worked correctly at 819236b

API incompatibility in RobotStatePublisher::publishFixedTransforms

Commit 8c27d2b broke backwards compatibility of the C++ interface by adding a bool use_tf_static parameter to the RobotStatePublisher::publishFixedTransforms member function.

Adding a default value to either true or false will fix the incompatibility. If filling in a default is undesirable, we could add a deprecated overload that fills in the boolean value.

Either way, breaking the C++ API within a the same ROS release is a bit messy.

Breaking change in 1.13.3 with static transforms

It looks like commit e957b26 broke static transforms defined in URDF. Joints of type fixed no longer show up in the TF tree. They're latched, but not published continuously and TF doesn't know about them. The work around is to define the param use_tf_static as false on robot_state_publisher, but this breaking behavior should not happen in a minor version bump.

Add C++11 flag to CMakeLists.txt

robot_state_publisher depends from urdf, which uses std::shared_ptr and other abilities of C++11 in its headers. For example, shared pointer is used in /usr/include/urdf_world/types.h, so lack of appropriate compiler flag leads to errors.

robot state publisher failing on buildfarm

http://www.ros.org/debbuild/hydro.html?q=robot_state_publisher

Extract from the build log:

Linking CXX executable devel/lib/robot_state_publisher/robot_state_publisher
/usr/bin/cmake -E cmake_link_script CMakeFiles/robot_state_publisher.dir/link.txt --verbose=1
/usr/lib/ccache/c++   -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security     CMakeFiles/robot_state_publisher.dir/src/joint_state_listener.cpp.o  -o devel/lib/robot_state_publisher/robot_state_publisher -rdynamic devel/lib/librobot_state_publisher_solver.so -llog4cxx /opt/ros/hydro/lib/libroscpp.so -lpthread -lboost_signals-mt -lboost_filesystem-mt -lboost_system-mt /opt/ros/hydro/lib/libcpp_common.so /opt/ros/hydro/lib/libroscpp_serialization.so /opt/ros/hydro/lib/librostime.so -lboost_date_time-mt -lboost_thread-mt /opt/ros/hydro/lib/librosconsole.so -lboost_regex-mt -llog4cxx /opt/ros/hydro/lib/libxmlrpcpp.so /opt/ros/hydro/lib/libtf.so /opt/ros/hydro/lib/libmessage_filters.so /opt/ros/hydro/lib/libtf2_ros.so /opt/ros/hydro/lib/libactionlib.so /opt/ros/hydro/lib/libtf2.so /opt/ros/hydro/lib/libconsole_bridge.so /opt/ros/hydro/lib/libtf_conversions.so /opt/ros/hydro/lib/libkdl_conversions.so /opt/ros/hydro/lib/libkdl_parser.so -ltinyxml /opt/ros/hydro/lib/liburdf.so /opt/ros/hydro/lib/liburdfdom_sensor.so /opt/ros/hydro/lib/liburdfdom_model_state.so /opt/ros/hydro/lib/liburdfdom_model.so /opt/ros/hydro/lib/liburdfdom_world.so /opt/ros/hydro/lib/librosconsole_bridge.so -Wl,-rpath,/tmp/buildd/ros-hydro-robot-state-publisher-1.9.9-0precise-20131207-0746/obj-x86_64-linux-gnu/devel/lib:/opt/ros/hydro/lib: 
/usr/bin/ld: CMakeFiles/robot_state_publisher.dir/src/joint_state_listener.cpp.o: undefined reference to symbol 'KDL::Tree::Tree(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/ld: note: 'KDL::Tree::Tree(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' is defined in DSO /opt/ros/hydro/lib/liborocos-kdl.so.1.2 so try adding it to the linker command line
/opt/ros/hydro/lib/liborocos-kdl.so.1.2: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make[4]: *** [devel/lib/robot_state_publisher/robot_state_publisher] Error 1

http://jenkins.ros.org/view/HbinP64/job/ros-hydro-robot-state-publisher_binarydeb_precise_amd64/41/console

Future dating vs. use_tf_static

This commit removed future dating of fixed transforms in favor of a new parameter use_tf_static. The default value for this parameter is false in kinetic and indigo, true in jade (?!?) so the new default now is to send static transforms with ros::Time::now() which results in more tf lookup errors.
I'd say the correct implementation would be to future date if use_tf_static is false.

Floating joints published as fixed joints

The URDF specification allows for floating joint types (see here). However, the robot_state_publisher node does not recognize floating joint types. Floating joints are instead interpreted as fixed joints.

This issue is related to ros/robot_model#86 (more information can be found there).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.