我正在为目前为基于命令的机器人编写的Java程序遇到一些麻烦。程序在按下操纵杆按钮时运行的命令根本没有运行。按钮已经过测试,正在进行注册。我不是非常了解Java,我不确定这些命令是否需要运行子系统。他们不应该有任何依赖,因为我只是试图让命令返回至少一个打印语句。
计划的一部分:
package org.usfirst.frc.team5621.robot;
import edu.wpi.first.wpilibj.command.Command;
public class CompressCommand extends Command {
public CompressCommand() {
}
// Called just before this Command runs the first time
@Override
protected void initialize() {
}
// Called repeatedly when this Command is scheduled to run
@Override
protected void execute() {
System.out.println("Compressing...");
exampleSolenoid.set(true);
}
// Make this return true when this Command no longer needs to run execute()
@Override
protected boolean isFinished() {
return false;
}
}
ATTEMPTED COMMAND:
def category_query_view(request):
category = request.GET.get('q')
print('hihi',category)
url = '{category}/find/?q={category}'.format(category=category)
return HttpResponseRedirect('/'+url)
Eclipse没有返回任何错误。