Dawn Robotics Forum Support and community forums for Dawn Robotics Ltd 2015-11-17T19:50:24+01:00 http://forum.dawnrobotics.co.uk/feed.php?f=10&t=1403 2015-11-17T19:50:24+01:00 2015-11-17T19:50:24+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1403&p=1998#p1998 <![CDATA[Re: Raspberry Pi Camera Robot Modification]]>
Welcome to the forums. :)

You will probably need to modify a number of files to get this working, but there are a couple of different approaches which will affect that precise number needed.

First off, do you think that perhaps you could get away with disabling one of the neck servos and using the connector for the claw servo instead? The pan servo for example (you can always turn the robot if you want to look left or right). If you were ok to do this then you could get away with just modifying the web interface.

Anyway, the first file to modify would be the web interface index.html. If you're changing the function of the pan servo then I'd suggest providing seperate sliders for the tilt servo, and the claw (pan) servo and using the command

socket.send( "SetNeckAngles " + clawAngle + " " + tiltAngle );

whenever one changes.

Otherwise, if you're adding an extra servo, you'd need to define an extra command, something like SetClawAngle and use it like this

socket.send( "SetClawAngle " + clawAngle );

Moving onto the Python code, you'd first need to modify robot_web_server.py to handle the SetClawAngle command. See line 184 for how the SetNeckAngle command is handled.

At this point, you're faced with a choice. If you can attach the signal line of the servo motor to one of the Pi GPIO pins, you can write Python code in robot_web_server.py to set the claw angle, using code similar to that given in this tutorial.

If on the otherhand you'd like to attach the servo to the mini driver, you still have a way to go... Basically you'd need to follow the path of a command like robot.setNeckAngles( panAngle, tiltAngle ) (line 200 of robot_web_server.py) into robot_controller.py, then into mini_driver.py before the angle is sent over USB to the mini_driver_firmware.ino sketch, at this point you'd need to receive the angle and modify the update loop of the sketch to output the claw angle.

So hopefully that gives you some ideas on how you can approach this. My advice would be to try the simple method of co-opting the pan servo first and then maybe move onto one of the more involved approaches if you want a bit more control. If there's any further information you need, please let me know.

Regards

Alan

Statistics: Posted by Alan — Tue Nov 17, 2015 7:50 pm


]]>
2015-11-16T16:55:44+01:00 2015-11-16T16:55:44+01:00 http://forum.dawnrobotics.co.uk/viewtopic.php?t=1403&p=1994#p1994 <![CDATA[Raspberry Pi Camera Robot Modification]]>
Many thanks
adamrobots :mrgreen:

Statistics: Posted by adamrobots — Mon Nov 16, 2015 4:55 pm


]]>