本文整理汇总了Python中utils.loginfo函数的典型用法代码示例。如果您正苦于以下问题:Python loginfo函数的具体用法?Python loginfo怎么用?Python loginfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了loginfo函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: get_data
def get_data(self,bodies,body_id,time):
data = QuadPosition()
data.found_body = False
if bodies==[]:
utils.loginfo("Gazebo not started")
else:
if hasattr(bodies,'name'):
if body_id<len(bodies.name):
data.found_body=True
data.x=bodies.pose[body_id].position.x
data.y=bodies.pose[body_id].position.y
data.z=bodies.pose[body_id].position.z
x = bodies.pose[body_id].orientation.x
y = bodies.pose[body_id].orientation.y
z = bodies.pose[body_id].orientation.z
w = bodies.pose[body_id].orientation.w
dcm = quat_to_dcm(w,x,y,z)
(roll,pitch,yaw) = dcm.to_euler()
data.pitch=degrees(pitch)
data.roll=degrees(roll)
data.yaw=degrees(yaw)
else:
print 'Body not found'
return copy.deepcopy(data)
开发者ID:KTH-AEROWORKS,项目名称:quad-suspended-load,代码行数:29,代码来源:ros_mocap_sim.py
示例2: tool
def tool(request, appname):
# if we are here, we have been given a particular appname, e.g. "keyinfo", as part of the url
context = {'applayout': appLayout[appname]}
if request.method == 'POST':
form = forms.Form(request.POST)
elif request.method == 'GET':
form = forms.Form(request.GET)
else:
form = forms.Form()
if form.is_valid():
loginfo(appname, context, request)
context = dispatch(context, request, appname)
#context['form'] = form
context = setconstants(request, context, appname)
loginfo(appname, context, request)
# special case: the data endpoint returns JSON
if appname == 'data':
return HttpResponse(json.dumps(context['data']))
else:
return render(request, 'toolbox.html', context)
开发者ID:cspace-deployment,项目名称:django_example_config,代码行数:25,代码来源:views.py
示例3: Set_Flight_Mode
def Set_Flight_Mode(NODE_NAME,MODE):
return_value=True
#Change the flight mode on the Pixhawk flight controller
try:
rospy.wait_for_service('/mavros/set_mode',10)
except:
utils.logerr('Mavros is not available')
return_value=False
utils.loginfo('Changing flight mode to '+MODE+' ...')
rospy.sleep(2)
try:
change_param=rospy.ServiceProxy('/mavros/set_mode',SetMode)
param=change_param(0,MODE)
except:
utils.logerr('Cannot change flight mode')
return_value=False
if param.success:
utils.loginfo('Flight mode changed to '+MODE)
else:
utils.logerr('Cannot change flight mode')
return_value=False
return return_value
开发者ID:roussePaul,项目名称:kampala,代码行数:28,代码来源:sml_setup.py
示例4: get_data
def get_data(self,body):
data = QuadPosition()
body_id = body
data.found_body = False
if self.bodies==[]:
utils.loginfo("Gazebo not started")
else:
if hasattr(self.bodies,'name'):
if body_id<len(self.bodies.name):
data.found_body=True
data.x=self.bodies.pose[body_id].position.x
data.y=self.bodies.pose[body_id].position.y
data.z=self.bodies.pose[body_id].position.z
x = self.bodies.pose[body_id].orientation.x
y = self.bodies.pose[body_id].orientation.y
z = self.bodies.pose[body_id].orientation.z
w = self.bodies.pose[body_id].orientation.w
dcm = quat_to_dcm(w,x,y,z)
(roll,pitch,yaw) = dcm.to_euler()
data.pitch=degrees(pitch)
data.roll=degrees(roll)
data.yaw=degrees(yaw)
print "Sending data for the body with id: "+str(body_id)
else:
print 'Body not found'
return(data)
开发者ID:roussePaul,项目名称:kampala,代码行数:33,代码来源:ros_mocap_sim.py
示例5: Set_Flight_Mode
def Set_Flight_Mode(MODE):
"""This function sets the flight mode of the drone to MODE."""
return_value=True
#Change the flight mode on the Pixhawk flight controller
try:
rospy.wait_for_service('mavros/set_mode',10)
except:
utils.logerr('Mavros is not available')
return_value=False
utils.loginfo('Changing flight mode to '+MODE+' ...')
rospy.sleep(2)
try:
change_param=rospy.ServiceProxy('mavros/set_mode',SetMode)
param=change_param(0,MODE)
while param.success==False:
param=change_param(0,MODE)
if param.success==False:
utils.logerr('Cannot change flight mode')
if param.success:
utils.loginfo('Flight mode changed to '+MODE)
else:
utils.logerr('Cannot change flight mode')
return_value=False
except:
utils.logerr('Cannot change flight mode')
return_value=False
return return_value
开发者ID:KTH-AEROWORKS,项目名称:quad-suspended-load,代码行数:33,代码来源:sml_setup.py
示例6: prepareFiles
def prepareFiles(request, validateonly):
tricoder_fileinfo = {}
tricoder_files = []
numProblems = 0
for lineno, afile in enumerate(request.FILES.getlist('tricoderfiles')):
# print afile
# we gotta do this for now!
if 'barcode.' not in afile.name: afile.name = 'barcode.' + afile.name
fileinfo = {'id': lineno, 'name': afile.name, 'status': '', 'date': time.strftime("%Y-%m-%d-%H-%M-%S", time.localtime())}
# always use the current date as the date for the filename checking
today = time.strftime("%Y-%m-%d", time.localtime())
filenamepattern = r'^barcode.TRIDATA_' + re.escape(today) + r'_[\w_\.]+\.DAT$'
if not re.match(filenamepattern, afile.name):
fileinfo['status'] = 'filename is not valid'
numProblems += 1
else:
try:
print "%s %s: %s %s (%s %s)" % ('id', lineno, 'name', afile.name, 'size', afile.size)
if not validateonly:
handle_uploaded_file(afile)
fileinfo['status'] = 'OK'
except:
if validateonly:
fileinfo['status'] = 'validation failed'
else:
fileinfo['status'] = 'file handling problem, not uploaded'
numProblems += 1
tricoder_files.append(fileinfo)
if numProblems > 0:
errormsg = 'Errors found, abandoning upload. Please fix and try again.'
else:
tricoder_filenumber = time.strftime("%Y-%m-%d-%H-%M-%S", time.localtime())
tricoder_fileinfo['tricoder_filenumber'] = tricoder_filenumber
tricoder_fileinfo['estimatedtime'] = '%8.1f' % (len(tricoder_files) * 10 / 60.0)
if 'createtricoder' in request.POST:
tricoder_fileinfo['status'] = 'createtricoder'
if not validateonly:
loginfo('start', get_tricoder_file('input',tricoder_filenumber), request)
try:
retcode = subprocess.call(
[POSTBLOBPATH, get_tricoder_file('input',tricoder_filenumber)])
if retcode < 0:
loginfo('process', tricoder_filenumber + " Child was terminated by signal %s" % -retcode,
request)
else:
loginfo('process', tricoder_filenumber + ": Child returned %s" % retcode, request)
except OSError as e:
loginfo('error', "Execution failed: %s" % e, request)
loginfo('finish', get_tricoder_file('input',tricoder_filenumber), request)
elif 'uploadtricoder' in request.POST:
tricoder_fileinfo['status'] = 'uploadtricoder'
else:
tricoder_fileinfo['status'] = 'No status possible'
return tricoder_fileinfo, tricoder_files, numProblems
开发者ID:cspace-deployment,项目名称:django_example_config,代码行数:59,代码来源:views.py
示例7: Get_Parameter
def Get_Parameter(NODE_NAME,PARAMETER_NAME,DEFAULT_VALUE):
param=rospy.get_param(PARAMETER_NAME,DEFAULT_VALUE)
if rospy.has_param(PARAMETER_NAME):
utils.loginfo(''+PARAMETER_NAME+' found: '+str(param))
else:
utils.logwarn(''+PARAMETER_NAME+' not found. Default: '+str(DEFAULT_VALUE))
return param
开发者ID:roussePaul,项目名称:kampala,代码行数:8,代码来源:sml_setup.py
示例8: Terminate
def Terminate(self):
inputstring = 'rosnode kill `rosnode list | grep ' + self.name + '`'
self.execute(inputstring)
try:
delete_model = rospy.ServiceProxy("gazebo/delete_model", DeleteModel)
delete_model(self.name)
except rospy.ServiceException as exc:
utils.loginfo('Failed to delete model ' + str(exc))
开发者ID:KTH-AEROWORKS,项目名称:quad-suspended-load,代码行数:9,代码来源:rqt_iris.py
示例9: adjust_gravity_cancel
def adjust_gravity_cancel(self):
self.name = self._widget.IrisInputBox.currentText()
rospy.set_param("/" + self.name + "/CONTROL_CANCEL_GRAVITY", int(self._widget.GravitySpinBox.value()))
try:
params_load = rospy.ServiceProxy("/%s/blender/update_parameters" % (self.name), Empty)
params_load_PID = rospy.ServiceProxy("/%s/PID_controller/update_parameters" % (self.name), Empty)
params_load()
params_load_PID()
except rospy.ServiceException as exc:
utils.loginfo("PID not reachable " + str(exc))
开发者ID:roussePaul,项目名称:quadcoptersSML,代码行数:10,代码来源:utility.py
示例10: search
def search(request):
if request.method == 'GET' and request.GET != {}:
context = {'searchValues': dict(request.GET.iteritems())}
context = doSearch(context)
else:
context = setConstants({})
loginfo('start search', context, request)
context['additionalInfo'] = AdditionalInfo.objects.filter(live=True)
return render(request, 'search.html', context)
开发者ID:RjLi13,项目名称:botgarden_project,代码行数:11,代码来源:views.py
示例11: bmapper
def bmapper(request):
if request.method == 'POST' and request.POST != {}:
requestObject = request.POST
form = forms.Form(requestObject)
if form.is_valid():
context = SEARCHRESULTS
context = setupBMapper(requestObject, context)
loginfo('bmapper', context, request)
return HttpResponse(context['bmapperurl'])
开发者ID:HackTheHearst,项目名称:pahma_project,代码行数:11,代码来源:views.py
示例12: retrieveResults
def retrieveResults(request):
if request.method == 'POST' and request.POST != {}:
requestObject = dict(request.POST.iteritems())
form = forms.Form(requestObject)
if form.is_valid():
context = {'searchValues': requestObject}
context = doSearch(context)
loginfo('results.%s' % context['displayType'], context, request)
return render(request, 'searchResults.html', context)
开发者ID:RjLi13,项目名称:botgarden_project,代码行数:11,代码来源:views.py
示例13: bmapper
def bmapper(request):
if request.method == 'POST' and request.POST != {}:
requestObject = dict(request.POST.iteritems())
form = forms.Form(requestObject)
if form.is_valid():
context = {'searchValues': requestObject}
context = setupBMapper(requestObject, context)
loginfo('bmapper', context, request)
return HttpResponse(context['bmapperurl'])
开发者ID:RjLi13,项目名称:botgarden_project,代码行数:11,代码来源:views.py
示例14: gmapper
def gmapper(request):
if request.method == 'POST' and request.POST != {}:
requestObject = request.POST
form = forms.Form(requestObject)
if form.is_valid():
context = SEARCHRESULTS
context = setupGoogleMap(requestObject, context)
loginfo('gmapper', context, request)
return render(request, 'maps.html', context)
开发者ID:HackTheHearst,项目名称:pahma_project,代码行数:11,代码来源:views.py
示例15: gmapper
def gmapper(request):
if request.method == 'POST' and request.POST != {}:
requestObject = dict(request.POST.iteritems())
form = forms.Form(requestObject)
if form.is_valid():
context = {'searchValues': requestObject}
context = setupGoogleMap(requestObject, context)
loginfo('gmapper', context, request)
return render(request, 'maps.html', context)
开发者ID:RjLi13,项目名称:botgarden_project,代码行数:11,代码来源:views.py
示例16: Connect_To_Mocap
def Connect_To_Mocap(NODE_NAME):
#Connect to the Motion Capture System, flag an error if it is unavailable
try:
utils.loginfo('Connecting to the mocap system...')
rospy.wait_for_service('mocap_get_data',10)
except:
utils.logerr('No connection to the mocap system')
sys.exit()
utils.loginfo('Connected to Mocap')
return rospy.ServiceProxy('mocap_get_data',BodyData)
开发者ID:roussePaul,项目名称:kampala,代码行数:12,代码来源:sml_setup.py
示例17: publicsearch
def publicsearch(request):
if request.method == 'GET' and request.GET != {}:
context = {'searchValues': request.GET}
context = doSearch(SOLRSERVER, SOLRCORE, context)
global SEARCHRESULTS
SEARCHRESULTS = context
else:
context = {}
context = setConstants(context)
loginfo('start search', context, request)
return render(request, 'publicsearch.html', context)
开发者ID:HackTheHearst,项目名称:pahma_project,代码行数:13,代码来源:views.py
示例18: search
def search(request):
if request.method == 'GET' and request.GET != {}:
context = {'searchValues': request.GET}
context = doSearch(context)
#global SEARCHRESULTS
#SEARCHRESULTS = context
else:
context = {}
context = setConstants(context)
loginfo('start search', context, request)
return render(request, 'search.html', context)
开发者ID:JulianJaffe,项目名称:pahma_project,代码行数:13,代码来源:views.py
示例19: Set_System_ID
def Set_System_ID(NODE_NAME,id_int):
return_value=True
#Necesary to allow RCOverride
#Also checks if there is a connection to Mavros, and shuts down if there isn't
utils.loginfo('Connecting to Mavros ...')
try:
rospy.wait_for_service('mavros/param/set',10)
except:
utils.logerr('Mavros is not available')
return_value=False
utils.loginfo('Connected to Mavros')
utils.loginfo('Changing system ID ...')
rospy.sleep(2)
try:
change_param=rospy.ServiceProxy('mavros/param/set',ParamSet)
param=change_param('SYSID_MYGCS',id_int,0.0)
except:
utils.logerr('Cannot change system ID')
return_value=False
if param.success:
utils.loginfo('System ID changed')
else:
utils.logerr('Cannot change system ID')
return_value=False
return return_value
开发者ID:roussePaul,项目名称:kampala,代码行数:32,代码来源:sml_setup.py
示例20: Wait_For_ID
def Wait_For_ID(id_int):
return_value=False
# Wait for Mavros connection and wait until the parameter SYSID_MYGCS is available
utils.loginfo('Connecting to Mavros ...')
try:
rospy.wait_for_service('mavros/param/set',10)
except:
utils.logerr('Mavros is not available (fail to contact service mavros/param/set).')
return_value=False
utils.loginfo('Connected to Mavros')
set_param=rospy.ServiceProxy('mavros/param/set',ParamSet)
while return_value==False:
try:
param=set_param('SYSID_MYGCS',id_int,0.0)
if param.success:
utils.loginfo('System ID changed')
return_value=True
else:
utils.logerr('Cannot change system ID')
return_value=False
except:
utils.logerr('Cannot change system ID')
return_value=False
rospy.sleep(5)
utils.loginfo('Iris initialised...')
return return_value
开发者ID:roussePaul,项目名称:kampala,代码行数:30,代码来源:sml_setup.py
注:本文中的utils.loginfo函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论