We are looking for some GoBuilda starterbot autonomous block coding examples for “Into the Deep”. We are able to make the starterbot move forward, backwards, and make turns, but we have been unable to make the arm, wrist, or intake move at all.
Any assistance would be appreciated.
Hello! What kind of issues are you having? Were you able to add those motors/servos to the config file and have Blocks recognize that they were there?
If you haven’t already seen it, we have a video that walks through getting the Blocks code installed and running on a Starter Kit robot:
Game Manual 0 is a great resource, it saves a ton of time when coding
We have been through this video and everything works in teleop mode. The motors and servos are setup correctly in the config file. We can get the robot to move around in autonomous mode, but we cannot get the starter bot arm, wrist, or intake to move. Here is the code we are working with.
Thanks for sending your code! That is the ticket
There are a couple of steps there that you’re missing to get the arm to move.
Right now you are setting a variable called “Arm_Position” to equal another variable, Arm_Score_Sample_in_Low in this example.
Setting this “Arm_Position” variable doesn’t by-itself set the motor target position. In our Starter Bot example teleop code, we have a series of if/else statements that check if the user is clicking a button, and if they are, then we set this variable (named armPosition in the example code) to one of many preset variables. And after we’ve gone through all of the if/else statements, we finally set the left_arm motor target position to equal that variable.
We handle it this way in the example code (our if/else statements set a variable, and then we write that variable to the motor) so that we don’t run the risk of telling the motor multiple different target positions in one loop. And it allows us to more easily add another variable to the target position, like the fudge factor in teleop.
In Autonomous, this is a lot less important. Instead of setting the variable to equal a preset, we can just set the motor target position directly.
Here’s the blocks where we set the target position, set the RunMode, and set the maximum velocity.
It is important to note that you need to call set motor.Mode to RunMode.RUN_TO_POSITION after you change the target position every time.
Here is an article from REV that does a fantastic job of talking through different RunModes, and generally using motors with encoders!
It does not look like you have any code that is trying to set the wrist/intake servo positions there. For that you just need to grab a setPosition or setPower block for that servo, and set it to something. We use variables that store the desired values for the example code. But you can just have a number there.
1 Like
Also just want to jump in here while I am thinking about it. @The_Mongoose please feel free to shoot us an email to [email protected], or give us a call at (620) 705-5959 and ask for me. Especially if I miss a response here
Thank you very much. I think we are figuring things out now. Will definitely hit you up if we continue to have difficulty.
1 Like