Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Describe the process of adding new skins #4

Open
sskorol opened this issue Nov 16, 2022 · 22 comments
Open

Describe the process of adding new skins #4

sskorol opened this issue Nov 16, 2022 · 22 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@sskorol
Copy link

sskorol commented Nov 16, 2022

Hi @noeperez @roberottt,

I'm trying to add a new model to a simulation. Here are the steps I've completed so far:

  • built it via MakeHuman app
  • animated in Mixamo
  • exported to .dae and .bvh via Blender and put them to models folder
  • added new behaviors to Agent.msg
  • extended skin_filename and animation_filename with newly added items
  • added hunav_msgs handlers for the newly added behaviors

When I start all the services via launch file, I see the following error:

Screenshot from 2022-11-16 04-39-50

As it comes from Gazebo, I'm not really sure how exactly I should fix it. Where are these active/inactive animations are set?

Would be greatly appreciated any thoughts.

@noeperez
Copy link
Member

Hi!
To create new agent models is not trivial. We struggled a bit to achieve it, but we did it.
We will update the wrapper with a set of new models soon (man, women, children, ..). They have a better look than the default bald agents.
We will also upload a guide of the steps that we followed to create them. (We are not expert in modelling, so probably an expert in this field could reach a better and easier way).

@sskorol
Copy link
Author

sskorol commented Nov 16, 2022

Thanks! In the meantime, can you advise on the animation part for active/no_active behavior? As it seems like I'm pretty close to the solution, just want to understand the direction.

@noeperez
Copy link
Member

Sure!
We use the "active" state to define the animation that the agent should perform while reacting to the presence of the robot.
The "no_active" is the animation while walking without the presence of the robot.

@sskorol
Copy link
Author

sskorol commented Nov 16, 2022

But where in the code do you map these 2 states with the animation? I'm a little bit confused with the above error message as I don't see how these states correlate to animation files (.bvh) that you explicitly load in WorldGenerator.

There were similar errors related to the actual behaviors that we define in agents.xml. And I fixed them by introducing my own behaviors for a new model. But how can I do the same for the active/no_active state (which is mentioned in the error message)?

@sskorol
Copy link
Author

sskorol commented Nov 16, 2022

To be more specific, I just added new .dae and .bvh files:

Screenshot from 2022-11-16 12-10-34

Plus corresponding processing logic:
Screenshot from 2022-11-16 12-11-55
And new behaviors:
Screenshot from 2022-11-16 12-12-45

@noeperez
Copy link
Member

To replace an animation is not complex, while the animation is compatible with the skeleton of the model (related to your first problem).
If you also want to add a new behavior, that is not trivial, and more work is required since the behaviors are controlled by the behaviors trees. You need to program a new behavior tree and register it.

@sskorol
Copy link
Author

sskorol commented Nov 16, 2022

But I generated both .dae and .bvh from a single .fbx. So animation should 100% match the .dae, as it works in Blender and the other tools. So I guess there's something more on the code level where some default animation is used with my model (which is incompatible with the existing animations).

@sskorol
Copy link
Author

sskorol commented Nov 17, 2022

No, I'm stuck. Seems like there should be some special model/animation configuration to play well with Gazebo. There are a bunch of ways how you can export data from Blender. And all the tutorials are pretty much outdated. I don't know why it doesn't work. Looking forward to receiving some instructions from you. Thanks.

@noeperez
Copy link
Member

Building a functional model with animation to play in Gazebo properly is quite tricky.
Again, as I commented in the first response, we will upload new models and to try to provide a guide of the steps we followed.

@noeperez noeperez added documentation Improvements or additions to documentation enhancement New feature or request labels Nov 17, 2022
@sskorol
Copy link
Author

sskorol commented Nov 17, 2022

Thanks, do you have any raw estimate? So that I'd understand if I want to spend more time on investigation or just wait for your update. You know, if it's a week, for example, I can wait for sure. If a month, I'd likely find a solution myself.

Note that I perfectly realize it's open-source and you have your primary job. So that's just a question, no offence.

@noeperez
Copy link
Member

Probably, we could upload something next week.

@noeperez
Copy link
Member

noeperez commented Nov 18, 2022

We have just added 5 new human models.
We will provide the steps we followed to create them next week.

@sskorol
Copy link
Author

sskorol commented Nov 18, 2022

@noeperez top! Will try later today. Thanks!

@sskorol
Copy link
Author

sskorol commented Nov 20, 2022

New models work for me. I'm looking forward to getting the instructions for custom models. Thanks!

@roberottt
Copy link
Contributor

roberottt commented Nov 21, 2022

Hi!
We have just added the instructions for custom models.
You can find it here.

@sskorol
Copy link
Author

sskorol commented Nov 21, 2022

@roberottt excellent, thanks!

I'm wondering if you also tried to change the animation. I made many attempts, but it seems like Blender exports a broken .bvh file, which can't be correctly handled by Gazebo. Or maybe I just missed something.

@noeperez
Copy link
Member

Hi!

The models built like that are compatible with all the .bvh animations from here. We just associated the proper animations, for the "active" and "non-active" modes, to the behavior indicated.

@sskorol
Copy link
Author

sskorol commented Nov 21, 2022

@noeperez yes, I know that dataset. However, I'm asking if you tried some custom animations built with e.g. Mixamo? It's a very simple and powerful UI tool. You can import your .fbx from MakeHuman, add any animation, then export back to .fbx and import it to Blender with a fully working animation. What I'm stuck at within this process is splitting .fbx onto .dae and .bvh. If I use only .dae, it seems to work well in Gazebo w/o animation. But when I try to export .bvh, it breaks the model: there's a monster from a horror movie walking in Gazebo. :)
So wondering if you'd have more luck than me with this process. As it should be a lot simpler. I likely missed the valid export options for the target .bvh.

@noeperez
Copy link
Member

noeperez commented Nov 21, 2022 via email

@sskorol
Copy link
Author

sskorol commented Nov 24, 2022

I tried to follow the instructions but got a broken model at the end. Have you tried adding such parts as ponytails, eyelashes, and eyebrows or changing the size of the body? It seems like walk.dae has a bit different skeleton compared to what MakeHuman produces. At least I see some significant diffs in some bones' positions. I don't know if that's the reason, but if I just scale a skeleton and leave everything else as is, some parts of the body might not be aligned or be even split.

@noeperez
Copy link
Member

We have the same problems. When merging the skeleton of the walk.dae with the skin of a new model not always fits perfectly, and some bones positions and connections must be adjusted manually.
As we say in the document, the 3D modelling is not our field, so that's the best we have achieved for the moment.

@sskorol
Copy link
Author

sskorol commented Nov 24, 2022

Anyway, thanks for your effort!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants