• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Icaro-Lima-TFG · May 25, 2019 at 11:23 PM · agentrocketland

Problem on Landing a 2D Rocket with ML-Agents

I'm trying to land a rocket, and the simplest thing I thought of doing was putting it to stand. I am not currently worrying about how strong it will hit the ground.

Here's how I am collecting observations:

 public override void CollectObservations()
 {
     AddVectorObs(Mathf.Sin(_rigidbody2D.rotation * Mathf.PI / 180));
     AddVectorObs(Mathf.Cos(_rigidbody2D.rotation * Mathf.PI / 180));
     AddVectorObs(_rigidbody2D.angularVelocity);
 }

Here's how I treat the actions and give rewards:

 public override void AgentAction(float[] vectorAction, string textAction)
 {
     _service.SetLeft(vectorAction[0] > 0);
     _service.SetRight(vectorAction[1] > 0);
 
     Cos = Mathf.Cos(_rigidbody2D.rotation * Mathf.PI / 180);
 
     AddReward(Cos);
 
     if (_collided || _rigidbody2D.position.y <= -12)
     {
         Done();
     }
 }

Already training a lot of time and does not seem to be stabilizing. Assuming that _service.SetLeft and _service.SetRight adds torque, and them are correct, what i'm doing wrong?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

105 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to make particle emitters attached to specific parts of a player model? 1 Answer

How can I make something like Star Trek? 0 Answers

OnCollisionEnter problem (RocketJump script) 1 Answer

lost nav agent target memory in prefabs 1 Answer

Why Nav Mesh Agent has been baked intermittently on 1 straight component? 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges