Jump to content

[WIP] MSI's Infernal Robotics - Model Rework (v02 Pre-Release Beta)


ZodiusInfuser

Recommended Posts

That's interesting because that's the completely opposite scale direction I was expecting you to ask for :P

oh! goodness no! not bigger! smaller! XD

Javascript is disabled. View full album

here's a test flight of the small utility rover using these mods:

IR-MR: (for the arm)

Kerbal Foundries: for the wheels.

KAS: for the cargo boxes

LLL: for the cockpit and cargobay

Nova punch: various batteries and stuff.

so yes i would LOVE smaller parts (not bigger.) so if you don't mind it i'm going to edit all the .cfgs so i can get smaller parts.

EDIT: I'VE GONE TOO FAR!! i tested the scaling and have made a small IR robot that's as small as a kerbal it was impossible to put together so i scaled it up first then back down and now i'm deleteing the edited .cfgs and starting over because i messed up somewhere and crashed the game lol

EDIT2: also if your intrested a fully robotic staffed hotel in japan; http://indianexpress.com/article/world/asia/worlds-first-robot-staffed-hotel-to-open-in-japan/

Edited by AntiMatter001
Link to comment
Share on other sites

I neeeeeeeeeeeeeeeeeeeeeed those wheels :D:D awesome \o/

They're going to be a long time coming unfortunately. The stock wheel module doesn't fully understand their orientation, so you have to press backward to move forward, and invert some of the steering to actually get it to turn correctly. Changing the orientation of the model in unity isn't an option due to the way KSP handles attachment nodes with mirror symmetry. In fact I could write a whole blog post about how many wheels (including stock) are oriented wrong for node attachment, as I explained at length to Lo-Fi :P.

Because of this I'm looking into using other plugins, but its quite likely that I'll have to create my own (or fork an existing mod) to get the functionality I want to see these wheels have, and honestly this is something I don't have the time or energy for. Basically what I'm saying is that the wheels may never reach a point where I'll be happy to release them. I guess time will tell.

--------------------------------------------------

oh! goodness no! not bigger! smaller! XD

...

here's a test flight of the small utility rover using these mods:

See to me that part doesn't look right at that scale. It seems like a simpler design with a bigger head would be more practical to lift that container (could well be the perspective though)

so yes i would LOVE smaller parts (not bigger.) so if you don't mind it i'm going to edit all the .cfgs so i can get smaller parts.

Oh I don't mind at all. Whatever you do with your own install is your own business :wink:

Edited by ZodiusInfuser
Link to comment
Share on other sites

Oh I don't mind at all. Whatever you do with your own install is your own business :wink:

oh cool didn't know i could do that. i always considered it a taboo to mess with someone elses work without permission so thanks for telling me i can do that \o/

i know it looks silly but i was 4 hours into the design and didn't want to scrap it for something else.

Link to comment
Share on other sites

looks good, Zodius can always swap them if he's too bored with the current one :P

Link to comment
Share on other sites

Tweakscale owner and developer Biotronic says Tweakscale is no longer supported unless another mod maker takes up the torch. What does this mean for the future of IR? Will IR take the Tweakscale torch, or will IR's dependency on Tweakscale be its downfall?

http://forum.kerbalspaceprogram.com/threads/80234-0-90-TweakScale-Rescale-Everything!-%28v1-50-2014-12-24-10-40-UTC%29?p=1723237&viewfull=1#post1723237

Thought I'd sound the alarm here.

Link to comment
Share on other sites

@inigma:

That would be a good question to ask in the Infernal Robotics thread, though I'd also suggest reading the last couple of pages:

I'll see about implementing my own custom TweakScale style feature to IR. All I need is the size and translations to change. I hope it will be an easy fix.

Looks like sirkut is thinking about integrating parts of TweakScale into IR. :)

Link to comment
Share on other sites

So, wheels now work :P

_6b30199821574047a1c12e0e08c53f29

It turns out that if I use the stock wheel module and specify "controlAxisType = Right" the control issues I was having get fixed, and to get crab steering I turned the wheels into IR parts. Surprisingly IR and ModuleWheel work together absolutely fine! It does require a bit of inventiveness on the part of the player, but for the time being its a good solution :). Note that this isn't the final solution I want, but to get that I'd need to spend months just on coding, which I don't have the time or knowledge for atm.

Once I'm able to figure out why the suspension immediately bottoms out, then I'll get a version out of the three wheels for people to try.

Link to comment
Share on other sites

Well I managed to get the suspension behaving, so here you all go :)

https://www.cubbyusercontent.com/pli/IR_MobilityPack_Beta.zip/_115177c102bc45b9b5f6d396f2d85c73

Note that these are a lot more WIP than my previous "beta" parts, but they're in a usable enough state for people to begin testing and giving feedback. I'd avoid using them for any important missions though, at least for the time being.

And here's a pic of another rover I was using for tests :)

_4d4843bd02ea47c0b4ea7ec8e98e4746

Link to comment
Share on other sites

Zodius, I LOVE this wheels.

...

Folded

http://i.imgur.com/fp2JJja.jpg

Um, those wheels are massively over compressed. Is that just how you've fit them in? because I didn't see that behavior on my test craft, and they're not set to go that far anyway, so I'm a bit confused.

Edit: looks like your foldatrons are assembled wrong

Edited by ZodiusInfuser
Link to comment
Share on other sites

Um, those wheels are massively over compressed. Is that just how you've fit them in? because I didn't see that behavior on my test craft, and they're not set to go that far anyway, so I'm a bit confused.

Edit: looks like your foldatrons are assembled wrong

See this picture from VAB - they are fine in editor, but as soon as I launch they are overly compressed.

38n2TMD.png

I'll check my foldatron assembly in a bit, maybe you are correct.

Link to comment
Share on other sites

See this picture from VAB - they are fine in editor, but as soon as I launch they are overly compressed.

That happens with all wheels. Once you enter flight the physics of the wheel module kicks in, and should cause the piston to extend. Since it's not, I suspect something invisble collision is getting in the way. I don't understand why they get compressed that much though.

I'll check my foldatron assembly in a bit, maybe you are correct.
To me it looks like the offset foldatron isn't node attached to the wide-angle one (or maybe you used the new editor widgets). Also the lighting on the wide-angle foldatrons is very odd (almost like there's two on top of each other.

--------------------------------------------------

I haven't had a lot of time to play lately. Are those wheels automatically aligning when deployed?

Unfortunately not, but they're IR joints so its easy enough to set them yourself (and then switch them to crab steering).

Link to comment
Share on other sites

To me it looks like the offset foldatron isn't node attached to the wide-angle one (or maybe you used the new editor widgets). Also the lighting on the wide-angle foldatrons is very odd (almost like there's two on top of each other.

I've fixed it by recreating the folding wheel from scratch. It is this annoying bug with editor when you rotate the part, some times it misaligns the attachment point and only way to fix this is to ditch the part and grab a fresh one.

Link to comment
Share on other sites

In the OP I see Mecanum wheels. Do they actually work?

If they do that is freakishly cool! :)

They don't with stock, but with tweaks to lo-fi's plugin and some IR they do :)

I've fixed it by recreating the folding wheel from scratch. It is this annoying bug with editor when you rotate the part, some times it misaligns the attachment point and only way to fix this is to ditch the part and grab a fresh one.

I've just had a go recreating the rover and encountered the same issue. I think that's the plugin causing it? On an unrelated note, that rover design works great as a self-righting mechanism :)

Link to comment
Share on other sites

They don't with stock, but with tweaks to lo-fi's plugin and some IR they do :)

I've just had a go recreating the rover and encountered the same issue. I think that's the plugin causing it? On an unrelated note, that rover design works great as a self-righting mechanism :)

I wonder if with kOS I could actually get them to work with a control scheme...

I.E. Another use for this behemoth.


#include "WPILib.h"
#include <thread>
/*
These are pre-processing directives, the compiler will find
in your code all these names, and replace them with the numbers
listed beside them.
*/

#define frontLeftChannel 0 //the port for the front left drive motor
#define frontRightChannel 1 //the port for the front right drive motor
#define rearLeftChannel 2 //the port for the back left drive motor
#define rearRightChannel 3 //the port for the back right drive motor
#define mainLiftChannel 4 //the port for the main lift motor
#define backupLiftChannel 5

#define joystickDriveChannel 0 //what position in the controller array is the drive controller
#define joystickArmChannel 1 //what position in the controller array is the lift controller

#define joystickThreshold 0.15 //the "dead" zone of the controller
#define joystickLimit 1.0 // % of range (1.0 = 100%, .75 = 75% etc.)

#define encFLreverse false; //Reverse the Front Left Encoder
#define encBLreverse false; //Reverse the Back Left Encoder
#define encFRreverse false; //Reverse the Front Right Encoder
#define encBRreverse false; //Reverse the Back Right Encoder

#define encoderFLchannelA 0;

#define encodingType Encoder::k4X

//idk if this even works but ima try it

#define JOYZCAPABLE false //are you using a z-axis capable controller (in our case the Logitech Log 3D pro)

/*____________________________________HUGE PROGRAMMING NOTE!!!_____________________________________
* TO DEPLOY TO THE roboRIO, YOU MUST RIGHT CLICK ON THE BUILD.XML FILE,
* AND SELECT "RUN AS ANT BUILD".
* ECLIPSE NO LONGER GIVES THE OPTION TO DEPLOY AS C++ CODE!!!
*/

class Robot: public SampleRobot {
RobotDrive robotDrive; // robot drive system
Talon liftOne; // the lift motor controller
Talon liftTwo;
Joystick driveStick; // only joystick
Joystick armStick; //Not anymore, you stupid comment!
// why are you so mean to me? -driveStick comment

Encoder encoderFL; //Front Left Encoder
Encoder encoderBL; //Back Left Encoder
Encoder encoderFR; //Front Right Encoder
Encoder encoderBR; //Back Right Encoder
Encoder encoderLift; //Take a wild guess

AnalogInput bottomLimitSwitch; //limit switch for the bottom bar
AnalogInput topLimitSwitch; //limit switch for the top bar

int encoderPorts[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };

int thing =0;
float driveStick_x = 0; //the first controller x axis value
float driveStick_y = 0; //the first controller y axis value
float driveStick_z = 0; //the first controller z axis value
float armStick_y = 0; // the second controller y axis value
float attackRotRate = 0.75; //This is the rotation rate when using the buttons
float slider = 0; // i have no clue what this is supposed to be
float currAvgPosition;
float startPosition;

bool throttleEnabled = true; //True means throttle is enabled, false not...
bool rotationLock = true; //True means that button 2 is needed for rotation.
bool defDriveMode = true; //True defaults to analog drive

public:
//_____________________INITIALIZATION ROUTINES__________________________
Robot() :
robotDrive( frontLeftChannel,
rearLeftChannel,
frontRightChannel,
rearRightChannel), // these must be initialized in the same order
liftOne(mainLiftChannel), // as they are declared above.
liftTwo(backupLiftChannel),
driveStick(joystickDriveChannel),
armStick(joystickArmChannel),
encoderFL(encoderPorts[0],encoderPorts[1], false, encodingType),
encoderBL(encoderPorts[2], encoderPorts[3], false, encodingType),
encoderFR(encoderPorts[4], encoderPorts[5], false, encodingType),
encoderBR(encoderPorts[6], encoderPorts[7], false, encodingType),
encoderLift(encoderPorts[8], encoderPorts[9], false, encodingType),
bottomLimitSwitch(1),
topLimitSwitch(0)

{
robotDrive.SetExpiration(0.1);
robotDrive.SetInvertedMotor(RobotDrive::kFrontLeftMotor, false);// do not invert the left side motors
robotDrive.SetInvertedMotor(RobotDrive::kRearLeftMotor, false);
robotDrive.SetInvertedMotor(RobotDrive::kFrontRightMotor, true);// invert the right side motors
robotDrive.SetInvertedMotor(RobotDrive::kRearRightMotor, true);// you may need to change or remove this to match your robot
}

float map(float x, float in_min, float in_max, float out_min, float out_max)//*Dalek Voice* EXPLAIIIIIIIIIIN
{
//_____________________FLOAT MAPPING__________________________
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;//*Dalek Voice* EXPLAIIIIIIIIIIIIIIIIIIIIIIN
//Takes in a variable, and variable range, spits out new value
}

void RoboInit()
{
float disPerTick = 0.013004; //Inches (I's small)
//not compared to the size of an electron

//Encoder encoderList = {encoderFL, encoderBL, encoderFR, encoderBR}; //at least we tried
}

void precisionDrive() {
//_______________________________PRECISION DRIVE MODE_____________________________
if (driveStick.GetPOV(1)) { //Forward
driveStick_x = 0;
driveStick_y = 1;
} else if (driveStick.GetPOV(2)) { //Right Forward
driveStick_x = 1;
driveStick_y = 1;
} else if (driveStick.GetPOV(3)) { //Right
driveStick_x = 1;
driveStick_y = 0;
} else if (driveStick.GetPOV(4)) { //Right Backward
driveStick_x = 1;
driveStick_y = -1;
} else if (driveStick.GetPOV(5)) { //Backward
driveStick_x = 0;
driveStick_y = -1;
} else if (driveStick.GetPOV(6)) { //Left Backward
driveStick_x = -1;
driveStick_y = -1;
} else if (driveStick.GetPOV(7)) { //Left
driveStick_x = -1;
driveStick_y = 0;
} else if (driveStick.GetPOV(8)) { //Left Forward
driveStick_x = -1;
driveStick_y = 1;
} else {
driveStick_x = 0;
driveStick_y = 0;
}

//CODE FOR PRECISION ROTATION
// I couldn't re-do this one into a switch because of the way GetRawButton works
if (driveStick.GetRawButton(3)) { //Left Rotation
driveStick_z = -1;
} else if (driveStick.GetRawButton(4)) { //Right Rotation
driveStick_z = 1;
} else { //No Rotation
driveStick_z = 0;
}
}

void analogDrive() {
//_____________________________________NORMAL DRIVE MODE (ANALOG)_______________________________
//Get Joystick Raw Values
driveStick_x = driveStick.GetX();
driveStick_y = driveStick.GetY();

//Written to account for lack of Logitec 3DPro joystick (Z-axis rotation of joystick)
//could be redone so that it takes into account any z-axis capable joystick (rename the declaration more or less)
if (JOYZCAPABLE) {
if (throttleEnabled) { //CUSTOM CONFIG If enabled: throttle is usable
slider = map(driveStick.GetRawAxis(3), -1, 1, 1, 0);// how is the out min bigger than the out max?
} else { //Locks throttle to 100%
slider = 1;
}

driveStick_z = driveStick.GetZ(); //map(x, in_min, in_max, out_min, out_max)
if (fabs(driveStick_z) < joystickThreshold
|| (!driveStick.GetRawButton(2) && rotationLock)
|| driveStick.GetRawButton(1)) { //why are we checking for button 1? Accidental turning?? if so then the check for 2 is redundant
driveStick_z = 0;
}
}

else { //we might want to redo all of this so that the button input is saved in a var that way we can use controllers other than ours
if (driveStick.GetRawButton(4)) { //if button 4 is pressed (left?) turn (left?)
driveStick_z = -attackRotRate;
} else if (driveStick.GetRawButton(5)) { //if button 5 is pressed (right?) turn (right?)
driveStick_z = attackRotRate;
} else {
driveStick_z = 0; //you press nothing... NATHING!
}
slider = map(driveStick.GetRawAxis(2), -1, 1, 1, 0); //wat? i is confuzed by slider
}

//Threshold Value Setting
if (fabs(driveStick_x) < joystickThreshold
|| driveStick.GetRawButton(1)) { // if the x value is inside of the "dead" zone or you are holding the trigger set the x value to 0
driveStick_x = 0;
}
if (fabs(driveStick_y) < joystickThreshold
|| driveStick.GetRawButton(1)) { // if the y value is inside of the "dead" zone or you are holding the trigger se thte y value to 0
driveStick_y = 0;
}
}

void joySettings() {
if (driveStick.GetRawButton(7)) { //Enables analog default drive
defDriveMode = true;
} else if (driveStick.GetRawButton(8)) { //Enables precision drive
defDriveMode = false;
}

if (driveStick.GetRawButton(9)) { //Enables Rotation Lock Mode
rotationLock = true;
} else if (driveStick.GetRawButton(10)) { //Disables rotation lock
rotationLock = false;
}

if (driveStick.GetRawButton(11)) { //Enables throttle
throttleEnabled = true;
} else if (driveStick.GetRawButton(12)) { //Disables Throttle (100%)
throttleEnabled = false;
}
}

void driveEncoders(float distance, float rotation)
{

}

void driveEncoders(float distance) {

}

void logOutput() {
//outputs to the smart dashboard so we can see real-time values.

SmartDashboard::PutNumber("Joystick X ", double(driveStick_x));
SmartDashboard::PutNumber("Joystick Y ", double(driveStick_y));
SmartDashboard::PutNumber("Joystick Z ", double(driveStick_z));
SmartDashboard::PutNumber("Throttle ", double(slider));
//SmartDashboard::PutNumber("Top Limit ", double(topLimitSwitch.GetValue()));
//SmartDashboard::PutNumber("Bottom Limit", double(bottomLimitSwitch->Get()));
}

void liftControl() {
//__________________________LIFT_SECTION_OF_MAIN_LOOP______________________
armStick_y = armStick.GetY();//set the arm raising thing

if (fabs(armStick_y) < joystickThreshold){// ||
//(armStick_y < 0 && (topLimitSwitch.GetValue()) > 2058) ||
//(armStick_y > 0 && (bottomLimitSwitch.GetValue() > 2058))){
// if armStick_y is in the dead zone or if you reached the top limit
//or if you set the bottom limit set arm movement to 0
armStick_y = 0;
}

liftOne.SetSpeed(armStick_y); // THEN THE CODE SAID LET THERE BE LIFT!!!! maybe..
liftTwo.SetSpeed(armStick_y);// THEN THE CODE SAID LET THERE BE LIFT!!!! maybe.. AGAIN!
}

void driveModeSelect() {
//___________________________DRIVE_SECTION_OF_MAIN_LOOP_______________________
//if you are holding the trigger use precision drive, else use regular drive
// Use the joystick X axis for lateral movement, Y axis for forward movement, and Z axis for rotation.
// This sample does not use field-oriented drive, so the gyro input is set to zero.

if (defDriveMode) { //Analog Drive is Default
if (!driveStick.GetRawButton(1)) { //"Button 1" is the trigger.
analogDrive();//Button 2 is for Z-Rotation Lock... And think about it:
// How do you hit the thumb button if you're using your thumb on the hat switch?
} else {
precisionDrive();
}
} else {
if (!driveStick.GetRawButton(1)) {
precisionDrive();
} else {
analogDrive();
}
}
robotDrive.MecanumDrive_Cartesian(driveStick_x * joystickLimit * slider,
driveStick_y * joystickLimit * slider,
driveStick_z * joystickLimit * slider); //Actually do the moving stuff
}

void OperatorControl() {

robotDrive.SetSafetyEnabled(false); //no safety for you

while (IsOperatorControl() && IsEnabled()) {
joySettings();
driveModeSelect();
liftControl();
logOutput();
Wait(0.005); // wait 5ms to avoid hogging CPU cycles
}
}

/*void Autonomous()
{
while(IsAutonomous() && IsEnabled())
{
if(AutonChoice == 1)
{

}
}
}*/

};

START_ROBOT_CLASS(Robot); //Initializes the class so the robot actually does stuff

Link to comment
Share on other sites

They don't with stock, but with tweaks to lo-fi's plugin and some IR they do :)

I've just had a go recreating the rover and encountered the same issue. I think that's the plugin causing it? On an unrelated note, that rover design works great as a self-righting mechanism :)

I've only encountered it when the foldatron part is angled (other than 90 degrees) and I re-attach a another part to it. It never happens with freshly grabbed parts. I'm not sure it is a plugin bug, seems like more of an editor bug. I also use Editor Extension, it may interfere with nodes attachment as I frequently turn the surface attachment on and off.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...