Dec-23-2021, 03:45 PM
This is from an online course - trying to lay out markers for a drone to navigate. I get an error "bad input" on the line:
//*mrks = self.get_markers()
import math
import numpy as np
from plot import plot_trajectory, plot_point, plot_covariance_2d
class UserCode:
def get_markers(self):
'''
place up to 30 markers in the world
'''
markers = [
[0, 0], # marker at world position x = 0, y = 0
[1, 0], # marker at world position x = 2, y = 0
[4,0.5],
[7,0.5],
[9,0.5],
[7.5,3],
[8,5],
[6,5],
]
return markers
def_init_(self,self.x,mrks,self.get_markers,np.array(mrks))
mrks = self.get_markers()
mrksarry = np.array(mrks)
if marker_position_world[0] == mrksarry[self.marker][0] and marker_position_world[1] == mrksarry[self.marker][1]:
print 'Found Marker ' + str(self.marker)
print self.x
self.marker = self.marker + 1
self.visualizeState() *//
//*mrks = self.get_markers()
import math
import numpy as np
from plot import plot_trajectory, plot_point, plot_covariance_2d
class UserCode:
def get_markers(self):
'''
place up to 30 markers in the world
'''
markers = [
[0, 0], # marker at world position x = 0, y = 0
[1, 0], # marker at world position x = 2, y = 0
[4,0.5],
[7,0.5],
[9,0.5],
[7.5,3],
[8,5],
[6,5],
]
return markers
def_init_(self,self.x,mrks,self.get_markers,np.array(mrks))
mrks = self.get_markers()
mrksarry = np.array(mrks)
if marker_position_world[0] == mrksarry[self.marker][0] and marker_position_world[1] == mrksarry[self.marker][1]:
print 'Found Marker ' + str(self.marker)
print self.x
self.marker = self.marker + 1
self.visualizeState() *//