GithubHelp home page GithubHelp logo

Comments (4)

xinshuoweng avatar xinshuoweng commented on June 24, 2024

Thanks for your feedback.

However, I did not see anywhere a redundant indentation exists and I can run the code on my side without any modification. Could you please point out where it is exactly, e.g., copy the line of code here and highlight the redundant indentation?

Thanks!

from ab3dmot.

gongshichina avatar gongshichina commented on June 24, 2024

Thanks for your kind reply.

Here we didn't consider the case abs(new_theta - predicted_theta) >= 3*np.pi /2 , which is parallel to the the brunch of line 236, so I mistaked it as a redundant indentation.

But I don't understand we don't need to consider the case abs(new_theta - predicted_theta) >= 3*np.pi /2, that is:

if abs(new_theta - predicted_theta) > np.pi / 2.0 and abs(new_theta - predicted_theta) < np.pi * 3 / 2.0:     # if the angle of two theta is not acute angle
  self.kf.x[3] += np.pi       
  if self.kf.x[3] > np.pi: self.kf.x[3] -= np.pi * 2    # make the theta still in the range
  if self.kf.x[3] < -np.pi: self.kf.x[3] += np.pi * 2
  
  # now the angle is acute: < 90 or > 270, convert the case of > 270 to < 90
  if abs(new_theta - self.kf.x[3]) >= np.pi * 3 / 2.0:
    if new_theta > 0: self.kf.x[3] += np.pi * 2
    else: self.kf.x[3] -= np.pi * 2
else:  # abs(new_theta - predicted_theta) >= 3*np.pi /2
    if new_theta > 0: self.kf.x[3] += np.pi * 2
    else: self.kf.x[3] -= np.pi * 2

from ab3dmot.

xinshuoweng avatar xinshuoweng commented on June 24, 2024

Nice catch! I have removed the indentation as you suggested.

Please let me know if you have any further suggestion. :)

from ab3dmot.

abhigoku10 avatar abhigoku10 commented on June 24, 2024

@xinshuoweng can you please explain this section of the code

if self.kf.x[3] >= np.pi: self.kf.x[3] -= np.pi * 2 # make the theta still in the range
if self.kf.x[3] < -np.pi: self.kf.x[3] += np.pi * 2

new_theta = bbox3D[3]
if new_theta >= np.pi: new_theta -= np.pi * 2    # make the theta still in the range
if new_theta < -np.pi: new_theta += np.pi * 2
bbox3D[3] = new_theta

predicted_theta = self.kf.x[3]
if abs(new_theta - predicted_theta) > np.pi / 2.0 and abs(new_theta - predicted_theta) < np.pi * 3 / 2.0:     # if the angle of two theta is not acute angle
  self.kf.x[3] += np.pi       
  if self.kf.x[3] > np.pi: self.kf.x[3] -= np.pi * 2    # make the theta still in the range
  if self.kf.x[3] < -np.pi: self.kf.x[3] += np.pi * 2
  
# now the angle is acute: < 90 or > 270, convert the case of > 270 to < 90
if abs(new_theta - self.kf.x[3]) >= np.pi * 3 / 2.0:
  if new_theta > 0: self.kf.x[3] += np.pi * 2
  else: self.kf.x[3] -= np.pi * 2

######################### 

from ab3dmot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.