question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Some confusions about the objects

See original GitHub issue

Hello,when I read the tutorial, here are some objects I can not figure out what are they suppose to be. And as follows: 1.BowlDirty, BowlFilled,Dirt which is actionable and has state? 2.EggFried,EggShell,LettuceSliced,MugFilled,PotatoSliced,SoapBottleFilled,TissueBoxEmpty,TomatoSliced,ContainerFull,what’s the actionable action suppose to be?

Sorry about the elementary questions put up here, but looking forward to your answer.Thanks a lot~

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
winthoscommented, Mar 25, 2019
  1. As long as you change the bread object’s AnimState1 value to 2, the SimObj script will update the object type for you. Your slice action only needs to change the AnimState1.

  2. Changing the mug to the full state works the same way as slicing bread. Any objects that are actionable have multiple animation states, and swapping to them by changing the AnimState1 int parameter will just change the model to that version. If you want to do something like make sure you bring the mug to a sink with water coming out, you will need to make new logic to reinforce that restriction yourself. For example, if you just make a fill action that requires a target mug, it will instantly turn the mug into the filled version as soon as you switch it’s AnimState1 value to 2. If you want to additionally make sure the sink is on and water is coming out, you will need to access the sink’s AnimState1 and change it so that it is in the “on” state. Then, you could make some logic that if the sink is in the “on” state and you have a mug, you can then change the mug to filled.

  3. The TissueBox, like all the other actionable objects, controls its state by changing the AnimState1 parameter on its Animator component.

  4. Plates do not have the receptacle functionality, so by default they cannot have other objects placed on/in them.

All actionable objects have their state change functionality implemented the same way. Changing parameters on the Animator component of an actionable object will cause it to change state.

You can open up the Animator window in the Unity editor by going to Window->Animator (make sure NOT to pick Window->Animation, that is different and not what you need)

Each Animator looks like this in the Unity Editor, and when you select an object in the Hierarchy view, it’s corresponding Animator will be shown.

screen shot 2019-03-06 at 10 31 45 am

Click on the Parameters tab in the animator window to see all the object’s states. Most objects have 4 states, but really only make use of 2 of them. Note that there is a single Parameter AnimState1 which is just an int. Setting the AnimState1 parameter to 0, 1, 2 etc. will change the state to whatever object version is linked to that animation state, and when doing so the SimObj Type will update accordingly. Note that some objects only have 2 states, others have multiple.

You may find it useful to go into the Unity Editor and play around with the AnimState1 values to see what kinds of states each object has. If you have the Scene view open as well as the Animator window open in the editor, hitting Play will allow you to edit the AnimState1 value at runtime without having to do any scripting first. This is useful just to make sure you are setting an object to the state you want it to be in.

screen shot 2019-03-06 at 10 38 41 am

In the above example you can see that the editor is in Play mode, and I’ve selected a mug. Just type into the AnimState1 field and you can change the state of the mug as shown in this second image.

screen shot 2019-03-06 at 10 39 08 am

Remember, you can do this programmatically using the example script linked in the other response. I will repost it here for convenience. Put this script anywhere in the DiscreteRemoteFPSAgentController.cs script and you will be able to access it with the same syntax as any other action. Refer to this (https://github.com/allenai/ai2thor/issues/31) for more details about the Action system implementation and syntax.

public void SliceObject(ServerAction action)
		{
			if(action.objectId == null)
			{
				Debug.Log("no target ID given");
				actionFinished(false);
				return;
			}

			foreach (SimObj so in VisibleSimObjs(action))
			{
				if(so.UniqueID == action.objectId)
				{
					so.Animator.SetInteger("AnimState1", 2);
					actionFinished(true);
					return;
				}
			}
		}

the SetInteger() function here lets you set AnimState1 to whatever state you might need for the object. Remember that these are object specific, so to be sure you are state changing to what you want, go into the editor and double check the states at runtime.

Also to bring up another point from one of your previous comments, the Dirt object is kind of an outlier, and does not use this Animator/Animation State logic to control it.

Edit: Note that the above information no longer applies to THOR version 1.0, as different logic not tied to the animator component is used for animation based state changes

1reaction
winthoscommented, Mar 6, 2019

The dirt object itself is just a decal that is on the floor or on the walls/mirror of certain scenes. The dirt itself is not used to change the Bowl to BowlDirty.

To change the Bowl to DirtyBowl, or to change a DirtyBowl to a Bowl, you will need to make your own action similar to the Slice() function linked in my previous comment. You can add some additional checks to the Slice() function so that it will only succeed if the Agent has a Knife in its inventory, but by default there are no context sensitive restrictions to custom actions. You will need to create all these custom actions and any restrictions for using them yourself.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Examples of objects subject to confusion in the recognition ...
Examples of objects subject to confusion in the recognition module. The object in the middle shows a tape roll. The same object from...
Read more >
An account of objects identification confusions.
In 2 experiments, trained military observers identified vehicles in infrared (thermal) imagery that varied in distance, signal-to-noise ratio, ...
Read more >
Confusion about articles before unique objects in math
Confusion about articles before unique objects in math ... I am a graduate math student, English is my second language but we have...
Read more >
Understanding the structural determinants of object ...
Understanding the structural determinants of object confusion in memory: An assessment of psychophysical approaches to estimating visual similarity.
Read more >
Representation of Object Orientation in Children: Evidence ...
Mirror-image confusion has typically been characterized as a tendency to confuse left-right mirror images (i.e., stimuli related by reflection across a vertical ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found