NXC: set all motor cmds to invers
NXC: set all motor cmds to invers
hi,
what's the command to set all motor commands to "invers" (because of mechanical issues):
"forward" turns the motor reverse but lets the counter increase
"reverse" turns the motor forward but lets the counter decrease
this with all commands: OnFwd, RotateMotor, RotateMotorEx,....
what's the command to set all motor commands to "invers" (because of mechanical issues):
"forward" turns the motor reverse but lets the counter increase
"reverse" turns the motor forward but lets the counter decrease
this with all commands: OnFwd, RotateMotor, RotateMotorEx,....
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: NXC: set all motor cmds to invers
I don't think there is support for that. If you really need it, you can wrap all the functions in a similar syntax function where you can specify if you want to invert it. You can invert the numbers using very simple math (usually "*(-1)").
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
Re: NXC: set all motor cmds to invers
I bet there MUST be something like that. RobotC has got it, even the Tetrix Mux has got it.
Multiplying some values by -1 is just weird using odometry, PID control, fixed target control, a.s.o.
Multiplying some values by -1 is just weird using odometry, PID control, fixed target control, a.s.o.
Re: NXC: set all motor cmds to invers
Just to fix the space time continuum:doc-helmut wrote:I bet there MUST be something like that. RobotC has got it, even the Tetrix Mux has got it.
Multiplying some values by -1 is just weird using odometry, PID control, fixed target control, a.s.o.
No, there is absolutely NO NEED to introduce something like that on a language, firmware, or API level. If you really need this feature, you HAVE TO do it yourself. Establish motor configurations. Abstract your software from the hardware.
If the need to have the feature you describe in NXC, then your software design is flawed. But that's no problem: You can simply fix it. Software construction is an iterative process.
RWTH - Mindstorms NXT Toolbox for MATLAB
state of the art in nxt remote control programming
http://www.mindstorms.rwth-aachen.de
MotorControl now also in Python, .net, and Mathematica
state of the art in nxt remote control programming
http://www.mindstorms.rwth-aachen.de
MotorControl now also in Python, .net, and Mathematica
Re: NXC: set all motor cmds to invers
please simply answer my question, I don't need platitudes like "there is no need for it in any language, your software design is flawed, do it yourself". Besides, you're simply wrong, it already HAS been established in RobotC and e.g. for the HT muxer.linusa wrote:Just to fix the space time continuum:doc-helmut wrote:I bet there MUST be something like that. RobotC has got it, even the Tetrix Mux has got it.
Multiplying some values by -1 is just weird using odometry, PID control, fixed target control, a.s.o.
No, there is absolutely NO NEED to introduce something like that on a language, firmware, or API level. If you really need this feature, you HAVE TO do it yourself. Establish motor configurations. Abstract your software from the hardware.
If the need to have the feature you describe in NXC, then your software design is flawed. But that's no problem: You can simply fix it. Software construction is an iterative process.
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: NXC: set all motor cmds to invers
Helmut, I am totally with Linus on this. There is absolutely no reason you should need this feature.doc-helmut wrote:please simply answer my question, I don't need platitudes like "there is no need for it in any language, your software design is flawed, do it yourself". Besides, you're simply wrong, it already HAS been established in RobotC and e.g. for the HT muxer.
The HT Tetrix Motor controller has that feature implemented as an extra feature, not to set the bar for the NXT. As far as ROBOTC supporting it, good for ROBOTC. Who cares, since you refuse to use it anyhow. Assuming you really need it in NXC, just do it yourself. If you truly can't do it with SW, you could hack a cable and do it with HW.
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
Re: NXC: set all motor cmds to invers
I didn't ask for a workaround, but for a command, and not because I couldn't imagine any workaround, but because I was sure that there already existed something like this.
Re: NXC: set all motor cmds to invers
RobotC supports this because it is based on the RCX virtual machine which included that feature. The NXT firmware does not have any support for a global motor direction inversion option. Since there isn't any support for this at the firmware level there isn't any support for it in the NXC API.
John Hansen
John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
http://bricxcc.sourceforge.net/
Re: NXC: set all motor cmds to invers
I am locking this topic. This case is closed. John has made himself clear.
If you want this functionality, write it yourself.
- Xander
If you want this functionality, write it yourself.
- Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
Who is online
Users browsing this forum: No registered users and 4 guests