OpenCOLLADA kinematics issues

Dear all,

I am new to OpenCOLLADA and have several questions about kinematics.
I want to parse <articulated_systems> but it is unclear for me how it implemented in OpenCOLLADA. Is there any class related to articulated systems, or how can I access it?

Best regards,

Hi Anton.

I am not exactly sure, I think you need to check class KinematicsController from COLLADAFW. Let me know about your results.

best regards,

Thank you, Alexey!

Don’t you know what is the difference between Kinematics Scene in COLLADAFW and in COLLADASaxFWL?


COLLADASaxFWL has “low-level” classes responsible for collada xml parsing and so on.
At some point COLLADASaxFWL puts all xml data to data structures of COLLADAFW.
You should use COLLADAFW. Here is a small example, how you can get articulated_system information.

virtual bool writeKinematicsScene( const COLLADAFW::KinematicsScene* kinematicsScene )
const COLLADAFW::KinematicsControllerArray& controllers = kinematicsScene->getKinematicsControllers();
std::cout << “found " << controllers.getCount() << " controllers” << std::endl;
for (size_t i = 0; i < controllers.getCount(); i++) {
COLLADAFW::KinematicsController* controllerPtr = controllers[i];
const COLLADAFW::AxisInfoArray& axisInfos = controllerPtr->getAxisInfos();
std::cout << “found " << axisInfos.getCount() << " axis_info tags” << std::endl;
for (size_t x = 0; x < axisInfos.getCount(); x++) {
const COLLADAFW::AxisInfo& axisInfo = axisInfos[x];
std::cout << "found axis with index: " << axisInfo.getIndex() << std::endl;

            std::string isActive = axisInfo.getIsActive()==true ? "true":"false";
            std::cout &lt;&lt; "   axis active: " &lt;&lt; isActive &lt;&lt; std::endl;
            std::string isLocked = axisInfo.getIsLocked()==true ? "true":"false";
            std::cout &lt;&lt; "   axis locked: " &lt;&lt; isLocked &lt;&lt; std::endl;

            COLLADAFW::JointPrimitive* jointPrimitivePtr = axisInfo.getJointPrimitive();
            COLLADABU::Math::Vector3 axis = jointPrimitivePtr-&gt;getAxis();
            std::cout &lt;&lt; "   joint axis: " &lt;&lt; axis.x &lt;&lt;" "&lt;&lt; axis.y &lt;&lt;" "&lt;&lt; axis.z &lt;&lt; std::endl;

            float softLimitMax = jointPrimitivePtr-&gt;getSoftLimitMax();
            float softLimitMin = jointPrimitivePtr-&gt;getSoftLimitMin();
            std::cout &lt;&lt; "   soft limit min: " &lt;&lt;softLimitMin &lt;&lt; " soft limit max: " &lt;&lt; softLimitMax &lt;&lt; std::endl;

            float hardLimitMax = jointPrimitivePtr-&gt;getHardLimitMax();
            float hardLimitMin = jointPrimitivePtr-&gt;getHardLimitMin();
            std::cout &lt;&lt; "   hard limit min: " &lt;&lt;hardLimitMin &lt;&lt; " hard limit max: " &lt;&lt; hardLimitMax &lt;&lt; std::endl;

            const COLLADAFW::MotionProfile& motionProfile = jointPrimitivePtr-&gt;getMotionProfile();
            float acceleration = motionProfile.getReferenceAcceleration();
            float deceleration = motionProfile.getReferenceDeceleration();
            float jerk = motionProfile.getReferenceJerk();
            float speed = motionProfile.getReferenceSpeed();
            std::cout &lt;&lt; "   acceleration: " &lt;&lt; acceleration &lt;&lt; " deceleration: " &lt;&lt; deceleration &lt;&lt; " jerk: " &lt;&lt; jerk &lt;&lt; "speed: " &lt;&lt; speed &lt;&lt; std::endl;
	return true;

Forgot to mention that you should read this thread about problem with KinematicsController copy construction, Here is the link Google Code Archive - Long-term storage for Google Code Project Hosting.

I also attached the model with the articulated_system. When you are working with kinematics models using openCOLLADA lib you should first do a model validation (use openCOLLADAValidator) to check if the model is valid against COLLADA 1.5 scheme.

Thank you for help, Alexey! But it is still unclear for me how tags <frame_origin>,<frame_tcp> and <frame_tip> are realized in OpenCOLLADA. How can i parse them?