Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
python script error
#1
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() *//
Larz60+ write Dec-23-2021, 04:08 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020