Giter VIP home page Giter VIP logo

closeaircombat's People

Contributors

cloudhu avatar gikiman avatar jackory avatar liuqh16 avatar qiyuanzhang19 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

closeaircombat's Issues

AircraftSimulator use of bloods?

The class AircraftSimulator(BaseSimulator) has an attribute bloods. What exactly is the use of it? It will never get updated, except in SingleCombatTask(), where the attribute use_artillery is anyway always False or I did not find it as a config parameter, respectively.

Thanks for your help!

您好,我有一个可能的bug反馈

您好,在simulatior文件中,您和您的团队调取get_velocity返回速度时,注释的z轴指向为up,但jsbsim中返回的z轴速度似乎是向下的,如果这个错误确实存在的话,它应该还会对导弹的比例导引部分产生影响,因为导弹所用的坐标系为北天东坐标系,但导引部分接收到的目标速度矢量方向不是北天东的。谢谢,不知道我的理解是不是正确的。

关于buffer数据处理方式的疑问

您好,非常感谢您提供的源码,学到了很多。在buffer的处理中,有这样一段代码,它先将数据transpose成(1,2,0,...)格式,然后又做了一个reshape的行为。请问transpose这个数据步骤是必要的吗?我做了一个实验,发现直接将数据进行reshape操作,不进行transpose的动作,对结果没有什么影响。我猜测您是希望打乱数据,不知道这种想法对不对。

 @staticmethod
    def _cast(x: np.ndarray):
        return x.transpose(1, 2, 0, *range(3, x.ndim)).reshape(-1, *x.shape[3:])

heading_task.py中状态属性delta_heading与test_baseline_use_env.py中delta_heading不一致的问题

在“tasks/heading_task.py”文件中,delta_heading属性为目标偏航角与自身偏航角的差值,而在“test/test_baseline_use_env.py”文件中,PursueAgent类set_delta_value成员函数中采用的是北天东坐标系,在水平面的速度向量与LOS向量的夹角作为delta_heading。
训练时,您在“termination_conditions/unreach_heading.py”中将目标偏航角设置为期望航向,希望飞机自身通过改变偏航角与期望航向吻合。然而在测试时,您将目标方位作为期望航向,但是似乎希望飞机自身通过改变水平面速度方向与期望航向吻合,而速度方向与机身纵轴方向在6DOF模型中一般是不重合的(jsbsim中同样是6DOF,是否应该考虑因迎角和侧滑角带来的差异?)

关于安装与使用流程

我是第一次使用这个jsbsim仿真。看了你这边的介绍的代码安装流程,安装了jsbsim==1.1.6,
但是报错:Can not support the JSBSimenvironment.
是还需要安装jsbsim仿真或者其他东西吗?
希望能具体说一下,程序运行起来,都需要安装哪些环境,谢谢

传感器

请问,项目能否增加例如雷达的传感器,如果可以在哪一块修改呢

日志文件

请问怎么生成作战的飞行数据呢,经纬度,姿态那些,感激不尽,我本科毕设需要仿真飞行数据,但是感觉全部学好复杂这个,希望有前辈指教一下。

关于源码运行报错

请问运行python envs/JSBSim/test/test_baseline_use_env.py语句时,报如下错误:
JSBSim startup beginning ...

Could not open file: Path "E:/code/python_execise/CloseAirCombat-master/CloseAirCombat-master/envs/JSBSim/utils/../data/aircraft/f16/f16.xml"
JSBSim failed to open the configuration file: Path "E:/code/python_execise/CloseAirCombat-master/CloseAirCombat-master/envs/JSBSim/utils/../data/aircraft/f16/f16.xml"
Traceback (most recent call last):
File "E:\code\python_execise\CloseAirCombat-master\CloseAirCombat-master\envs\JSBSim\test\test_baseline_use_env.py", line 163, in
test_maneuver()
File "E:\code\python_execise\CloseAirCombat-master\CloseAirCombat-master\envs\JSBSim\test\test_baseline_use_env.py", line 142, in test_maneuver
env = SingleCombatEnv(config_name='1v1/NoWeapon/test/opposite')
File "E:\code\python_execise\CloseAirCombat-master\CloseAirCombat-master\envs\JSBSim\envs\singlecombat_env.py", line 12, in init
super().init(config_name)
File "E:\code\python_execise\CloseAirCombat-master\CloseAirCombat-master\envs\JSBSim\envs\env_base.py", line 31, in init
self.load()
File "E:\code\python_execise\CloseAirCombat-master\CloseAirCombat-master\envs\JSBSim\envs\env_base.py", line 55, in load
self.load_simulator()
File "E:\code\python_execise\CloseAirCombat-master\CloseAirCombat-master\envs\JSBSim\envs\env_base.py", line 64, in load_simulator
self._jsbsims[uid] = AircraftSimulator(
File "E:\code\python_execise\CloseAirCombat-master\CloseAirCombat-master\envs\JSBSim\core\simulatior.py", line 132, in init
self.reload()
File "E:\code\python_execise\CloseAirCombat-master\CloseAirCombat-master\envs\JSBSim\core\simulatior.py", line 168, in reload
Catalog.add_jsbsim_props(self.jsbsim_exec.query_property_catalog(""))
File "E:\code\python_execise\CloseAirCombat-master\CloseAirCombat-master\envs\JSBSim\core\catalog.py", line 553, in add_jsbsim_props
[name_jsbsim, access] = jsbsim_prop.split(" ")
ValueError: not enough values to unpack (expected 2, got 1)

您好,貌似有一个bug

您好,simulator.py中的168行是这样的:Catalog.add_jsbsim_props(self.jsbsim_exec.query_property_catalog(""))
但是,根据jsbsim官方文档,self.jsbsim_exec.query_property_catalog("")返回的是一个字符串,但是Catalog.add_jsbsim_props()函数的输入对象是一个列表。所以这会导致与期望的结果不一致。ps: self.jsbsim_exec.query_property_catalog("")这里的参数真的是空吗?

第二个问题是,simulator.py中的第165行,self.jsbsim_exec = jsbsim.FGFDMExec(os.path.join(get_root_dir(), 'data')),在data这个文件夹下边目前是没有数据的。

不知道是不是理解对了。

jsbsim中有飞控系统吗

我想问环境JSBsim中带有飞控系统嘛(或者说是电传)就是从舵面偏转到实现状态的转换底层的控制逻辑是不是PID呀,如果有的话,我想自己设计非线性控制器该怎么做呢

关于环境配置

请问最后一步- Initialize submodules(JSBSim-Team/jsbsim): git submodule init; git submodule update
具体怎么进行呢?我的理解是已经通过pip安装jsbsim了应该不必再从GitHub上重新下载JSBSim-Team/jsbsim了,那这步主要在什么地方执行呢,非常感谢!

硬件环境

请问一下,您开发时的硬件环境参数是怎样的,我们在本地训练时速度很慢。我们的CPU: i9-10900K,GPU:3070

环境配置完成,运行python envs/JSBSim/test/test_baseline_use_env.py出现问题

您好,控制台运行python envs/JSBSim/test/test_baseline_use_env.py代码后。会出现下列数据:
JSBSim Flight Dynamics Model v1.1.6 [GitHub build 320/commit b477f6312bee2fd3af4c4e5ba1a3e732ed2b99d4] Apr 30 2021 12:00:59
[JSBSim-ML v2.0]

JSBSim startup beginning ...

{'current_step': 1000}
然后程序就终止运行了,没有其他错误信息,请问是什么愿意呢?
环境包有部分与您要求的不一样(shapely没有1.7.1-cp38版本,我下载了1.8.2-cp38版本,gym==0.20.0下载安装失败,控制台报错error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1,所以我下载了gym=0.26.2版本)
盼望您的回复,感激不尽

AttributeError: 'list' object has no attribute 'split'

你好,安装好环境后运行报错了,报错代码如下:
Process Process-32: Traceback (most recent call last): File "/data/renyating/conda/envs/jsbsim/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap self.run() File "/data/renyating/conda/envs/jsbsim/lib/python3.8/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/home/jupyter-renyating/jsbsim/CloseAirCombat/envs/env_wrappers.py", line 207, in worker envs = [env_fn_wrapper() for env_fn_wrapper in env_fn_wrappers.x] File "/home/jupyter-renyating/jsbsim/CloseAirCombat/envs/env_wrappers.py", line 207, in <listcomp> envs = [env_fn_wrapper() for env_fn_wrapper in env_fn_wrappers.x] File "train/train_jsbsim.py", line 26, in init_env env = SingleControlEnv(all_args.scenario_name) File "/home/jupyter-renyating/jsbsim/CloseAirCombat/envs/JSBSim/envs/singlecontrol_env.py", line 10, in __init__ super().__init__(config_name) File "/home/jupyter-renyating/jsbsim/CloseAirCombat/envs/JSBSim/envs/env_base.py", line 31, in __init__ self.load() File "/home/jupyter-renyating/jsbsim/CloseAirCombat/envs/JSBSim/envs/env_base.py", line 55, in load self.load_simulator() File "/home/jupyter-renyating/jsbsim/CloseAirCombat/envs/JSBSim/envs/env_base.py", line 64, in load_simulator self._jsbsims[uid] = AircraftSimulator( File "/home/jupyter-renyating/jsbsim/CloseAirCombat/envs/JSBSim/core/simulatior.py", line 132, in __init__ self.reload() File "/home/jupyter-renyating/jsbsim/CloseAirCombat/envs/JSBSim/core/simulatior.py", line 168, in reload Catalog.add_jsbsim_props(self.jsbsim_exec.query_property_catalog("")) File "/home/jupyter-renyating/jsbsim/CloseAirCombat/envs/JSBSim/core/catalog.py", line 552, in add_jsbsim_props jsbsim_props_tmp=jsbsim_props.split("\n") AttributeError: 'list' object has no attribute 'split'
代码是在linux上运行的,环境是按照readme安装的。

1v1/ShootMissile/HierarchySelfplay训练效果很差

运行train_selfplay_shoot.sh,训练1v1下的导弹射击,效果很差,跑了两天,但是效果很差,基础的飞行控制都没有学会,经常低于安全高度而停止仿真,更别提发射导弹了。不知道大家有没有遇到过

bug反馈

1、singlecombat_env.py中的reset_simulators()函数,看您的注释标明的是switch side,我不是很明白。函数中的self.np_random.shuffle(init_states)语句依据随机数种子可能导致AircraftSimulators的初始状态与配置文件中的uid不对应,比如在1v1/NoWeapen/vsBaseline场景中,uid=A0100飞行器与uid=B0100飞行器初始状态发生互换。
2、另外,还有一个问题,env_base.py文件中load_simulator()方法,您读取配置文件时,错误的将color=config.get("color", "Red")写成color=config.get("team", "Red"),这会导致render显示时双方颜色均为默认值红色。

训练速度能提升么

您好,用了您这个环境,感觉非常好,很适合做多机空战的训练,真心感激您的分享。
这边有个问题,就是我想使用您的环境进行8v8战机的对抗训练,训练速度慢,6小时训练了几十万步,我看到gpu使用是2000m不到,想请问下您是否有什么办法能够提升这个训练速度,谢谢。

Error: multiple copies of the OpenMP runtime have been linked into the program

(base) D:\ProjectCode\ProjPy\CloseAirCombat-master>python envs/JSBSim/test/test_baseline_use_env.py
OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized.
OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see http://www.intel.com/software/products/support/.

Can anyone solve this issue?

高度奖励函数与新目标设置的问题

在heading任务中,新目标的设置与高度奖励函数可能存在一定的冲突,导致在训练好的模型出现恶化情况

# 在UnreachHeading类中
    self.increment_size = [0.2, 0.4, 0.6, 0.8, 1.0] + [1.0] * 10
    delta = self.increment_size[env.heading_turn_counts]
    delta_altitude = env.np_random.uniform(-delta, delta) * self.max_altitude_increment
    new_altitude = env.agents[agent_id].get_property_value(c.target_altitude_ft) + delta_altitude
# 随着heading_turn_counts的增大,delta_altitude的范围也会变大,导致new_altitude有大概率低于设置的安全海拔safe_altitude和,危险海拔danger_altitude
# 在AltitudeReward类中
    Pv = 0.
    if ego_z <= self.safe_altitude:
        Pv = -np.clip(ego_vz / self.Kv * (self.safe_altitude - ego_z) / self.safe_altitude, 0., 1.)
    PH = 0.
    if ego_z <= self.danger_altitude:
        PH = np.clip(ego_z / self.danger_altitude, 0., 1.) - 1. - 1.
    new_reward = Pv + PH
# 这会导致任务目标要求飞机维持在new_altitude,但是维持在这个高度会导致new_reward始终为负,
# 而保持航向的其他奖励又不足以弥补这个负奖励,所以我猜测飞机可能会避免到高转向数heading_turn_counts的状态,
# 这样避免碰到这种“必损”的任务要求。

我的训练过程也佐证了这一点,在经过一定训练后,平均奖励和平均转向数先是上升,当平均转向数大于5后,按200s计算,应该是有大量环境已经是由Timeout终结了,按情况后面平均转向数应该会逼近6的极限值,平均奖励应该是上升的。
但是在这之后,平均奖励与平均转向都开始下降(平均奖励几乎降为个位数,平均转向到还维持在4左右),我的分析是因为较好的模型使得大量环境能维持到长时间的状态,也就使得出现“必损”的任务要求的情况增大了,模型选择了某种止损的方法:“比如碰到该任务要求就直接选择以某种方法终止环境”,所有使得环境很难维持到Timeout。
我觉得这应该不是作者特意这么设计的,所以希望你们确认一下,谢谢!!!!

在运行train_heading.sh时遇到的问题

JSBSim startup beginning ...

Could not open file: Path "/home/robot/CloseAirCombat-master/envs/JSBSim/utils/../data/aircraft/f16/f16.xml"
JSBSim failed to open the configuration file: Path "/home/robot/CloseAirCombat-master/envs/JSBSim/utils/../data/aircraft/f16/f16.xml"
Attempt to divide by zero in method FGColumnVector3::operator/(const double scalar), object 0 , 0 , 0

A proper axis type has NOT been selected. Check your aerodynamics definition.
Traceback (most recent call last):
File "train/train_jsbsim.py", line 171, in
main(sys.argv[1:])
File "train/train_jsbsim.py", line 137, in main
envs = make_train_env(all_args)
File "train/train_jsbsim.py", line 44, in make_train_env
return SubprocVecEnv([get_env_fn(i) for i in range(all_args.n_rollout_threads)])
File "/home/robot/CloseAirCombat-master/envs/env_wrappers.py", line 263, in init
observation_space, action_space = self.remotes[0].recv().x
File "/home/robot/anaconda3/envs/jsbsim/lib/python3.8/multiprocessing/connection.py", line 250, in recv
buf = self._recv_bytes()
File "/home/robot/anaconda3/envs/jsbsim/lib/python3.8/multiprocessing/connection.py", line 414, in _recv_bytes
buf = self._recv(4)
File "/home/robot/anaconda3/envs/jsbsim/lib/python3.8/multiprocessing/connection.py", line 379, in _recv
chunk = read(handle, remaining)
ConnectionResetError: [Errno 104] Connection reset by peer

过载判断错误

extreme_acceleration = (
max(
[
abs(sim.get_property_value(JsbsimCatalog.accelerations_n_pilot_x_norm)),
abs(sim.get_property_value(JsbsimCatalog.accelerations_n_pilot_y_norm)),
abs(sim.get_property_value(JsbsimCatalog.accelerations_n_pilot_z_norm)),
]
) > 1e1
) # acceleration larger than 10G
应该是
extreme_acceleration = (
max(
[
abs(sim.get_property_value(JsbsimCatalog.accelerations_n_pilot_x_norm)),
abs(sim.get_property_value(JsbsimCatalog.accelerations_n_pilot_y_norm)),
abs(sim.get_property_value(JsbsimCatalog.accelerations_n_pilot_z_norm) + 1),
]
) > 1e1
) # acceleration larger than 10G

AttributeError: 'list' object has no attribute 'split'

你好我在运行 python .\envs\JSBSim\test\test_baseline_use_env.py ,即第一个演示视频时,出现了这一个报错,其溯源为 File "/home/zwz/Desktop/CloseAirCombat/envs/JSBSim/core/catalog.py", line 552, in add_jsbsim_props
jsbsim_props_tmp=jsbsim_props.split("\n"),请问应该如何修改呢

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.