-
Notifications
You must be signed in to change notification settings - Fork 50
Add APIs to create sequentially an ArticulatedSystem #24
Comments
Is speed an issue? Technically you can modify your urdf after you load it in tinyxml. You can add joints and links as you want. When parsing urdf, RaiSim checks for errors in the description and computes necessary quantities to speed up simulation so initialization is inevitable. I believe creating a new system is in the order of tens of microseconds. After URDF parsing, an articulated system description is in a form of raisim::Child
I can make an API that accepts an (user-created) instance of this class directly. Since this one is not part of the API, it is probably difficult to understand it now. |
Thanks @jhwangbo for the prompt reply. I had a look to the header you linked.
Editing the serialization is a solution, though it would be cumbersome to convert to an URDF model another kind of description (e.g. SDF, just to name something not supported). It would be more generic your second proposal, that is creating a Moreover, it would be a good and I think effortless addition being able to get the final These two features together would allow users to do the following to programmatically construct a model (correct me if I'm wrong):
Another bonus of this approach, if I got it right, would be that users could save
This would not be a problem, waiting the switch to public and documented APIs users can in the meantime start to experiment with it. |
It makes sense to have a constructor that takes a Child object. I'll make one. I still have to clean up that part of the code to expose it to users. It will be done by the end of this week. Actually all data created in Child is restructured for better memory access and child_ object is cleared after the initialization. It is meant to be a description of the system only. Getting the joint order when you randomly creating a robot can be tricky. I'll make a method that takes a movable joint name and returns its position. In that case, you can do
Do you see any disadvantage of this approach in your use case? |
Amazing, thanks for addressing it so quickly (I don't have these hard time constraints in any case :)
I suspect that you do not create again the objects, right? You just change their order in the containers where they are stored. If this is the case, if users have a reference (or a pointer) of that object gathered before this re-arrangement, it should remain valid. Do you confirm?
This is something else I felt missing. In order to fix the serialization I had to get all the non-fixed joints from the URDF before loading it in the Would also spherical joints be supported? I think this method would be even more useful in models that contain multi-dofs joints, and in this case the returned value would be a Vec object I assume.
Do you mean that accessing Partially related to this discussion, I didn't find a way to extract the list of joint and body names. Maybe they could be gathered by the |
What I meant is that I stored the system description in completely different containers. For example, all joint positions are stored contiguously in memory. The notion of Child is gone.
yeah, 'movable' can be gone. Note that fixed joints disappear after initialization because they don't contribute to the dynamics. The only thing remains is the frame that stores its pose. It will give you "unknown joint" error if you ask for a fixed joint
True. I'll do that
RaiSim supports a spherical joint since its release ;)
As mentioned above, the data has to be stored in a particular way in memory for performance so I cannot keep a Child class object. But I can create an accessor class for something like this
Here the body object only stores an index and a pointer to the ArticulatedSystem. All dirty work for finding index will be done inside the class method. How does it sound?
AS has "getBodyNames" method which only returns movable bodies. Rigidly fixed bodies are not stored here. Is there any reason to get fixed bodies? because URDF does not have a body frame. It only has a frame for joints. There is no meaningful information to extract from fixed bodies. It is missing "getJointNames" method. I'll add it. |
Ow now I see, thanks for the insight! Than, forget my previous comments, in light of this they are garbage. At this point all possible APIs should be directly added to the
This is the natural alternative, it sounds really good! Would this object be const (i.e. it can be used only to extract data)? If a similar approach could be done also for joints, maybe through a non-const object users could also set references of change control modes of a single joint.
No sorry, I missed the method. I'm still familiarizing with the APIs.
Cool, thanks! |
Yes, some methods will be non-const. In my work, I also randomize collision bodies, link length and joint angles. This API is there but it is a bit difficult to use. The new body and joint API will make it easier. But you have to be careful in changing them because they might become an unrealistic model. For example, an internal collision can just lock the joint. |
Great, thanks for today's discussion. Eager to see this coming. |
changes are pushed. let me know if you see anything missing! |
Thank you so much @jhwangbo, I'll have a look to the changes in the next few days and I let you know :) |
The current version of RaiSim allows creating a model only by loading an existing URDF model.
In order to integrate the physics engine in other applications, it would be beneficial having APIs to programmatically add links, joints, visual (shapes and meshes) and collisions.
I assume that under the hood, the URDF parser at one point calls methods that add these entities into the simulation. What I mean, in other words, is that it would be nice having these methods publicly exposed.
Having this feature would allow users to use alternative descriptions than URDF, demanding their deserialization to user code.
The text was updated successfully, but these errors were encountered: