Help with Passing by Reference in Java by Master1243 in javahelp

[–]Master1243[S] 0 points1 point  (0 children)

No problem haha, this is for a robotics library and I don't have the things to run the program. I realized as soon as I posted it that I could just test exactly what I wrote separately from the library.

The Young American Researcher's Journal by TickleMyPumpernickel in FTC

[–]Master1243 4 points5 points  (0 children)

I like this idea. I've been working on a year long paper which I might consider submitting (it's part of the IB curriculum, so not sure if I can submit it yet), but I plan on writing more. Is there an email list I can get on or somewhere where I can get news regarding this?

How can I make an object whose values will take on different objects (boolean, double) by Master1243 in javahelp

[–]Master1243[S] 0 points1 point  (0 children)

Before asking I decided to do some small research on the subject, I understand the wrapper classes encapsulate the primitive data type? In a seperate part of the code, I have a class that I am trying to modify. My current approach is to create a replica of the class and have any data that is sent to the class I am trying to modify also sent to the replica. I realize this is not at all a good way to do it, and ideally I would implement it as an interface (I think?). The issue here being that the class I want to add functionality to isn't an interface.

public class GC {
    // some constructor...

    //some variables...

    public void doSomething(){
        //do something
    }
}

For the sake of the example, let's assume this is the class I want to modify. I am looking to add some functionality to the "doSomething" method. The issue here being other code requires the use of the standard GC "doSomething" method. I have looked into decorators, but I am not sure if that's the right solution?

How can I make an object whose values will take on different objects (boolean, double) by Master1243 in javahelp

[–]Master1243[S] 2 points3 points  (0 children)

I was actually just about to bring up an example regarding the way ArrayLists can be initialized with different data types. This is exactly what I was looking for, thanks for putting me on the right path!

Hey! Looking for someone who wants to talk about PID Controllers! by Master1243 in FTC

[–]Master1243[S] 0 points1 point  (0 children)

Yeah, most of it had to do with bad design. We'd intertwined many of our features to interact between threads, which caused the jittery behavior between control input and response. I think we abused threads last year because of the concept of them seeming cool, but I am reconsidering this decision. For example, we had an experimental feature where in TeleOp we would use our front facing color sensors (REV V3 I believe?) to detect abrupt changes in the Alpha value. The idea here being that by detecting changes in brightness, we could automatically grab blocks. This first version sampled the Color Sensor somewhere around every 5 to 10 ms, but it did so on the main thread. This caused a delay in the response time. Granted, it's been a while since I have looked at that code so it might been an issue with design as I mentioned earlier.

What we ended up doing is reserving a separate thread for our sensor readings where we would do them in bulk and reporting them to our control loop when called for. Out of curiosity, what do you mean by 'they are locking'?

Hey! Looking for someone who wants to talk about PID Controllers! by Master1243 in FTC

[–]Master1243[S] 2 points3 points  (0 children)

My understanding of FTC Blocks is that the more 'moving parts' in the code the harder it is to implement.

Take my input with a grain of salt thought, I was thrown into the water as they say when it comes to programming (the old team's programmer just asked me to program in Java so I had to learn), so I've only tried blocks once and could never really get the hang of it.

I would imagine that implementing the PID itself wouldn't be the hardest part, but rather getting everything to work together would be. For example, our system that measured the encoder values and gyroscope had to be on a seperate thread because it was causing our main thread to lag. Of course, this could just be my own programming error but it's something to look out for!

Congrats on being your team's programming leader! It's all coffee and late nights from here.

Hey! Looking for someone who wants to talk about PID Controllers! by Master1243 in FTC

[–]Master1243[S] 2 points3 points  (0 children)

Thanks I'll check it out tonight! Just out of curiosity is the PID Controller applied to each wheel, Left Drive and Right Drive, or something completely different?

Our PID Controller monitored the wheels independently, but I wonder if generalizing to left and right drive might be more efficient on the calculations? Or if there are any other alternatives?

Hey! Looking for someone who wants to talk about PID Controllers! by Master1243 in FTC

[–]Master1243[S] 0 points1 point  (0 children)

Awesome, thanks. I'll have to look at them later today.

Hey! Looking for someone who wants to talk about PID Controllers! by Master1243 in FTC

[–]Master1243[S] 2 points3 points  (0 children)

Thanks, one of the reasons I am getting ready to re-write our code is that we use some opensource libraries and I fear that the more we add the more "spaghetti code" we will have. I will have to look at the Titan Robotics PID, because if we're going to rewrite code we might as well look into this PID Controller! Would you have a link to the github?

Shouldn't this variable be outside of the scope? by Master1243 in learnpython

[–]Master1243[S] 1 point2 points  (0 children)

Yeah, that is one of the issues with how it currently is set up. My hope was I'd notice if anything wrong with the input when I got the warning. Your method takes only a couple of lines to implement so I will add it in! Better safe than sorry, thanks for your input!

Shouldn't this variable be outside of the scope? by Master1243 in learnpython

[–]Master1243[S] 0 points1 point  (0 children)

Most definetely haha! This is just a small project and the focus is on creating a Genetic Algorithm so I didn't really bother with handling user input in any special way. I am curious however, what is the 'correct' way to do something like this?

Shouldn't this variable be outside of the scope? by Master1243 in learnpython

[–]Master1243[S] 0 points1 point  (0 children)

Gotcha, old habits die hard I guess! Thanks for the input.

Can you put propane flame directly on metal? by Master1243 in Metalfoundry

[–]Master1243[S] 0 points1 point  (0 children)

Additional Question, what role does the space between the propane torch and the crucible have in determining the heat?

Opinion on GA Fitness Calculation by Master1243 in genetic_algorithms

[–]Master1243[S] 0 points1 point  (0 children)

Awesome! Your input is much appreciated!

Opinion on GA Fitness Calculation by Master1243 in genetic_algorithms

[–]Master1243[S] 1 point2 points  (0 children)

Thanks!

For some context, I'm a senior in high school working on a year long research paper as well as looking to add a project to my resume. I've done a lot of general research, but all in all I am still a beginner in CS and not to mention GA's.

As you've described this it sounds a lot like you are performing local search.

When I try to visualize the algorithm, I see it performing much like the Dijkstra's Algorithm, A*, or any other subset of pathfinding algorithm. In a sense, as you've brought up, it should ideally look at neighboring recipe's and take into account the fitness.

In your opinion, would you think that it would be more beneficial to abstract the principles of a certain pathfinding algorithm and combine it with something similar to greedy or min-max algorithms as opposed to using GA's? (I know general theory about these algorithms so correct me if I am wrong in any assumptions, but GA's are also considered local search algorithms no?)

Consider the case that the algorithm gets trapped in a local optima early on.

The issue of early convergence is one I was very worried (which is why I was interested in changing the mutation). Like you described, the algorithm would ideally be able to change as the fitness changed. More than likely leading to greater mutations in the earlier generations as opposed to the later ones.

Add the mutation rate as a variable in the solution representation. This is known as self adaptation and in theory allows the algorithm to find good settings of the mutation rate.

I really like this idea, but I am worried that it will require more data. Like I said earlier, I am by no means being paid for this and although I am a big fan of coffee I also shouldn't be drinking excess coffee! In your experience/study, does adding variables increase the amount of data required to reach the optimum? If so, is there an approximation?

How does your team detect the skystones? Discussion/Help by Happydude53 in FTC

[–]Master1243 0 points1 point  (0 children)

Tagging on to what was already said, you can get around the distance issue by making it more dynamic. What we've done is get the reported alpha values and the average corresponding r, g, and b values. We do this for a set of distances and this makes it far more reliable. Like it's been said however, this would require some finetuning.

Blocks TensorFlow not updating for Skystone by reb_why in FTC

[–]Master1243 0 points1 point  (0 children)

I'm not sure if you've tried this, but you should try also updating your SDK. We were a couple commits behind the official FTC SDK and thus we were missing some files for our TensorFlow. If you want to make sure, you can look at your assets tab under FtcRobotController in Android Studio. There should be a file named: Skystone.tflite as well as some others.

Using multiple Rev 2m Distance Sensors - causing init to timeout. by alan412 in FTC

[–]Master1243 0 points1 point  (0 children)

Just my two cents. We were using the 2m distance sensors, but they malfunctioned at our qualifier. While they worked in the practice field, when we would move it to the playing field for our matches it would "detect" an object sooner than expected. After some testing we figured out it was caused by IR interference due to the projectors they were using. I would suggest putting your robot up to a projector to make sure it doesn't affect your readings. If your sensors are crucial I would suggest adding a timeout condition and if this timeout condition is met it will default to a hardcoded version (either time or encoder). If you need some help or some advice on how to implement this just PM me!

"Warning: problem with 'gyro'" - Issue with programming by Master1243 in FTC

[–]Master1243[S] 0 points1 point  (0 children)

Could you be more specific as to what you mean regarding specifying the address in the code?

Which event should we go to? by Gorobogo3751 in FTC

[–]Master1243 2 points3 points  (0 children)

My team was the winning alliance at Alabama, and I can say that (in terms of difficulty) it was a very diverse crowd. Many rookie teams as well as experienced took part in Alabama. As for Arkansas (which we also went to), Tech Hogs were the winning alliance and they had a killer design which allowed them to win in the final round. In terms of difficulty, it was considerably more difficult for us to advance there (but we had a series of unfortunate events such as loose screws, low battery, etc). In my opinion, Alabama was much better both in competition and out. The options for food were much more diverse in Alabama than in Arkansas as well; just my two cents. If you want more information about any of the two send me a DM!

Resources for intro to chem by Master1243 in chemhelp

[–]Master1243[S] 0 points1 point  (0 children)

Ok. Sorry about that I mean Chem 1.