First, you will call the get_laser_full() function, and will store its response into a Python list.

This is the initial prompt I'm having issues with. The get_laser_full() function gives me 720 values and any guidance on how to turn that into a list would be appreciated.

asked 04 Jul, 21:23

stevencloud9's gravatar image

stevencloud9
0
accept rate: 0%


Hello, you can use the list command as follows;

from robot_control_class import RobotControl robotcontrol=RobotControl() dist=robotcontrol.get_laser_full() dist_list=list(dist) #convert to list data type print(dist_list)

permanent link

answered 05 Jul, 12:46

khatibrh%40hotmail.com's gravatar image

khatibrh@hot...
15
accept rate: 33%

Hello, you can use the list command as follows;

from robot_control_class import RobotControl robotcontrol=RobotControl() dist=robotcontrol.get_laser_full() dist_list=list(dist) #convert to list data type print(dist_list)

permanent link

answered 05 Jul, 12:47

khatibrh%40hotmail.com's gravatar image

khatibrh@hot...
15
accept rate: 33%

as mentioned above, use dist = robotcontrol.get_laser_full()

That is, do not put brackets around the right-hand side. dist will become a list automatically.

so you can now print(dist[360]), etc,

permanent link

answered 13 Jul, 09:37

weaverj's gravatar image

weaverj
0
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×14
×2

question asked: 04 Jul, 21:23

question was seen: 134 times

last updated: 13 Jul, 09:37

powered by OSQA