Go to Post None. Ours is anorexic at the moment. Lets see if the building people can come up with a simple tetra-knockdown mechanism. - Fixen [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 24-01-2012, 18:19
Pirate programe's Avatar
Pirate programe Pirate programe is offline
Registered User
FRC #0354
 
Join Date: Jan 2012
Location: Queens,NY
Posts: 53
Pirate programe is an unknown quantity at this point
Using Target Distance to Move Robot

Since we managed to get the Rectangular Target Processing VI functioning, we're now trying to use the Distance information to move the robot.

The problem is, with the teleop code used in the attachment, the robot doesn't move at all. I can't imagine that there's anything wrong with the drivetrain, since the robot's been driving a lot before we modified the code.

What could be the problem?
Attached Thumbnails
Click image for larger version

Name:	scrncap.png
Views:	172
Size:	12.3 KB
ID:	11554  
Reply With Quote
  #2   Spotlight this post!  
Unread 24-01-2012, 18:30
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,372
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: Using Target Distance to Move Robot

Quote:
Originally Posted by Pirate programe View Post
Since we managed to get the Rectangular Target Processing VI functioning, we're now trying to use the Distance information to move the robot.

The problem is, with the teleop code used in the attachment, the robot doesn't move at all. I can't imagine that there's anything wrong with the drivetrain, since the robot's been driving a lot before we modified the code.

What could be the problem?
At first glance, I would say that .1 is a fairly low drive value and may not be enough to move a robot. Have you tried it on blocks to see it the wheels turn?

I also think you will find you are introducing a turn with those values. Arcade drive uses X and Y input. X will cause the robot to turn.

Lastly, the vi is using the following logic:
If distance is greater than 6, drive at .1 and .1.
Is that what you are thinking as well?
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist

Last edited by billbo911 : 24-01-2012 at 18:39. Reason: Dropped a period in.
Reply With Quote
  #3   Spotlight this post!  
Unread 24-01-2012, 18:34
Pirate programe's Avatar
Pirate programe Pirate programe is offline
Registered User
FRC #0354
 
Join Date: Jan 2012
Location: Queens,NY
Posts: 53
Pirate programe is an unknown quantity at this point
Re: Using Target Distance to Move Robot

Quote:
Originally Posted by billbo911 View Post
At first glance, I would say that .1 is a fairly low drive value and may not be enough to move a robot. Have you tried it on blocks to see it the wheels turn?
No, I haven't. I think I might just turn the values up...

Quote:
Originally Posted by billbo911 View Post
I also think you will find you are introducing a turn with those values. Arcade drive uses X and Y input. X will cause the robot to turn
did this get cut off?

Quote:
Originally Posted by billbo911 View Post
Lastly, the vi is using the following logic:
If distance is greater than 6, drive at .1 and .1.
Is that what you are thinking as well?
I was thinking more "Drive at .1 and .1 until Distance is less than 6" , but I think your formulation applies too.
Reply With Quote
  #4   Spotlight this post!  
Unread 24-01-2012, 18:42
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,372
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: Using Target Distance to Move Robot

Quote:
Originally Posted by Pirate programe View Post
No, I haven't. I think I might just turn the values up...



did this get cut off?



I was thinking more "Drive at .1 and .1 until Distance is less than 6" , but I think your formulation applies too.
Ooops, I dropped the period at the end of that line, I've corrected it now.
Your logic and code are correct. It should operate as you expect.
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
Reply With Quote
  #5   Spotlight this post!  
Unread 26-01-2012, 16:23
Pirate programe's Avatar
Pirate programe Pirate programe is offline
Registered User
FRC #0354
 
Join Date: Jan 2012
Location: Queens,NY
Posts: 53
Pirate programe is an unknown quantity at this point
Re: Using Target Distance to Move Robot

So, the code logic is correct, but the robot won't move anyway? That doesn't make much sense.

By any chance, could this have something to with the "The loop that contains RobotDrive is not running fast enough" errors we're getting?

If not, what else could it be?
Reply With Quote
  #6   Spotlight this post!  
Unread 26-01-2012, 17:01
jcbc's Avatar
jcbc jcbc is offline
Registered User
AKA: Julie
no team
 
Join Date: Aug 2010
Rookie Year: 2011
Location: PA
Posts: 53
jcbc is a jewel in the roughjcbc is a jewel in the roughjcbc is a jewel in the roughjcbc is a jewel in the rough
Re: Using Target Distance to Move Robot

We have found that the Rectangular Target Processing VI takes up too much of the cRIO's memory and processing to run our drive code at the same time. We are looking into running the targeting code off of the cRIO, but we're still in the early stages.
Reply With Quote
  #7   Spotlight this post!  
Unread 26-01-2012, 20:15
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Using Target Distance to Move Robot

Can you be more specific? Is it RAM or CPU? Processing on the laptop is certainly an option, and discussed to a degree in the Example and white paper. If you drop the framerate, and perhaps even lower the priority of the processing, you should be able to control how much CPU is used.

Greg McKaskle
Reply With Quote
  #8   Spotlight this post!  
Unread 31-01-2012, 18:24
Pirate programe's Avatar
Pirate programe Pirate programe is offline
Registered User
FRC #0354
 
Join Date: Jan 2012
Location: Queens,NY
Posts: 53
Pirate programe is an unknown quantity at this point
Re: Using Target Distance to Move Robot

This is weird.

I can confirm that the code logic is correct already, since when I wire the Joystick inputs instead of constants, the robot can move when the condition is met.

Could there be a problem with the input values I'm using? I noticed through probing wires that the values the joystick gives aren't scaled from -1 to 1...

EDIT: Actually, no, I was reading the numbers wrong. They should be the same as the ones the joystick uses...

Last edited by Pirate programe : 31-01-2012 at 18:29.
Reply With Quote
  #9   Spotlight this post!  
Unread 04-02-2012, 13:04
Pirate programe's Avatar
Pirate programe Pirate programe is offline
Registered User
FRC #0354
 
Join Date: Jan 2012
Location: Queens,NY
Posts: 53
Pirate programe is an unknown quantity at this point
Re: Using Target Distance to Move Robot

Quote:
Originally Posted by Greg McKaskle View Post
Can you be more specific? Is it RAM or CPU? Processing on the laptop is certainly an option, and discussed to a degree in the Example and white paper. If you drop the framerate, and perhaps even lower the priority of the processing, you should be able to control how much CPU is used.

Greg McKaskle
After fiddling around with the targeting code we got running, I think it'd be best if we did this. What sort of modifications would we have to make to the Rectangular Target Processing code to do this, do you think?

The Send Axis Camera Signal Directly to Dashboard says the Read MJPG vi is what's used, but I'm not sure if that translates to this situation?
Reply With Quote
  #10   Spotlight this post!  
Unread 04-02-2012, 13:19
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Using Target Distance to Move Robot

The example project has code in the computer target section for running on a laptop, and code in the cRIO section for running on the cRIO.

The primary task would be to integrate the LV loop into the dashboard and to get the data back to the robot -- I'd recommend using UDP.

Greg Mckaskle
Reply With Quote
  #11   Spotlight this post!  
Unread 04-02-2012, 14:20
Pirate programe's Avatar
Pirate programe Pirate programe is offline
Registered User
FRC #0354
 
Join Date: Jan 2012
Location: Queens,NY
Posts: 53
Pirate programe is an unknown quantity at this point
Re: Using Target Distance to Move Robot

Quote:
Originally Posted by Greg McKaskle View Post
I'd recommend using UDP.

Greg Mckaskle
...he says, as though this were the simplest thing :|

Another potential hiccup: whenever something obstructs the camera view, or even when the camera is simply stationary, the index of a particular target in the Target Info array changes. That could be a problem if we're trying to narrow on a particular target. My mentor says we should be able to make the code remember certain position coordinates, and assign them to a specific index, so that if a target is at index 1 and its postion is (-0.5, 0.5), for argument's sake, if we obstruct the camera view and then unobstruct it the target should still be reassigned to index 1. Any idea how to implement this?
Reply With Quote
  #12   Spotlight this post!  
Unread 04-02-2012, 17:43
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Using Target Distance to Move Robot

The dashboard code already has independent loops that do UDP. For example, the loop that reads the Kinect Server data is towards the top of the Dashboard diagram. The important part is shown below.

It reads from port 1166 about once a second, or whenever data arrives. It reads at most 1018 bytes as a string, and then interprets it as the agreed datatype. In the situation we are considering, a similar loop would be placed on your robot and run in parallel with everything else -- I'd suggest doing it in Periodic Tasks.

The second image shows the code that needs to run on the dashboard to send the data. You need to change team and you need to make the data constant be your own data either formatted or flattened to a string. The final piece is to identify the UDP port to use and use it for both the read and write.

As for the index problem, I'm pretty sure that is currently based on the particle size. I'd probably try to sort them by location and label them as top, left, right, and bottom. You could then store them in a cluster or an array with a unique cell for top, left, right, and bottom. You should be able to identify them with any sorts of simple sort techniques.

Greg McKaskle
Attached Thumbnails
Click image for larger version

Name:	Screen Shot 2012-02-04 at 3.57.43 PM.png
Views:	55
Size:	11.6 KB
ID:	11707  Click image for larger version

Name:	Screen Shot 2012-02-04 at 4.10.18 PM.png
Views:	50
Size:	10.5 KB
ID:	11708  
Reply With Quote
  #13   Spotlight this post!  
Unread 06-02-2012, 15:44
Pirate programe's Avatar
Pirate programe Pirate programe is offline
Registered User
FRC #0354
 
Join Date: Jan 2012
Location: Queens,NY
Posts: 53
Pirate programe is an unknown quantity at this point
Re: Using Target Distance to Move Robot

So then, would we have to run the Vision Processing code on the dashboard, write to the robot using UDP, then have the robot read the UDP packets using code in the Periodic Tasks VI?

never mind that, wasn't reading correctly.

I guess the challenge is finding out how to convert the image to a string (the Get Image Data String VI requires a CameraDevRef input).

Last edited by Pirate programe : 06-02-2012 at 16:02.
Reply With Quote
  #14   Spotlight this post!  
Unread 06-02-2012, 18:19
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Using Target Distance to Move Robot

Provided the camera is connected to the dlink, you don't need the cRIO to do anything with the image.

The dashboard reads the image directly from the camera.
The dashboard processes it.
The dashboard sends any target info to the robot via UDP string.
The robot reads the TDP string and updates setpoints which ultimately move the robot.

You don't have to do it this way, but if you want to use the laptop to do the processing, to allow the cRIO CPU to do other things, this is the way I'd approach it.

Greg McKaskle
Reply With Quote
  #15   Spotlight this post!  
Unread 06-02-2012, 18:31
Pirate programe's Avatar
Pirate programe Pirate programe is offline
Registered User
FRC #0354
 
Join Date: Jan 2012
Location: Queens,NY
Posts: 53
Pirate programe is an unknown quantity at this point
Re: Using Target Distance to Move Robot

Quote:
Originally Posted by Greg McKaskle View Post
The dashboard reads the image directly from the camera.
The dashboard processes it.
Greg McKaskle
Would the Dashboard really be able to have the entire Rectangular Target Processing code in it?

also it'd be nice if you could direct your attention here, if it's not too much trouble?
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 22:31.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi