- changed status to invalid
Importing URDF throws ros::TimeNotInitializedException
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)
-
Account Deactivated -
reporter Solved by modifing "trac_ik_wrap.i" via https://stackoverflow.com/questions/51847900/importing-urdf-throws-rostimenotinitializedexception, might be handy for others or pushed as fix.
-
Account Deactivated - changed status to closed
-
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.
-
Account Deactivated rospy.init_node('tester', anonymous=True)
http://wiki.ros.org/rospy_tutorials/Tutorials/WritingPublisherSubscriber#The_Code_Explained
-
Account Deactivated - changed status to wontfix
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.
-
I get this error on some simple urdf's. The error only occurs here if the chain you use does NOT contain at least 2 non-fixed joints.
See also
https://answers.ros.org/question/312091/trac_ik-fails-on-melodic/
- Log in to comment
This is a ROS usage error and not an issue with TRAC-IK