benkuper / bikinect

Automatically exported from code.google.com/p/bikinect
3 stars 1 forks source link

distance mapping not working #16

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

        <mapping label="basso">

                <processor type="boolean" filter="less_than" label="basso_sx">
                    <processor type="distance" filter="less_than" label="basso_sx2">
                        <element type="joint" target="left_hand" property="position" axis="y" />
                        <element type="joint" target="head" property="position" axis="y" />
                    </processor>    
                    <processor type="direct">
                        <element type="value" value="50" />
                    </processor>    
                </processor>        

            <output>
                <midi type="note" device="0" channel="1" channelMap="1" velocityMap="0" minChannel="61" maxChannel="66" minVelocity="0" maxVelocity="127" distinctNotes="true" />
            </output>
        </mapping>  

What is the expected output? What do you see instead?

Mapping should activate when hand go over the head + 50 units.
Instead, mapping never activate.

What version of the product are you using? On what operating system?

mappinect 1.0, macosx 10.6.7

Please provide any additional information below.

This instead works (i'm asking to activate just when hand go over the head)

<mappings>

    <mappingset id="ScopriESuonaStrumenti">

        <mapping label="basso">

                <processor type="boolean" filter="less_than" label="basso_sx">
                        <element type="joint" target="head" property="position" axis="y" /> 
                        <element type="joint" target="left_hand" property="position" axis="y" />
                </processor>        

            <output>
                <midi type="note" device="0" channel="1" channelMap="1" velocityMap="0" minChannel="61" maxChannel="66" minVelocity="0" maxVelocity="127" distinctNotes="true" />
            </output>
        </mapping>                      

    </mappingset>

</mappings>

Original issue reported on code.google.com by michele....@gmail.com on 12 Jan 2012 at 9:48

GoogleCodeExporter commented 9 years ago
The first mapping you wrote is actually not the same as the working one you 
wrote after.

The first mapping activates when the [absolute] distance between the head and 
the left hand is less than 50 (aka 50mm, or 5cm). The distance processor 
calculates the absolute distance between 2 3d points, i.e. the "axis" option in 
the elements that are nested into the distance processor are not used.

The second (working) mapping is the right way to do it.
But what are you trying to achieve exactly ?

Original comment by bkuperb...@gmail.com on 12 Jan 2012 at 10:22

GoogleCodeExporter commented 9 years ago
thanks.
I'm trying to map a hand that go over the head position + 5 cm. So, i thought 
the mapping i wrote tells: this is true when you hand position on z axis is 
more than your head position on z axis + 5 cm. Is that possible?

Original comment by michele....@gmail.com on 12 Jan 2012 at 10:39

GoogleCodeExporter commented 9 years ago
Hi,
i just uploaded a new version of mappInect - working with SimpleOpenNI 0.24

In this version, you can use the "sum" and "minus" filters (it's not documented 
yet, you're the first one to try this out !)

Here what it would look like :
<mappings>

    <mappingset id="ScopriESuonaStrumenti">

        <mapping label="basso">

                <processor type="boolean" filter="greater_than" label="basso_sx">
                        <processor type="filtered" filter="minus">
                                                <element type="joint" target="left_hand" property="position" axis="y" />
                        <element type="joint" target="head" property="position" axis="y" /> 
                        </processor>

                        <processor type="direct">
                                               <element type="value" value="50" />
                        </processor>
                </processor>        

            <output>
                <midi type="note" device="0" channel="1" channelMap="1" velocityMap="0" minChannel="61" maxChannel="66" minVelocity="0" maxVelocity="127" distinctNotes="true" />
            </output>
        </mapping>                      

    </mappingset>
</mappings>

Original comment by bkuperb...@gmail.com on 12 Jan 2012 at 11:30

GoogleCodeExporter commented 9 years ago
great.

Original comment by michele....@gmail.com on 12 Jan 2012 at 11:54

GoogleCodeExporter commented 9 years ago
and happy to be the first one :-)

Original comment by michele....@gmail.com on 12 Jan 2012 at 11:55

GoogleCodeExporter commented 9 years ago
Dear,
"plus" and "minus" allow to achieve my goal. But, wouldn't be a simpler 
interface choiche, to implement that allowing "distance" to be limited by 
"axis" - not calculating absolute distance, but just distance on a single (or 
2) axis? You'd obtain the same mapping possibilities without new filter type. 
In this view, the first mapping i posted in this thread would be an example on 
how to use it.
Anyway thanks, in another way, that's a solution anyway.

Original comment by michele....@gmail.com on 12 Jan 2012 at 1:24