79610756

Date: 2025-05-07 14:23:35
Score: 6.5 🚩
Natty:
Report link

@Benjamin, I followed all your steps in the demo model/blog post you linked to give cars and peds "eyes", but I am encountering one outstanding issue. In the checkForPed function (see pasted below), I get the error message that "The method get_Main() is undefined for the type Cars". Any ideas on how to resolve? I tried main.pedestrian, too, but that didn't seem to work. Thanks!

for (Pedestrian thisPed : get_Main().pedestrian) {
    // for each pedestrian in model
    double pedX = thisPed.getX() - getX();
    double pedY = thisPed.getY() - getY();
    if (fieldOfView.contains(pedX, pedY)) {
        pedInDanger = true;
        break;
    } 
}
Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Blacklisted phrase (1): Any ideas
  • RegEx Blacklisted phrase (1.5): how to resolve?
  • RegEx Blacklisted phrase (1): I get the error
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • User mentioned (1): @Benjamin
  • Looks like a comment (1):
  • Low reputation (1):
Posted by: Annie Engen