Go to Post "Pimp my shopping cart"?!?! - dlavery [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 02-07-2012, 09:17 PM
3rik's Avatar
3rik 3rik is offline
Registered User
FRC #3407 (Mustybots)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2012
Location: USA
Posts: 1
3rik has a spectacular aura about3rik has a spectacular aura about
Errors with Our Joystick

For the past couple days our team has tried unsuccessfully at using our joystick in the way we would like to use it. All our experienced programmers left last year and our new programmers, myself included, are new to C++.

Our current issue is when we run our code on our robot, it doesn't respond.
The driver station returns this error:
Quote:
ERROR: Joystick axis is out of range: ...in GetStickAxis() in C:/WindRiver/workspace/WPILib/DriverStation.cpp at line 226
The file it references is DriverStaion.cpp. It seems like it's saying that we are trying to access too many axes.

Here is the code we were using to test the joystick. Our team is using mecanum wheels and joystick with a twist axis.
Code:
#include "WPILib.h"

class RobotDemo : public SimpleRobot
{
	RobotDrive myRobot;
	Joystick stick;

public:
	RobotDemo(void):
		myRobot(1, 2, 3, 4),
		stick(1, 3, 0)
	{
		myRobot.SetExpiration(0.1);
	}

	void Autonomous(void)
	{
	}

	void OperatorControl(void)
	{
		myRobot.SetSafetyEnabled(true);
		while (IsOperatorControl())
		{
			myRobot.HolonomicDrive(stick.GetMagnitude(), stick.GetDirectionDegrees(), stick.GetTwist());
			Wait(0.005);
		}
	}
};
START_ROBOT_CLASS(RobotDemo);

This appears with two different types of joysticks: the Logitech Extreme 3D Pro, which is the joystick we want to use, and the Logitech Attack 3.

This problem only seems to be an issue when we use commands that call GetStickAxis(). Other commands like GetRawStickAxis() seem to work fine.

If anyone can point us in the right direction, it would be much appreciated.
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


All times are GMT -5. The time now is 10:32 AM.

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