Rosanswers logo

Hello list,

After loading a simple urdf in the parameter server using the following launch file:

  <param name="robot_description"
    command="xacro '$(find tf_if_test)/urdf/boot.xacro' " />

  <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher">
    <param name="use_gui" value="true"/>

  <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher"/>
  <node name="rviz" pkg="rviz" type="rviz" args="-d $(find tf_if_test/launch/boot.rviz"/>

This works fine, but if I try to use trac_ik_python, but it fails with the following error:

terminate called after throwing an instance of 'ros::TimeNotInitializedException'
  what():  Cannot use ros::Time::now() before the first NodeHandle has been created or ros::start() has been called.  If this is a standalone app or test that just uses ros::Time and does not communicate over ROS, you may also call ros::Time::init()
Aborted (core dumped)

The code:

#!/usr/bin/env python                                                                                                       
import rospy
from trac_ik_python.trac_ik import IK

rospy.init_node('tester', anonymous=True)
ik_solver = IK("l1",               "l3")
print 'done'

I thought that init_node did the ros::start() here. Am I doing something wrong?

EDIT: Or is it a problem that there are only 2DOF in this robot?

2nd EDIT: I tried the patch by adding the ros::Timer::init() in the swig-file. That works. Then I removed that patched version of trac_ik completely and reverted to the official one. Now the problem does NOT return, It is really reverted, I also rebooted the machine. Weird....

Thanks in advance, Sietse

Originally posted by Sietse on ROS Answers with karma: 168 on 2019-01-07

Post score: 0


1 Answer 1


Rosanswers logo

I will answer my own question.

The error occurs here when the chain does NOT at least have 2 non-fixed joints in it. I'll make a comment on the traclab issue about it.

Originally posted by Sietse with karma: 168 on 2019-01-09

This answer was ACCEPTED on the original site

Post score: 0

Original comments

Comment by gvdhoorn on 2019-01-09:
I would have no idea how the error message you quoted would be caused by something that has to do with fixed or other types of joints.

Comment by Sietse on 2019-01-09:
Track_IK is not designed to be used is less than 2 (controllable) joints. It normally gives an error about that, but is doesn't do that now. My model has 2 joints, only NOT in the chain that I used for IK. So maybe the test on the number of joints is flawed.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.