The code you have definitely won't work. It doesn't look like you're creating instances of the classes. Assuming that I'm misunderstanding your code, your problem comes in with what Relay::Set expects as input vs what Victor::Set or Jaguar::Set expect. Compare the prototypes that are found in WPILib
Code:
void Jaguar::Set(float speed)
{
}
void Victor::Set(float speed)
{
}
void Relay::Set(Relay::Value value)
{
}
See how Victor and Jaguar take in a float? That happens to be what Joystick::GetY is returning. In the case of Relay::Set, it expects a Value type. That can be found in Relay.h as
Code:
typedef enum {kOff, kOn, kForward, kReverse} Value;
So, in order to call Relay::Set, you need to pass in a Relay::kOff, Relay::kOn, Relay::kForward, or Relay::kReverse (look at Relay.h for a description of what they each mean)
In order to do what you want to do, you'll need some logic. Here's an example for using a forward and reverse threshold (I'm using .5 as my threshold in either direction) to set the state of the relay. Don't forget to turn it off if the stick is between the thresholds.