Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Discussion Help wanted in implementing a quadrupled robot with an active spine in Unity

Discussion in 'Physics' started by leebissessar5, Dec 24, 2022.

  1. leebissessar5

    leebissessar5

    Joined:
    Nov 15, 2022
    Posts:
    44
    Hello again, I thought it wouldn't hurt to ask again for help here.

    Continuing from my post from here, I am pretty much satisfied with the end result concerning the rover. It works really well with my model I used in Simulink, and I have managed to do a lot of fun stuff with it in Unity.

    I have two more systems to implement for my robot, the legged robot (the topic of this thread) and a multistage rocket (which I may ask for help in a future thread). My professor assigned the legged robot to be a quadruped with an active spine. Although I am new to legged robots, I have a decent understanding of the theory behind them from my research.

    The problem is where to start. I have been looking for some designs online and was wondering if it could be implemented with ArticulationBody since the joint hierarchy is confusing to me. What I have noticed in these designs is that they are not simple modifications of robots like Spot, where a joint can be easily added to the spine. Robots like Spot feature articulated legs where the hip and knee joints can be easily implemented using revolute joints. The quadrupled robots that feature an active spine feature very different legs compared to Spot, because their purpose is to replicate agile behaviors in animals (See Bobcat.PNG). The closest thing I have found to a breakdown of this structure is shown in the attached image "Articulation Leg.PNG", though I could be mistaken.

    I am confused because I have seen some designs that seem to have loop joints, and I am not sure if this is the case with the examples I attached. From what I have heard, ArticulationBody does not support loop joints, and this is also true for Simulink Multibody anyways. My plan was to create a URDF and let Unity import the equivalent ArticulationBody model using the URDF importer, as well as use MATLAB's smimport to design controllers for it. I am hoping that this will work when it connects to the Unity model. However, before I try this, I need clarification on whether or not this can be implemented in Unity and what the articulation tree would look like in this case, assuming there are no loop joints.
     

    Attached Files:

    Last edited: Dec 24, 2022
  2. leebissessar5

    leebissessar5

    Joined:
    Nov 15, 2022
    Posts:
    44
    UPDATE: I did some more research and apparently, it's called a pantograph leg. See Pantograph Leg.PNG.

    Looks like there might be loop joints involved.
     

    Attached Files:

  3. leebissessar5

    leebissessar5

    Joined:
    Nov 15, 2022
    Posts:
    44
  4. leebissessar5

    leebissessar5

    Joined:
    Nov 15, 2022
    Posts:
    44
    Ok, I was working on the rocket and now I'm ready to focus on the quadruped more.

    I'm almost done with 3D modelling the mesh, but I need advice on how I would implement the cord mechanism in Unity. I lurked around in some threads and saw something called position-based dynamics which seems like a useful start. I also saw some videos on how I could also divide the cord into segments and making each a configurable joint, as well as using a procedural mesh.

    I think all of that would either take too much time or be outside the scope of my project, so I want to know if there's a more efficient way to create the cord physics in Unity while I'm creating the mesh in Blender. I'll probably figure it out all on my own eventually, but I still think it was worth asking for help here.
     
  5. leebissessar5

    leebissessar5

    Joined:
    Nov 15, 2022
    Posts:
    44
    I managed to get something close to what I want in Unity (See Legged Robot Simulation.PNG). I used prismatic joints on the spring which connects to the middle joint in the lower legs using a fixed joint.

    It's pretty much done but I have not managed to implement cord physics. I tried using the Cloth component, but it doesn't seem to have an option for setting anchor points like how you would with a fixed joint.

    It's not necessary since the end-result is the flexion of the knee joint which I already implemented and it would just be icing on the cake, but I'm still curious how I would implement this in Unity (See Cord Mechanism.PNG). Using bones could work but it seems that might be too hardware intensive considering it will likely require more than 20 bones to do that. Any suggestions?
     

    Attached Files:

  6. tjmaul

    tjmaul

    Joined:
    Aug 29, 2018
    Posts:
    463
    I'd use ObiRope or Filo (both by Virtual Method) for that. Both are paid assets and I'm not affiliated with them in any way, I just really like their products. I guess if you actually want to actuate something using that rope, Filo probably right, but let's ask @arkano22
     
  7. leebissessar5

    leebissessar5

    Joined:
    Nov 15, 2022
    Posts:
    44
    Thanks for being the only person to respond thus far. Can't use those since those are paid and this is a university project. I did the tedious method of rigging the cords and making all of them hinge joints and it works for my purposes. It's not used for actuation since I'd have to get the cord length right and so on. The end result is knee flexion which is simply done using checking JointPosition and applying torque. That's what I did, and I'm satisfied with it so far.
     
  8. tjmaul

    tjmaul

    Joined:
    Aug 29, 2018
    Posts:
    463
    :) I did follow your other thread and I followed this, too, but didn’t really have to contribute anything. Your topics certainly are advanced but from my perspective, you always found a good path.

    Out of personal interest, are you doing feedback control? In case you have recommendations for literature about inverse dynamics, I’m interested :)
     
    leebissessar5 likes this.
  9. leebissessar5

    leebissessar5

    Joined:
    Nov 15, 2022
    Posts:
    44
    Yes, I am implementing feedback control in my project. Currently, I am still deciding on what controllers to use for the quadruped and rocket robots, as there is limited information on control strategies for these types of robots. I am considering either model predictive control or reinforcement learning based on recent literature.

    Oh, and I would say you did contribute significantly to the other thread. Recommending ArticulationBody was basically the answer I needed for the rover and the quadruped. If I figured out it too late which would have happened if I didn't post here, I don't think I would be able to finish the project in time.

    As for inverse dynamics, I am still learning about the topic, having only been introduced to it and Unity since starting this project in September. Once I find some good resources, I will send the literature in the future.
     
    Last edited: Jan 29, 2023
    tjmaul likes this.
  10. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,602
    Since tjmaul invoked me, just wanted to leave my two cents.

    The asset Filo he suggested to use is an implementation of this article:
    https://matthias-research.github.io/pages/publications/cableJoints.pdf

    Basically, you'd use hinge joints to create your robot's basic structure. Then, the approach outlined in the article involves keeping track of the cable's length, calculating and applying impulses to the different rigidbodies to actuate limbs (similar to using motorized joints and applying torques directly).
    Even if you must implement this yourself since this is a uni project, I think the "cable joint" approach could be of interest to you.

    cheers!
     
    leebissessar5 and tjmaul like this.
  11. leebissessar5

    leebissessar5

    Joined:
    Nov 15, 2022
    Posts:
    44
    Wow, this is very cool! Sadly, I do not have enough time in the project schedule to feasibly change my current implementation, but I will definitely try this out sometime for some of my personal research projects!
     
  12. leebissessar5

    leebissessar5

    Joined:
    Nov 15, 2022
    Posts:
    44
    Sorry to bring back this thread, I didn't forget about you haha. I decided I will post the simulations of the 5 systems I implemented on GitHub. When the time comes, I'll probably announce it on a new thread and hopefully you'll still be around.
     
    tjmaul likes this.