#HELP, ML agent Real robot implementation code review

1 messages · Page 1 of 1 (latest)

near pewter
#

hello guys, I'm trying to learn ml agents so that i can import the "brain" into a real life robot, its my second ever ml agents script, would you guys be able to review the code and tell me if there are things that i can improve about it ?, ill add all the details when i send the code

#

this is the model, its a six legged hexapod, its built from the main body to each leg using the ArticulationBody component, at the end of each leg i added a collider so that it doesnt just fall in the void, the task that im trying to make it learn is to move in a straight line with a balanced motion towards the goal. the second image is the scenario in which im training it (the red walls reset the agent and apply a penalty and the green walls is the goal. they are slightly tilted to the left because for some reason when the scene starts and the robot gets to a stable position with its legs it slightly tilts to the left, probably because of bounces; the bounces seem constant so i didnt worry much about that and just added a delay on the code of about 2 seconds to let the bot stabilise and then let the agent start learning each generation / reset. if you could also give me an idea on how to fix the tilt it would be much appreciated. so now onto how the joints work, each joint has an upper drive and lower drive limit that i put in the gui. unsure on how to put it in the code i just hoped that it would count that limitation when testing each joint is setup like the 3rd image just with different limits for each type of joint.
so now onto the code:

#

this is the code, its pretty well commented so if you could review it and tell me what to imrpove it would be appreciated, thanksl

#

HELP, ML agent Real robot implementation code review