AirSim icon indicating copy to clipboard operation
AirSim copied to clipboard

Lidar sensor performs differently in different scenes with same settings

Open whxru opened this issue 7 years ago • 8 comments

Hello everyone, I'm trying to make the lidar sensor become a downward obstacle detector within a range, but with the same settings.json, the lidar sensor performs differently in Blocks and CityEnviron which I download directly from the github release (version 1.2.1).

The perfom in Blocks: 图片1

The perfom in CityEnviron: 图片2

The settings.json:

{
	"SettingsVersion": 1.2,
	"SimMode": "Multirotor",
	"Recording": {
		"Cameras": [
			{
				"ImageType": 2,
				"PixelsAsFloat": true,
				"Compressed": false
			}
		]
	},
	"CameraDefaults": {
		"CaptureSettings": [
			{
				"ImageType": 0,
				"Width": 1920,
				"Height": 1080
			},
			{
				"ImageType": 2,
				"Width": 480,
				"Height": 270
			}
		]
	},
	"Vehicles": {
		"COOLA-Drone": {
			"VehicleType": "SimpleFlight",
			"X": 0, "Y": 0, "Z": 0,
			"Sensors": {
				"BottomObstacleDetector": {
					"SensorType": 6,
					"Enabled": true,
					"Range": 5,
					"NumberofChannels": 4,
					"RotationsPerSecond": 10,
					"PointsPerSecond": 1000,
					"X": 0, "Y":0, "Z": 0,
					"Roll": 0, "Pitch": 0, "Yaw": 0,
					"VerticalFOVUpper": -80,
					"VerticalFOVLower": -100,
					"HorizontalFOVStart": 0,
					"HorizontalFOVEnd": 180,
					"DrawDebugPoints": true,
					"DataFrame": "SensorLocalFrame"
				}
			}
		}
	}
}

Besides potential bug I wanna ask a question that what exactly the "HorizontalFOVStart" and "HorizontalFOVEnd" mean? Why could I get a complete scanning area like a circle with HorizontalFOVStart 0 and HorizontalFOVEnd 180? It seems like I should get this with HorizontalFOVEnd 359.

whxru avatar Apr 02 '19 02:04 whxru

@whxru

This is definitely a logic issue in airsim, but the reason you are having unexpected LiDAR response is because of your vertical field of view range. your horizontal fov is only a half circle, so the max angle for vertical fov is -90/90 degrees. Going over this value causes a problem with the sensor constructor.

The underlying problem will require a fix inside of airsim, but a workaround for you would be to set your VerticalFOVLower value to -90

msb336 avatar Apr 02 '19 21:04 msb336

@msb336 Thanks for your reply, I agree with you that going over the maximum angle might be one of the reasons, but I tried this settings.json:

"Sensors": {
	"BottomObstacleDetector": {
		"SensorType": 6,
		"Enabled": true,
		"Range": 5,
		"NumberofChannels": 4,
		"RotationsPerSecond": 10,
		"PointsPerSecond": 1000,
		"X": 0, "Y":0, "Z": 0.01,
		"Roll": 0, "Pitch": 0, "Yaw": 0,
		"VerticalFOVUpper": -88,
		"VerticalFOVLower": -92,
		"HorizontalFOVStart": 0,
		"HorizontalFOVEnd": 359,
		"DrawDebugPoints": true,
		"DataFrame": "SensorLocalFrame"
	}
}

But the performance in CityEnviron: 图片1 the performance in Blocks: 图片2 The perfomance in Blocks is exactly what I want, but I'll run my program in CityEnviron.

whxru avatar Apr 08 '19 02:04 whxru

@msb336 And I found that in CityEnviron the point cloud of lidar data is empty after changing the direction of drone(by setting yaw argument in moveByVelocityAsync() and in Blocks I got an error "AttributeError: 'LidarData' object has no attribute 'pose'" while using getLidarData().

whxru avatar Apr 10 '19 02:04 whxru

@whxru Hello,I also meet the question same with you.Have you solved this problem?

lcyawym avatar May 02 '19 08:05 lcyawym

@lcyawym Not yet, but I use the default configuration and distinguish those points after getting them.

whxru avatar May 03 '19 12:05 whxru

@whxru I solved this problem.You can update your airism or go to the path of the question where remind lost pose and add pose = Pose() . It will work.

lcyawym avatar May 03 '19 12:05 lcyawym

I think your problem may be solved by this pr

msb336 avatar Oct 08 '19 18:10 msb336

The PR has been approved.

ironclownfish avatar Oct 08 '19 20:10 ironclownfish