Importing URDF throws ros::TimeNotInitializedException

Issue #53 wontfix
Adam R created an issue

Hello, I am trying to work with NAO (V50). I need to use modified limits (modified urdf as attachment), because NAO has skin added onto him, which changed the limits. I even tried to use https://raw.githubusercontent.com/ros-naoqi/nao_robot/master/nao_description/urdf/naoV50_generated_urdf/nao.urdf but that trhows the same error. Any idea? When I looked up this error, I found it could be ( http://lists.ros.org/pipermail/ros-users/2010-June/055556.html ). The example code for pr2 works just fine.

Thanks

from naoqi import ALProxy
from trac_ik_python.trac_ik import IK
import rospy

dataPath = "no-shoulders/"
urdfName = "data"

with open('data/'+ dataPath +'limits/'+ urdfName +'.urdf', 'r') as file:
    urdf=file.read()

Solver = IK("Torso_link", "LShoulderPitch_link", urdf_string=urdf) # version I posted does actually need to have suffix _link ommited.

Ends with: 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() Neúspěšně ukončen (SIGABRT) (core dumped [obraz paměti uložen])

Comments (7)

  1. Patrick Beeson Account Deactivated
    • changed status to open

    I don’t understand why you aren’t initializing ROS in your actual python code before instantiating the TRAC-IK class? That would eliminate needing to change trac-IK altogether and is the correct way to make a ROS node.

  2. Patrick Beeson Account Deactivated

    I still don’t think this is a trac-IK problem. You didn’t use trac-IK inside of a properly initialized ROS node. Trac-IK is not meant to be used outside of ROS.

  3. Log in to comment