Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getLidarData() doesn't work well in Blocks and cunstom environment #1912

Closed
orangeccc opened this issue Apr 25, 2019 · 7 comments
Closed

getLidarData() doesn't work well in Blocks and cunstom environment #1912

orangeccc opened this issue Apr 25, 2019 · 7 comments

Comments

@orangeccc
Copy link

I use the same simple test code for collecting lidar data and vehicle trajectory as below:

    i=0
    traj = []
    while(i<250):
        lidarData = client.getLidarData()
        car_state = client.getCarState()
        points = parse_lidarData(lidarData)
        numpy.savetxt("points\{}.csv".format(i),points)
        a = car_state.kinematics_estimated.position
        traj.append([a.x_val, a.y_val, a.z_val, car_state.timestamp]r)
        i += 1
        time.sleep(0.1)
    numpy.savetxt("trajectory.csv", traj)

But I find it works differently in different environment. When using CityEnviron , the center of the point cloud changes correctly as the vehicle moves , so I can get a point cloud scene of the environment by merging all points clouds as shown in Fig 1. The point cloud centers follows the trajectory (red points ) well.
5689861b80b2ef3514d4018d9c588e5
Fig 1 lidar points in CityEnviron

However , the center of the point cloud doesn't change as the vehicle moves when using Blocks or other custom environment ,Fig 2. It seems something wrong with getLidarData().
59e689f06b216f4df03ba34152e3db9
Fig 2 lidar points in Blocks

Maybe it is similar with #1865 , but I'm not quite sure.

Thanks for any help!

  • Windows 10, AirSim 1.2.0, Python 3.6.3, Unreal 4.19
@v-prgmr
Copy link

v-prgmr commented Apr 25, 2019

@orangeccc , What is platform used for visualization?

@orangeccc
Copy link
Author

@vishal-prgmr CloudCompare. See https://github.com/CloudCompare/CloudCompare

@msb336
Copy link
Contributor

msb336 commented Apr 25, 2019

@vishal-prgmr
Can you copy and paste your settings.json file used? There is an option to specify which frame you want LiDAR to return in (global, or sensor local). You can see more here.

@orangeccc
Copy link
Author

@msb336 Thanks! I used the SensorLocalFrame for DataFrame Option , now I change to VehicleInertialFrame and it works.
image

@lcyawym
Copy link

lcyawym commented Apr 30, 2019

@orangeccc hello, I have some errors on get lidar data,can you show your setting flie?When I simulation it always happen that no vehicle named or no lidar on vehicle 。 I think maybe something wrong on setting files。 thankyou

@v-prgmr
Copy link

v-prgmr commented Apr 30, 2019

@lcyawym

May be this is helpful

{
"SeeDocsAt": "https://github.com/Microsoft/AirSim/blob/master/docs/settings_json.md",
"SettingsVersion": 1.2,

"SimMode": "Car",
"RecordUIVisible": true,
"LogMessagesVisible": true,
"ViewMode": "",
"Recording": {
"RecordOnMove": false,
"RecordInterval": 0.05,
"Cameras": [
    { "CameraName": "4", "ImageType": 0, "PixelsAsFloat": false, "Compress": true },
	{ "CameraName": "4", "ImageType": 3, "PixelsAsFloat": false, "Compress": true }
]

},
"CameraDefaults": { 
"CaptureSettings": [
  {
    "ImageType": 0,
    "Width": 1280,
    "Height": 960,
    "FOV_Degrees": 90
   },
   {
    "ImageType": 3,
    "Width": 1280,
    "Height": 960,
    "FOV_Degrees": 90
   },
   {
    "ImageType": 5,
    "Width": 1280,
    "Height": 960,
    "FOV_Degrees": 90
   }
   
]
},

"SubWindows": [
				{"WindowID": 0, "ImageType": 0, "CameraName": "front_custom", "Visible": true},
				{"WindowID": 1, "ImageType": 3, "CameraName": "front_custom", "Visible": true},
				{"WindowID": 2, "ImageType": 5, "CameraName": "front_custom", "Visible": true}
			  ],
 "Vehicles": {
    "EgoCar": {
        "VehicleType": "PhysXCar",
        "AutoCreate": true,
		"Cameras": {
			"front_custom": {
			"CaptureSettings": [
			  {
				"ImageType": 0,
				"Widthidth": 1280,
				"Height": 960,
				"FOV_Degrees": 90
				
			  },
			  {
				"ImageType": 3,
				"Widthidth": 1280,
				"Height": 960,
				"FOV_Degrees": 90
				
			  },
			  {
				"ImageType": 5,
				"Width": 1280,
				"Height": 960,
				"FOV_Degrees": 90
				
			  }
			],
				
			
			"X": 0, "Y": 0, "Z": -1.9,
			"Pitch": 0, "Roll": 0, "Yaw": 45    
			}
		  },
		
		"Sensors": {
            "LidarSensor1": { 
                "SensorType": 6,
                "Enabled" : true,
                "NumberOfChannels": 16,
				"Range": 100,
                "RotationsPerSecond": 10,
                "PointsPerSecond": 100000,
                "X": 0, "Y": 0, "Z": -1.9,
                "Roll": 0, "Pitch": 0, "Yaw" : 0,
                "VerticalFOVUpper": 10,
                "VerticalFOVLower": -10,
                "HorizontalFOVStart": -360,
                "HorizontalFOVEnd": 360,
                "DrawDebugPoints": true,
                "DataFrame": "VehicleInertialFrame"
            }		
        }
    }
}

}

@catproof
Copy link

catproof commented Oct 29, 2021

@orangeccc hello, I have some errors on get lidar data,can you show your setting flie?When I simulation it always happen that no vehicle named or no lidar on vehicle 。 I think maybe something wrong on setting files。 thankyou

@lcyawym you also have to specify which vehicle you are getting the lidar data from. for example, in python write: client.getLidarData(lidar_name = "LidarSensor1")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants