ROB 502: Programming for Robotics: Class 8.5 Clicker Questions

Clicker Questions

  1. How many bits are in a byte?
  2. How many bytes are in a uint16_t?
  3. What is 164 in hexadecimal?
  4. What is 87 in hexadecimal?

You have a 5 by 5 image buffer of 24-bit bgr pixels.

  1. How many bytes large is this buffer?
  2. What is the index of the coordinate (4, 2)?
  3. What is the index of the coordinate (2, 4)?
  4. If the buffer had type uint8_t instead of "24-bit bgr pixel", what would be the index of the blue component of the pixel at (4, 2)?
  5. If the buffer had type uint8_t instead of "24-bit bgr pixel", what would be the index of the red component of the pixel at (2, 4)?
  6. On a 32-bit computer, what is sizeof(uint64_t *)?
  7. On a 32-bit computer, what is sizeof(uint64_t)?

Homework 2 note

I have added a note to the document about how I organize my collision code!

// slightly modified from homework 1, they provide a single function
// bool check_collides(vector_xy_t *pg1, vector_xy_t *pg2);
collision.c
collision.h

I also want to give a shout out for a recent post on piazza:

In debugging braitenberg so far, gdb has been invaluable. Here’s a link to the 10 minute CS50 video I watched to learn how to use it better. I promise it is well worth the time.