DRL-AutonomousVehicles icon indicating copy to clipboard operation
DRL-AutonomousVehicles copied to clipboard

Adapting this project for an AirSim MultiRotor drone

Open kaihuchen opened this issue 7 years ago • 3 comments

This thread is created to keep track of some known issues related to adapting this project for the AirSim MultiRotor drone.

  1. Many walls in the Downtown neighborhood are not 'real', in the sense that the drone can pass through it and then get confused. Either needs to get this fixed in AirSim, or find tasks that bypass such a problem.
  2. The drone reset function does not work well. This is a big deal, since it is then impossible to have the drone restart another training session automatically and repeat it many many times. Need to work with the AirSim team on this, or find a workaround.
  3. The "Don't Collide with Things" reward/penalty criteria do not work well for the drone, since the drone can easily fly off into oblivion forever, and never learn anything useful. Other type of reward/penalty criteria are needed here.
  4. The drone does not stay in the same plane, even if instructed to fly only in the X-Y plane.

kaihuchen avatar Oct 14 '17 16:10 kaihuchen

  1. Continuous action spaces become necessary. Issue with baselines and multidimensional action spaces is know. Other integration frameworks like keras-rl support multidimensional action spaces.

Kjell-K avatar Oct 14 '17 20:10 Kjell-K

Workaround to 3. : I adapted for Multirotor and I am able to run episodes though my reset workaround:

ignorecollision2

    def reset(self):
        
        reset = False
        z = self.z
        while reset != True:

            now = self.getPosition()
            self.simSetPose(Pose(Vector3r(now.x_val, now.y_val, -30),Quaternionr(self.home_ori.w_val, self.home_ori.x_val, self.home_ori.y_val, self.home_ori.z_val)), True) 
            now = self.getPosition()
            
            if (now.z_val - (-30)) == 0:
                self.simSetPose(Pose(Vector3r(self.home_pos.x_val, self.home_pos.y_val, -30),Quaternionr(self.home_ori.w_val, self.home_ori.x_val, self.home_ori.y_val, self.home_ori.z_val)), True)
                now = self.getPosition()
                
                if (now.x_val - self.home_pos.x_val) == 0 and (now.y_val - self.home_pos.y_val) == 0 and (now.z_val - (-30)) == 0 :
                    self.simSetPose(Pose(Vector3r(self.home_pos.x_val, self.home_pos.y_val, self.home_pos.z_val),Quaternionr(self.home_ori.w_val, self.home_ori.x_val, self.home_ori.y_val, self.home_ori.z_val)), True)
                    now = self.getPosition()
                    
                    if (now.x_val - self.home_pos.x_val) == 0 and (now.y_val - self.home_pos.y_val) == 0 and (now.z_val - self.home_pos.z_val) == 0:
                        reset = True
                        self.moveByVelocity(0, 0, 0, 1)

Constrains: The drone can not have obstacles in above z direction. I am highly looking forward to a real reset API

Kjell-K avatar Oct 14 '17 20:10 Kjell-K

Comment to 5:

I do not see this problem. You have to make sure to pass a constant z in APIs like moveByVelocityZ and moveByAngle.

Do not make the mistake to set z directly before and inbetween performing the actions, since the drone changes intermediate the z value, when pitching / rolling. This builds up indeed in a decrease of z position.

TL;TR: Set z global rather then local in between close actions.

Kjell-K avatar Oct 14 '17 20:10 Kjell-K