sryu1/jsbgym

turn heading control task

Closed this issue · 23 comments

TurnHeadingControlTask: aircraft must turn to face a random target heading while maintaining their initial altitude
Screenshot 2023-02-24 062609

I trained the model. but it is not performing turn task. Turn heading control task is same as heading control task ? what is the main difference between the two task? turn heading control task will not let the agent to turn when face the random target ? but env.render() is executing then there is no target showing

sryu1 commented

Hi @jawadada, there's a high chance that the agent wasn't trained properly, as you can see in execution 38, you would have loaded up the model from 2.924 million timesteps, which for me, was the highest point, if you see logs for 10m steps for you, it's only 57 points. is it possible if you can view your data with tensorboard? If you don't know how to use it, just send me the logs folder and I'll see for you. To be honest, I've got no idea why turn heading control task exists, the original is from Gor-Ren's gym-jsbsim and I just left it there. I recommend you use just heading control task. However, to answer your question, it is meant to turn towards a random heading and maintain it.

sryu1 commented

In a recent commit, I added a PA-28, and it works better than the cessna 172p in headingcontroltask.

env = gym.make("JSBSim-HeadingControlTask-PA28-Shaping.STANDARD", render_mode="flightgear")

You'll have to update the jsbgym module though.

sryu1 commented

image
This is what I have noticed until now, yellow is PA-28 heading control task with default hyperparameters, blue and dark blue is turn heading control task with c172p, and pink is c172p with turn heading control task with a hyperparameter from a research paper. However, I have not been able to finish training to 10 million to see final results due to not having much time.

You are right Dear, The agent may not be trained properly..I will train it again on Sunday for 10 million and will let you know how it goes. Turn Heading control task is very important for me.;;
I was just thinking Aircraft is RL agent and for this task the Aircraft will turn to random target.. From where the random target will come in Flight gear simulation..? what will be the random target? It's any other aircraft ? Because Flight gear doesn't support any object in air except aircrafts. I read the turn heading control task code..It's written target tracking commands..
Kindly share your opinion Please

sryu1 commented

The random target is a randomly generated heading for each episode

    def _get_target_track(self) -> float:
        # select a random heading each episode
        return random.uniform(self.target_track_deg.min, self.target_track_deg.max)

is there a particular thing you need?

sryu1 commented

like something which it always turns towards a certain heading?

Yes exactly , I need aircraft to always turn towards to certain target heading... Can you please share your expert opinion how to design this logic to implement in algorithm. I would be very thankful for your kind help Dear

sryu1 commented

So do you require to set the heading or is it fine as long as the heading is random and the same throughout the whole time?

The heading can be random through out the whole time.

sryu1 commented

Ah ok, I'll see what I can do with that, I'll add it to my todo list, if you know what to do, pull requests are welcome! Please note that I don't really have much time though.

Sir I will be extremely thankful for your kind help and kind Guidance

Dear Sir,
I was rendering the untrained agent using the Turn heading control task but the target was not showing during each episode...In the current code if we don't do any changes and train the agent to 10 million time steps then Target will be shown?

sryu1 commented

No, I don't think it shows the target at all...

Then how aircraft will turn during flight to perform task?

sryu1 commented

It has a random heading but doesn't show it.

Is it possible to show any target in flight gear to which our Agent will turn? Any logic in coding to do this in Turn Heading control task ?

sryu1 commented

I'll see what I can do with that, it's pretty hard to put extra things in flightgear but we'll see.

Thank you so much Sir for your kind Guidance... The purpose of Turn Heading Control Task is to turn agent to face towards random target...I don't want to change the task but I only want to show the target in Flight gear to which our agent will turn to...
"TurnHeadingControlTask: aircraft must turn to face a random target heading while maintaining their initial altitude "
It's saying in original task description that agent will maintain its altitude and will turn to random target... If random target is shown in flight gear towards our agent will turn then visualization will be perfect and very clear to understand..
Thank you so much Sir for your kind Guidance...

sryu1 commented

I'm not sure if you know but it's extremely hard to add extra visualisation to flightgear, also, this is a jsbsim environment more than a flightgear one, it just uses flightgear as a render mode.

If there is no visualization, then Heading control task and turn heading control tasks looks same to new person watching in Flight Gear? Do you have any idea how to design logic for code if we want to show the target in JSBSim.. I know it's only rendering on Flight Gear... Main is JSBSim.. Do you think this is impossible or not feasible at all?

sryu1 commented

Like I told you before, the original project is from Gor-Ren, and he implemented most of the features here so I'm not too sure why it exists.

You were 100% right.. Target can't be shown on Flight Gear... Because Flight Gear is Realistic Environment of real flying... If we want to show two planes then it's possible only by Multiplayer... Showing target plane by Turn heading control task is not feasible

sryu1 commented

Yeah, that's about right.