rospy dji_sdk - вызов службы dji_sdk rospy hot_point_upload? - PullRequest
0 голосов
/ 09 декабря 2018

Я пытаюсь вызвать службу ros dji_sdk hot_point_upload, но кажется, что объект создан неправильно -

import rospy
from core_api.srv import *
from dji_sdk.srv import *

def hotPointUpload():
    print 'call function hotpoint'
    rospy.wait_for_service('/flytos/dji_sdk/mission_hotpoint_upload')
    print 'after wait for service'
    try:
        handle = rospy.ServiceProxy('/flytos/dji_sdk/mission_hotpoint_upload', MissionHpUpload)
        print 'define handle'
        hotpointtask = {}
        hotpointtask["hotpoint_task"] = {}
        hotpointtask["hotpoint_task"]["latitude"] = 32.9180
        hotpointtask["hotpoint_task"]["longitude"] = 34.8192
        hotpointtask["hotpoint_task"]["altitude"] = 14
        hotpointtask["hotpoint_task"]["radius"] = 30
        hotpointtask["hotpoint_task"]["angular_speed"] = 5
        hotpointtask["hotpoint_task"]["is_clockwise"] = 0
        hotpointtask["hotpoint_task"]["start_point"] = 0
        hotpointtask["hotpoint_task"]["yaw_mode"] = 0
        print(hotpointtask)
        resp = handle(hotpointtask)
        print 'wait resp'
        return resp
    except rospy.ServiceException, e:
        rospy.logerr("service call failed %s", e)
        return e


print(hotPointUpload())
...