PiDog turn to a given direction

I am writing code for a new patrol and interact module.

When a sound is detected, the direction (angle) is identified and the dog is to move either its head towards a sound in front or turn its body around if the sound is behind the dog.

Rather than rewrite the body move code, I noticed a set_angle method in the Pidog class. This looks as if it may be what I need, but within the method, it calls another method, limit_angle which doesn’t seem to be defined. Is this a bug?

Furthermore, is there any documentation of all of the Pidog class methods and required parameters?

I’m unable to answer your specific question. However, whilst Ive not tried it myself, Seito_black wrote some similar code and released on github

Possibly you can see which routines they used? At least until Sunfounder return after their vacation, with a proper answer.

Thanks, I had already seen Seito_black’s code. Some good ideas, but not specifically what I was looking for.

I have written some code which I am now testing and will share at a later stage.

Still would be great to have some detailed documentation of the pidog.py PiDog() class, let’s hope Sunfound has a great holiday and can provide something when back from vacation.

1 Like

I’d be interested to see this when finished. I added both ROS and non ROS voice control to my pidog, (code published on this site)

I always wanted to add the voice command “come here” , but found the sensitivity of the sound direction device to be inadequate for anything but a loud clap, so I abandoned this.

Maybe I can steal some of your ideas :wink:

Sorry, we currently don’t have detailed API documentation available.

For this functionality, you can use:

  • head_move()
  • turn_left() or turn_right()

For more advanced control, you can utilize the IMU gyroscope to achieve more precise orientation control of the dog.

Let me know if you need further assistance.