-
Notifications
You must be signed in to change notification settings - Fork 75
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
Trying to implement the "pick up" and "put down" object actions #714
Comments
Hi, thanks for sending this.
Check the Player log, not the Editor log. The error message is making some assumptions about how you ran your controller that I guess aren't good assumptions. The fundamental problem in your code is that you're trying to define new commands. The logic behind commands is stored in the build, not Python. Thus,
And
Note that I'm defining lists of commands because you can send a list of multiple commands that will all execute (sequentially) on the same physics step. Under the hood, this is how TDW achieves most of its complex behavior (especially agent actions). Hope that helps. |
Thank you for your response!
I found it, thanks! It was a bit tricky to locate, though.
So, just to clarify, the One more question: Is there any documentation or a list of all the commands available? I was under the impression that |
Correct.
Yes, or something like the list of commands I provided.
This is the command AP documentation: https://github.com/threedworld-mit/tdw/blob/master/Documentation/api/command_api.md You will find commands called |
Thanks, found it! I still have some questions if I may:
As you can see, in the red area all the furniture is well placed. After I spawn the FPA, from the in-game view you can notice the difference. Do you have any ideas why this is happening? Could you please clarify how I can prevent it?
Thank you once again. |
The avatar is probably spawning on or nearby the objects. Try using the OccupancyMap add-on to get a free floor position.
Read these documents (go through each "Next" link) and let me know if they answer your question: https://github.com/threedworld-mit/tdw/blob/master/Documentation/lessons/read_write/overview.md
See the documentation for composite objects: https://github.com/threedworld-mit/tdw/blob/master/Documentation/lessons/composite_objects/overview.md You could interact with them via a first person avatar by sending apply_force and apply_torque commands to the sub-objects.
Once the object is in the scene, the physics engine may cause it to move. The best way to avoid perturbation is a) make the object kinematic with set_kinematic_state (this will cause the object to never move) and/or set the positions of the objects only on the first communicate() call (Unity sometimes interprets teleports as very fast changes in velocity) |
Thank you, @alters-mit! Your guidance is invaluable during these times. Using the FPA, I successfully managed to move objects around, place them where needed, remove them from the scene, and even add new objects via a simple script that opens a pop-up input field for entering the "model type." Now, I’m working on saving the scene data to a JSON file, and overall, it’s going well. However, I’ve encountered some issues when trying to load that file and instantiate the environment from it. Here’s the process I’m following:
The problem arises here: it seems the object Do you have any suggestions on how to resolve this? I currently can’t restore the scene with the intended changes from the file. Thanks again for your help! |
Hi @alters-mit , any news about this Issue? |
Hi, thanks for the great work. This tool looks very interesting and I was trying to implement the "pick up" and "put down" object actions as in your documentation and tutorials (btw they are great!) you mention that these are not built-in.
I am facing some issues when executing the "pick up" action. This is the error from Python.
Here I paste my code, maybe you can give me some feedback or ideas.
Now the error says to check the Editor.log file and it's empty! Do you have any ideas or feedback? Is this feasible? Or do you know any implementation of it?
Thank you once again!
The text was updated successfully, but these errors were encountered: