These are chat archives for blankered/Firmware

4th
Feb 2016
blankered
@blankered
Feb 04 2016 21:57
This is the fork I created to put some of the files I have made for this project
Mark Whitehorn
@kd0aij
Feb 04 2016 22:02
OK, I see a notification in github now. What does adding people to your repo do for you? I've never done that before.
Mark Whitehorn
@kd0aij
Feb 04 2016 22:08
I see, "push" access. I normally issue PRs instead of pushing to other repos. I usually only push to my own fork. The github PR mechanism is really nice, compared to the way I used to work in SVN
blankered
@blankered
Feb 04 2016 22:11
To be honest I am new to this. I just figured out how to fork, pull, and push a few days ago. You can do what ever is easier or native for you. If you PR, I'll have to figure how to allow your changes, hahaha. No worries though, I'll figure it out.
Mark Whitehorn
@kd0aij
Feb 04 2016 22:13
I always start by googling e.g. "git pull PR from other repo" There are almost always several good hits on how to do anything possible in git
blankered
@blankered
Feb 04 2016 22:16
Yea, I have found Github and other websites have been pretty helpful with howto resources for git
Mark Whitehorn
@kd0aij
Feb 04 2016 22:21
instead of having to commit directly to the shared repo as with SVN, you can easily create a branch in your own fork whenever it's convenient to encapsulate a task. If it's for another fork, like PX4/Firmware, then when you're done, rebase it on whichever branch of whichever fork you want to apply it to and generate a PR. Then the owner of that fork (and anyone else) can easily look at the PR to do code inspection (or test/fly it) before applying the changes.
blankered
@blankered
Feb 04 2016 22:33
The kit I am working with did not come with a controller, I received it from another lab. It does not have the cover either but it looks exactly like the reaper 500's frame, servos, and esc.
Mark Whitehorn
@kd0aij
Feb 04 2016 22:51
OK, I'm hoping I can test fly it in the stock configuration first so I'll know what to expect
blankered
@blankered
Feb 04 2016 22:57
how would I write a C++ logic that says
for i < motor count
      output[i] = mix(scale*roll[i],scale*pitch[i],scale*yaw[i])
      but....
      output[0] = inverse(output[0]) + offset
      output[1] = inverse(output[1]) + offset
end
maybe add an if statement?
Mark Whitehorn
@kd0aij
Feb 04 2016 23:06
maybe: if (i < 2) output[i] = ...
You know the standard mixer supports per-channel offsets and sign flips though?
https://pixhawk.org/dev/mixing?s[]=mixing
blankered
@blankered
Feb 04 2016 23:11
can it remix channels 0 and 1 that are being mixed by multicopter_mixer?
I honestly tried to do that but I struggled to understand how
Mark Whitehorn
@kd0aij
Feb 04 2016 23:18
no, I was thinking of the fixed-wing mixers. the multirotor mixer doesn't have per-channel params. Are you starting with mixer_multirotor.cpp?
blankered
@blankered
Feb 04 2016 23:19
yes
Mark Whitehorn
@kd0aij
Feb 04 2016 23:20
everything in PX4 (and autopilots in general) is complicated :)
blankered
@blankered
Feb 04 2016 23:21

i tried

if(i < 2) {
                outputs[i] = -outputs[i];

just for inverse but it doesn't work

i don't get a response from servo 0 or 1
Mark Whitehorn
@kd0aij
Feb 04 2016 23:22
if the output is PWM period in usec, then the inverse operation is not a sign flip
blankered
@blankered
Feb 04 2016 23:23
yea, I was wondering what outputs were in actually, I thought -1..1
blankered
@blankered
Feb 04 2016 23:31
if they are in PWM then I could do outputs[i] = outputs[i] + 500
Mark Whitehorn
@kd0aij
Feb 04 2016 23:31
it does look like they're normalized inside the mixer, though
you could just print some values to be sure
Mark Whitehorn
@kd0aij
Feb 04 2016 23:43
looks like the conversion from normalized to PWM period happens in mixer.cpp:mixer_tick
blankered
@blankered
Feb 04 2016 23:52
so inside the multicopter_mixer, outputs range is -1 to 1, correct?