{"id":19795626,"url":"https://github.com/dkogan/dynamixel","last_synced_at":"2025-07-19T04:32:37.246Z","repository":{"id":1314581,"uuid":"1259381","full_name":"dkogan/dynamixel","owner":"dkogan","description":"Perl driver for dynamixel servo motors. This is the repo for Device::Dynamixel at CPAN","archived":false,"fork":false,"pushed_at":"2011-06-12T06:00:30.000Z","size":120,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-28T16:09:19.537Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dkogan.png","metadata":{"files":{"readme":"README.pod","changelog":"Changes","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-01-16T01:51:24.000Z","updated_at":"2014-09-08T21:46:47.000Z","dependencies_parsed_at":"2022-08-16T13:05:10.784Z","dependency_job_id":null,"html_url":"https://github.com/dkogan/dynamixel","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dkogan/dynamixel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkogan%2Fdynamixel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkogan%2Fdynamixel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkogan%2Fdynamixel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkogan%2Fdynamixel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dkogan","download_url":"https://codeload.github.com/dkogan/dynamixel/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkogan%2Fdynamixel/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265888898,"owners_count":23844527,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T07:16:53.868Z","updated_at":"2025-07-19T04:32:37.226Z","avatar_url":"https://github.com/dkogan.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"=head1 OVERVIEW\n\nThis is a simple driver for control of Robotis Dynamixel servo\nmotors. This repository stores the history for the Device::Dynamixel\nmodule on CPAN. Install the module via CPAN. CPAN page at\nL\u003chttp://search.cpan.org/~dkogan/Device-Dynamixel/lib/Device/Dynamixel.pm\u003e\n\n=cut\n\n=head1 NAME\n\nDevice::Dynamixel - Simple control of Robotis Dynamixel servo motors\n\n=cut\n=head1 SYNOPSIS\n\n use Device::Dynamixel;\n\n open my $pipe, '+\u003c', '/dev/ttyUSB0' or die \"Couldn't open pipe for reading and writing\";\n my $motorbus = Device::Dynamixel-\u003enew($pipe);\n\n # set motion speed of ALL motors to 200\n $motorbus-\u003ewriteMotor($Device::Dynamixel::BROADCAST_ID,\n                       $Device::Dynamixel::addresses{Moving_Speed_L}, [200, 0]);\n\n # move motor 5 to 10 degrees off-center\n $motorbus-\u003emoveMotorTo_deg(5, 10);\n\n # read the position of motor 5\n my $status = $motorbus-\u003ereadMotor(5,\n                                   $Device::Dynamixel::addresses{Present_Position_L}, 2);\n my @params = @{$status-\u003e{params}};\n my $position = $params[1]*255 + $params[0];\n\n=head1 DESCRIPTION\n\nThis is a simple module to communicate with Robotis Dynamixel servo motors. The\nDynamixel AX-12 motors have been tested to work with this module, but the others\nshould work also.\n\nA daisy-chained series string of motors is connected to the host via a simple\nserial connection. Each motor in the series has an 8-bit ID. This ID is present\nin every command to address specific motors. One Device::Dynamixel object should\nbe created for a single string of motors connected to one motor port.\n\nThese motors communicate using a particular protocol, which is implemented by\nthis module. Commands are sent to the motor. A status reply is sent back after\neach command. This module handles construction and parsing of Dynamixel packets,\nas well as the sending and receiving data when needed.\n\n=head2 EXPORTED VARIABLES\n\nTo communicate with all motor at once, send commands to the broadcast ID:\n\n $Device::Dynamixel::BROADCAST_ID\n\nAll the motor control addresses described in the Dynamixel docs are defined in this module,\navailable as\n\n $Device::Dynamixel::addresses{$value}\n\nDefined values are:\n\n ModelNumber_L\n ModelNumber_H\n Version_of_Firmware\n ID\n Baud_Rate\n Return_Delay_Time\n CW_Angle_Limit_L\n CW_Angle_Limit_H\n CCW_Angle_Limit_L\n CCW_Angle_Limit_H\n Highest_Limit_Temperature\n Lowest_Limit_Voltage\n Highest_Limit_Voltage\n Max_Torque_L\n Max_Torque_H\n Status_Return_Level\n Alarm_LED\n Alarm_Shutdown\n Down_Calibration_L\n Down_Calibration_H\n Up_Calibration_L\n Up_Calibration_H\n Torque_Enable\n LED\n CW_Compliance_Margin\n CCW_Compliance_Margin\n CW_Compliance_Slope\n CCW_Compliance_Slope\n Goal_Position_L\n Goal_Position_H\n Moving_Speed_L\n Moving_Speed_H\n Torque_Limit_L\n Torque_Limit_H\n Present_Position_L\n Present_Position_H\n Present_Speed_L\n Present_Speed_H\n Present_Load_L\n Present_Load_H\n Present_Voltage\n Present_Temperature\n Registered_Instruction\n Reserved\n Moving\n Lock\n Punch_L\n Punch_H\n\nTo change the baud rate of the motor, the B\u003cBaud_Rate\u003e address must be written\nwith a value\n\n $Device::Dynamixel::baudrateValues{$baud}\n\nThe available baud rates are\n\n 1000000\n 500000\n 400000\n 250000\n 200000\n 115200\n 57600\n 19200\n 9600\n\nNote that the baud rate generally is cached from the last time the motor was\nused, defaulting to 1Mbaud at the start\n\n=head2 STATUS RETURN\n\nMost of the functions return a status hash that describes the status of the motors and/or returns\nqueried data. This hash is defined as\n\n { from   =\u003e $motorID,\n   error  =\u003e $error,\n   params =\u003e \\@parameters }\n\nIf no valid reply was received, undef is returned. Look at the Dynamixel hardware documentation for\nthe exact meaning of each hash element.\n\n=cut\n=head1 CONSTRUCTOR\n\n=head2 new( PIPE )\n\nCreates a new object to talk to a Dynamixel motor. The file handle has to be opened and set-up\nprior to constructing the object.\n\n=cut\n=head1 METHODS\n\n=head2 pingMotor( motorID )\n\nSends a ping. Status reply is returned\n\n=cut\n=head2 writeMotor( motorID, startingAddress, data )\n\nSends a command to the motor. Status reply is returned.\n\n=cut\n=head2 readMotor( motorID, startingAddress, howManyBytes )\n\nReads data from the motor. Status reply is returned.\n\n=cut\n=head2 writeMotor_queue( motorID, startingAddress, data )\n\nQueues a particular command to the motor and returns the received reply. Does\nnot actually execute the command until triggered with triggerMotorQueue( )\n\n=cut\n=head2 triggerMotorQueue( motorID )\n\nSends a trigger for the queued commands. Status reply is returned.\n\n=cut\n=head2 resetMotor( motorID )\n\nSends a motor reset. Status reply is returned.\n\n=cut\n=head2 syncWriteMotor( motorID, startingAddress, data )\n\nSends a synced-write command to the motor. Status reply is returned.\n\n=cut\n=head2 moveMotorTo_deg( motorID, position_degrees )\n\nConvenience function that uses the lower-level routines to move a motor to a\nparticular position\n\n=cut\n=head1 BUGS\n\nAn issue is the baud rate of the serial communication. The motors default to 1M\nbaud. This is unsupported by the stock POSIX module in perl5, so the serial port\nmust be configured externally, prior to using to this module.\n\n=head1 REPOSITORY\n\nL\u003chttps://github.com/dkogan/dynamixel\u003e\n\n=head1 AUTHOR\n\nDima Kogan, C\u003c\u003c \u003cdima@secretsauce.net\u003e \u003e\u003e\n\n=head1 LICENSE AND COPYRIGHT\n\nCopyright 2011 Dima Kogan.\n\nThis program is free software; you can redistribute it and/or modify it\nunder the terms of either: the GNU General Public License as published\nby the Free Software Foundation; or the Artistic License.\n\nSee http://dev.perl.org/licenses/ for more information.\n\n\n=cut\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdkogan%2Fdynamixel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdkogan%2Fdynamixel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdkogan%2Fdynamixel/lists"}