strands-project/strands_qsr_lib

[qtcb] Calculated with t or t-1

Closed this issue · 5 comments

@cdondrup
Quick question: qtcb(o1, o2) is calculated with pose of o2 at t or t-1? Relevant bits below but pos_l[-2] not helping...

k = [input_data.trace[t0].objects[o1_name].x,
                             input_data.trace[t0].objects[o1_name].y,
                             input_data.trace[t1].objects[o1_name].x,
                             input_data.trace[t1].objects[o1_name].y]
                        l = [input_data.trace[t0].objects[o2_name].x,
                             input_data.trace[t0].objects[o2_name].y,
                             input_data.trace[t1].objects[o2_name].x,
                             input_data.trace[t1].objects[o2_name].y]
                        qtc_sequence = np.append(qtc_sequence, self._create_qtc_representation(
                            k,
                            l,
                            quantisation_factor
                        )).reshape(-1,4)
pos_k = np.array(pos_k).reshape(-1, 2)
pos_l = np.array(pos_l).reshape(-1, 2)
rot_RL = self._orthogonal_line(
            pos_k[-2],
            np.append(pos_k[-2], (pos_l[-2]-pos_k[-2]))
        ).reshape(-1,2)
        #print "rot_RL", rot_RL
        trans_RL_k = self._translate(
            [rot_RL[0], rot_RL[1]],
            (rot_RL[0]-rot_RL[1])/2
        )
trans_RL_k = self._translate(
            [rot_RL[0], rot_RL[1]],
            (rot_RL[0]-rot_RL[1])/2
        )
k = np.append(
            self._test_constraint(
                pos_k,
                trans_RL_k,
                quantisation_factor=quantisation_factor),
            self._test_constraint(
                pos_k,
                RL_ext,
                quantisation_factor=quantisation_factor,
                constraint="side")
        )

Nevermind, I think I got it, it is with t-1... why pos_l[-2] when pos_l[-2] is pos_l[0]?

Can still confirm though :).

It is calculated for t. In here the double cross is constructed for t-1 and in this bit The qtc state for the change from t-1 to t is created. So the qtc state represents the change in relative position of o2 from t-1 tot. But as always, assigning timestamps to qtc states is quite difficult.

Not sure now why I used pos_l[-2] instead of pos_l[0] but it should both work. Only in cases where the list is growing dynamically pos_l[0] wouldn't... I don't see a need to change this though ;)

Ah, now I get your question... The qtc state for o1 at time t is calculated using the pose of o2 at time t-1 and vice-versa.

Ah, now I get your question... The qtc state for o1 at time t is calculated using the pose of o2 at time t-1 and vice-versa.

Thanks. And, yes was not asking to change -2 to 0, was just wondering :).

Who knows what I thought while writing this... One of nature's mysteries :D