anyone meets problem in function “ client.simGetCameraInfo”? #4273
Replies: 3 comments 1 reply
-
Hi @dellhuyongcai, You said that you want to set the param but you are using get function - |
Beta Was this translation helpful? Give feedback.
-
sorry,the problem is the function “ client.simGetCameraInfo"has errors,the following is my code: import setup_path """ Example Settings for external camera - { Just change the below to test different cameras easily!CAM_NAME = "fixed1" client = airsim.VehicleClient() tmp_dir = os.path.join(tempfile.gettempdir(), "airsim_cv_mode") print(f"Camera: {CAM_NAME}, External = {IS_EXTERNAL_CAM}") Test Camera infocam_info = client.simGetCameraInfo(CAM_NAME, external=IS_EXTERNAL_CAM) Test Image APIsairsim.wait_key('Press any key to get images') requests = [airsim.ImageRequest(CAM_NAME, airsim.ImageType.Scene), def save_images(responses, prefix=""):
responses = client.simGetImages(requests, external=IS_EXTERNAL_CAM) Test FoV APIairsim.wait_key('Press any key to change FoV and get images') client.simSetCameraFov(CAM_NAME, 120, external=IS_EXTERNAL_CAM) responses = client.simGetImages(requests, external=IS_EXTERNAL_CAM) new_cam_info = client.simGetCameraInfo(CAM_NAME, external=IS_EXTERNAL_CAM) Test Pose APIsnew_pose = airsim.Pose(airsim.Vector3r(-10, -5, -5), airsim.to_quaternion(0.1, 0, 0.1)) responses = client.simGetImages(requests, external=IS_EXTERNAL_CAM) new_cam_info = client.simGetCameraInfo(CAM_NAME, external=IS_EXTERNAL_CAM) Test Distortion params APIsdist_params = client.simGetDistortionParams(CAM_NAME, external=IS_EXTERNAL_CAM) new_params_dict = {"K1": 0.1, "K2": 0.01, "K3": 0.0, "P1": 0.0, "P2": 0.0} dist_params = client.simGetDistortionParams(CAM_NAME, external=IS_EXTERNAL_CAM) the errors happens at "cam_info = client.simGetCameraInfo(CAM_NAME, external=IS_EXTERNAL_CAM)",error information is "msgpackrpc.error.RPCError: rpclib: client error C0002: Function 'simGetCameraInfo' was called with an invalid number of arguments. Expected: 3, got: 2",the version of airsim is v1.6.0 that downloaded from the offical website. |
Beta Was this translation helpful? Give feedback.
-
I think you are trying to call Anyway, if you want to get info for a built-in camera, you can use something like the code below, and change
|
Beta Was this translation helpful? Give feedback.
-
I want to set the camera parameters by function "simGetDistortionParams(self, camera_name, vehicle_name = '', external = False)" ,but the function returns the error in the following.
msgpackrpc.error.RPCError: rpclib: client error C0002: Function 'simGetCameraInfo' was called with an invalid number of arguments. Expected: 3, got: 2
anyone meets this error?looking forward to your good replay.thanks a lot!
Beta Was this translation helpful? Give feedback.
All reactions