Go to Post Volunteer...it will make you see a totally different side of FIRST. - Collin Fultz [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 18-01-2010, 19:04
sircedric4's Avatar
sircedric4 sircedric4 is offline
Registered User
AKA: Darren
no team (The SS Prometheus)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Lousiana
Posts: 245
sircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond reputesircedric4 has a reputation beyond repute
Dashboard-Driver Station Help Please

I need help getting the dashboard on the driver station to show me what the robot is doing. I tried to get the dashboard working last year on C++ to no avail, and had hoped that FIRST had got it functioning this year, or at least made it easy that those of us still learning C++ can figure it out.

I have started from the SimpleTemplate code, and the only change I made was to goto TankDrive. I have added the DashboardDataFormat.h and DashboardDataFormat.cpp from the DashboardDataExample and I am posting the code in myRobot.cpp. The robot works fine, it drives around and is definitely talking to the driver station and everything is updated, but the dashboard will not reflect what the PWM's are doing.

Can someone enlighten me on what I am doing wrong. I expect with this code the way it is to see the PWM sliders on the driver station to move up and down as the joysticks are moved, but it doesn't do that. I have not included the sendVisionData because we aren't using the camera. Am I misunderstanding how the dashboard is supposed to work, is it not supposed to update the charts with the PWM positions?

Help me please with this code:

Code:
#include "WPILib.h"
#include "DashboardDataFormat.h"

/**
 * This is a demo program showing the use of the RobotBase class.
 * The SimpleRobot class is the base of a robot application that will automatically call your
 * Autonomous and OperatorControl methods at the right time as controlled by the switches on
 * the driver station or the field controls.
 */ 
class RobotDemo : public SimpleRobot
{
	RobotDrive myRobot; // robot drive system
	Joystick leftstick; // left joystick
	Joystick rightstick; //right joystick

public:
	RobotDemo(void):
		myRobot(1, 3, 2, 4),	// PWMs for drive
				//1,3 - Left Motors
				//2,4 - Right Motors
		leftstick(1),		// Left Joystick.
		rightstick(2)		// Right Joystick.
	{
		myRobot.SetInvertedMotor(RobotDrive::kFrontLeftMotor, false);
		myRobot.SetInvertedMotor(RobotDrive::kFrontRightMotor, false);
		myRobot.SetInvertedMotor(RobotDrive::kRearLeftMotor, false);
		myRobot.SetInvertedMotor(RobotDrive::kRearRightMotor, false);
		GetWatchdog().SetExpiration(0.1);
	}

	/**
	 * Drive left & right motors for 2 seconds then stop
	 */
	void Autonomous(void)
	{
		GetWatchdog().SetEnabled(false);
		myRobot.Drive(0.5, 0.0); 	// drive forwards half speed
		Wait(2.0); 				//    for 2 seconds
		myRobot.Drive(0.0, 0.0); 	// stop robot
	}

	/**
	 * Runs the motors with tank steering. 
	 */
	void OperatorControl(void)
	{
		GetWatchdog().SetEnabled(true);
		while (IsOperatorControl())
		{
			GetWatchdog().Feed();
			myRobot.TankDrive(leftstick, rightstick); // drive
			sendIOPortData();
			Wait(0.005);				// wait for a motor update time
		}
	}
};

START_ROBOT_CLASS(RobotDemo);

Last edited by sircedric4 : 18-01-2010 at 20:33.
Reply With Quote
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to run dashboard project on driver station baronep Programming 1 18-01-2010 14:58
Driver Station Dashboard Problems CVassos Programming 9 16-01-2010 23:27
Driver Station to Dashboard Laptop connection slavik262 FRC Control System 4 12-01-2010 00:37
Driver Station Help.. 1708xMr.Roboto FRC Control System 8 22-12-2008 15:24


All times are GMT -5. The time now is 14:27.

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