From 186bbfaf183e4db44667d5614e1e183d4e53148d Mon Sep 17 00:00:00 2001 From: ROBOTIS Date: Fri, 4 Mar 2016 21:01:35 +0900 Subject: [PATCH 01/37] - renewal --- README.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..73be6ba --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# ROBOTIS-Framework +ROBOTIS Framework GIT REP MAIN From 6081c075bf8646df0e79bdfb492b6507b1bfe93e Mon Sep 17 00:00:00 2001 From: ROBOTIS-zerom Date: Wed, 4 May 2016 17:23:11 +0900 Subject: [PATCH 02/37] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 73be6ba..a1ba62c 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # ROBOTIS-Framework ROBOTIS Framework GIT REP MAIN + +Documents : [ROBOTIS Framework WIKI](https://github.com/ROBOTIS-GIT/ROBOTIS-Documents/wiki/ROBOTIS-ROS-Framework-Documents) From 360595bdd4071a38cd7c56d35a0a5111b76be3fb Mon Sep 17 00:00:00 2001 From: Alexander Stumpf Date: Tue, 24 May 2016 16:33:40 +0200 Subject: [PATCH 03/37] added .gitignore --- .gitignore | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..36a5c0a --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +build +devel +bin +lib +msg_gen +srv_gen +qtcreator-build +*~ +*.backup +*.user +*.autosave From 9b15433e92d1f2175e298a9f4d2615c9f784766f Mon Sep 17 00:00:00 2001 From: ROBOTIS-zerom Date: Thu, 26 May 2016 19:11:01 +0900 Subject: [PATCH 04/37] Update LICENSE License changed (to BSD License) --- LICENSE | 365 ++++---------------------------------------------------- 1 file changed, 26 insertions(+), 339 deletions(-) diff --git a/LICENSE b/LICENSE index 23cb790..1d93559 100644 --- a/LICENSE +++ b/LICENSE @@ -1,339 +1,26 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - {description} - Copyright (C) {year} {fullname} - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - {signature of Ty Coon}, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. +Software License Agreement (BSD License) + +Copyright (c) 2014, ROBOTIS Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of ROBOTIS nor the names of its contributors may be + used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY ROBOTIS "AS IS" AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL ROBOTIS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. From abd93b6919465a9e1b3653f8c2549d8a0e79a515 Mon Sep 17 00:00:00 2001 From: ROBOTIS-zerom Date: Wed, 1 Jun 2016 16:53:03 +0900 Subject: [PATCH 05/37] - License changed (to BSD) --- LICENSE | 365 ++++---------------------------------------------------- 1 file changed, 26 insertions(+), 339 deletions(-) diff --git a/LICENSE b/LICENSE index 23cb790..1d93559 100644 --- a/LICENSE +++ b/LICENSE @@ -1,339 +1,26 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - {description} - Copyright (C) {year} {fullname} - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - {signature of Ty Coon}, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. +Software License Agreement (BSD License) + +Copyright (c) 2014, ROBOTIS Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of ROBOTIS nor the names of its contributors may be + used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY ROBOTIS "AS IS" AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL ROBOTIS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. From 82294db8ba01061647965dff2068382820ab8eaa Mon Sep 17 00:00:00 2001 From: Jay-Song Date: Fri, 28 Oct 2016 10:29:30 +0900 Subject: [PATCH 06/37] update --- .gitignore | 1 + LICENSE | 52 ++++++++++++++++++++++++++-------------------------- README.md | 8 ++++---- 3 files changed, 31 insertions(+), 30 deletions(-) create mode 100755 .gitignore mode change 100644 => 100755 LICENSE mode change 100644 => 100755 README.md diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..6702710 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/robotis_device/devices/dynamixel/H54-100-B210-R-NR.device diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 index 1d93559..5298325 --- a/LICENSE +++ b/LICENSE @@ -1,26 +1,26 @@ -Software License Agreement (BSD License) - -Copyright (c) 2014, ROBOTIS Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of ROBOTIS nor the names of its contributors may be - used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY ROBOTIS "AS IS" AND ANY EXPRESS OR IMPLIED -WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL ROBOTIS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Software License Agreement (BSD License) + +Copyright (c) 2014, ROBOTIS Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of ROBOTIS nor the names of its contributors may be + used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY ROBOTIS "AS IS" AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL ROBOTIS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md old mode 100644 new mode 100755 index a1ba62c..02d6b48 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# ROBOTIS-Framework -ROBOTIS Framework GIT REP MAIN - -Documents : [ROBOTIS Framework WIKI](https://github.com/ROBOTIS-GIT/ROBOTIS-Documents/wiki/ROBOTIS-ROS-Framework-Documents) +# ROBOTIS-Framework +ROBOTIS Framework GIT REP MAIN + +Documents : [ROBOTIS Framework WIKI](https://github.com/ROBOTIS-GIT/ROBOTIS-Documents/wiki/ROBOTIS-ROS-Framework-Documents) From 5949f12e90df9dbc102894c0dd6e0cc53c6f78ff Mon Sep 17 00:00:00 2001 From: Pyo Date: Wed, 9 Aug 2017 15:31:48 +0900 Subject: [PATCH 07/37] updated the CHANGELOG and version to release binary packages --- LICENSE | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/LICENSE b/LICENSE index 5298325..8954985 100755 --- a/LICENSE +++ b/LICENSE @@ -1,8 +1,8 @@ Software License Agreement (BSD License) - -Copyright (c) 2014, ROBOTIS Inc. + +Copyright (c) 2014-2017, ROBOTIS CO., LTD. All rights reserved. - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright @@ -13,7 +13,7 @@ modification, are permitted provided that the following conditions are met: * Neither the name of ROBOTIS nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY ROBOTIS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. From 3c275dd05a60c3fdef4d1ea4c862b1dd4165d145 Mon Sep 17 00:00:00 2001 From: Yoonseok Pyo Date: Fri, 2 Mar 2018 16:39:43 +0900 Subject: [PATCH 08/37] Create .travis.yml --- .travis.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..ee670e4 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,35 @@ +# This config file for Travis CI utilizes ros-industrial/industrial_ci package. +# For more info for the package, see https://github.com/ros-industrial/industrial_ci/blob/master/README.rst + +dist: trusty +sudo: required +services: + - docker +language: generic +python: + - "2.7" +compiler: + - gcc +notifications: + email: + on_success: always + on_failure: always + recipients: + - pyo@robotis.com +env: + matrix: + - ROS_DISTRO="kinetic" ROS_REPOSITORY_PATH=http://packages.ros.org/ros/ubuntu USE_DEB=true + - ROS_DISTRO="kinetic" PRERELEASE=true PRERELEASE_DOWNSTREAM_DEPTH=0 +matrix: + allow_failures: + - env: ROS_DISTRO="kinetic" PRERELEASE=true PRERELEASE_DOWNSTREAM_DEPTH=0 +branches: + only: + - master + - develop + - kinetic-devel +install: + - git clone https://github.com/ros-industrial/industrial_ci.git .ci_config +script: + - source .ci_config/travis.sh + From c5e9cf9414279ae1d0cc5b52ee11d427e4a1fb85 Mon Sep 17 00:00:00 2001 From: Pyo Date: Thu, 15 Mar 2018 08:59:43 +0900 Subject: [PATCH 09/37] modified the LICENSE and package information for release --- .travis.yml | 11 +-- LICENSE | 221 ++++++++++++++++++++++++++++++++++++++++++++++------ README.md | 11 ++- 3 files changed, 210 insertions(+), 33 deletions(-) diff --git a/.travis.yml b/.travis.yml index ee670e4..1145575 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ # This config file for Travis CI utilizes ros-industrial/industrial_ci package. # For more info for the package, see https://github.com/ros-industrial/industrial_ci/blob/master/README.rst -dist: trusty sudo: required +dist: trusty services: - docker language: generic @@ -18,11 +18,8 @@ notifications: - pyo@robotis.com env: matrix: - - ROS_DISTRO="kinetic" ROS_REPOSITORY_PATH=http://packages.ros.org/ros/ubuntu USE_DEB=true - - ROS_DISTRO="kinetic" PRERELEASE=true PRERELEASE_DOWNSTREAM_DEPTH=0 -matrix: - allow_failures: - - env: ROS_DISTRO="kinetic" PRERELEASE=true PRERELEASE_DOWNSTREAM_DEPTH=0 + - ROS_DISTRO=kinetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=debian +# - ROS_DISTRO=kinetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=debian OS_NAME=debian OS_CODE_NAME=jessie branches: only: - master @@ -32,4 +29,4 @@ install: - git clone https://github.com/ros-industrial/industrial_ci.git .ci_config script: - source .ci_config/travis.sh - + \ No newline at end of file diff --git a/LICENSE b/LICENSE index 8954985..c0ee812 100755 --- a/LICENSE +++ b/LICENSE @@ -1,26 +1,201 @@ -Software License Agreement (BSD License) + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ -Copyright (c) 2014-2017, ROBOTIS CO., LTD. -All rights reserved. + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of ROBOTIS nor the names of its contributors may be - used to endorse or promote products derived from this software - without specific prior written permission. + 1. Definitions. -THIS SOFTWARE IS PROVIDED BY ROBOTIS "AS IS" AND ANY EXPRESS OR IMPLIED -WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL ROBOTIS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md index 02d6b48..8c6b748 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,9 @@ -# ROBOTIS-Framework -ROBOTIS Framework GIT REP MAIN +# robotis_framework -Documents : [ROBOTIS Framework WIKI](https://github.com/ROBOTIS-GIT/ROBOTIS-Documents/wiki/ROBOTIS-ROS-Framework-Documents) +[![GitHub version](https://badge.fury.io/gh/ROBOTIS-GIT%2FROBOTIS-Framework.svg)](https://badge.fury.io/gh/ROBOTIS-GIT%2FROBOTIS-Framework) [![Build Status](https://travis-ci.org/ROBOTIS-GIT/ROBOTIS-Framework.svg?branch=master)](https://travis-ci.org/ROBOTIS-GIT/ROBOTIS-Framework) + +ROS packages for the robotis_framework (meta package) + +# Documents +- ROS Wiki: http://wiki.ros.org/robotis_framework +- ROBOTIS e-Manual: http://emanual.robotis.com/docs/en/software/robotis_framework_packages/ From 2eb879eb3588b17f254dbce1cac6fe2705c940ba Mon Sep 17 00:00:00 2001 From: Pyo Date: Tue, 20 Mar 2018 16:53:01 +0900 Subject: [PATCH 10/37] tested for system dependencies --- .travis.yml | 2 +- README.md | 21 +++++++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1145575..68240e5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ compiler: - gcc notifications: email: - on_success: always + on_success: change on_failure: always recipients: - pyo@robotis.com diff --git a/README.md b/README.md index 8c6b748..c40af91 100755 --- a/README.md +++ b/README.md @@ -1,9 +1,18 @@ -# robotis_framework - +# ROBOTIS Framework Metapackage [![GitHub version](https://badge.fury.io/gh/ROBOTIS-GIT%2FROBOTIS-Framework.svg)](https://badge.fury.io/gh/ROBOTIS-GIT%2FROBOTIS-Framework) [![Build Status](https://travis-ci.org/ROBOTIS-GIT/ROBOTIS-Framework.svg?branch=master)](https://travis-ci.org/ROBOTIS-GIT/ROBOTIS-Framework) -ROS packages for the robotis_framework (meta package) +# Documents for robotis_framework packages +- [ROBOTIS e-Manual](http://emanual.robotis.com/docs/en/software/robotis_framework_packages/#robotis-framework) +- http://wiki.ros.org/robotis_framework +- http://wiki.ros.org/robotis_controller +- http://wiki.ros.org/robotis_device +- http://wiki.ros.org/robotis_framework_common -# Documents -- ROS Wiki: http://wiki.ros.org/robotis_framework -- ROBOTIS e-Manual: http://emanual.robotis.com/docs/en/software/robotis_framework_packages/ +# ROS packages related to ROBOTIS Framework +- [dynamixel_sdk](https://github.com/ROBOTIS-GIT/DynamixelSDK) +- [robotis_framework](https://github.com/ROBOTIS-GIT/ROBOTIS-Framework) +- [robotis_controller_msgs](https://github.com/ROBOTIS-GIT/ROBOTIS-Framework-msgs) + +# Documents and Videos for ROBOTIS Framework +- [ROBOTIS e-Manual for Dynamixel SDK](http://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_sdk/overview/) +- [ROBOTIS e-Manual for ROBOTIS Framework](http://emanual.robotis.com/docs/en/software/robotis_framework_packages/) \ No newline at end of file From 3ba9d9f85d98b3a4de742de03cde06fe85608424 Mon Sep 17 00:00:00 2001 From: Pyo Date: Thu, 22 Mar 2018 15:06:09 +0900 Subject: [PATCH 11/37] updated the CHANGELOG and version to release binary packages --- README.md | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index c40af91..fc06982 100755 --- a/README.md +++ b/README.md @@ -1,18 +1,22 @@ -# ROBOTIS Framework Metapackage -[![GitHub version](https://badge.fury.io/gh/ROBOTIS-GIT%2FROBOTIS-Framework.svg)](https://badge.fury.io/gh/ROBOTIS-GIT%2FROBOTIS-Framework) [![Build Status](https://travis-ci.org/ROBOTIS-GIT/ROBOTIS-Framework.svg?branch=master)](https://travis-ci.org/ROBOTIS-GIT/ROBOTIS-Framework) +## ROS Packages for ROBOTIS Framework +|Version|Kinetic + Ubuntu Xenial|Melodic + Ubuntu Bionic| +|:---:|:---:|:---:| +|[![GitHub version](https://badge.fury.io/gh/ROBOTIS-GIT%2FROBOTIS-Framework.svg)](https://badge.fury.io/gh/ROBOTIS-GIT%2FROBOTIS-Framework)|[![Build Status](https://travis-ci.org/ROBOTIS-GIT/ROBOTIS-Framework.svg?branch=master)](https://travis-ci.org/ROBOTIS-GIT/ROBOTIS-Framework)|-| -# Documents for robotis_framework packages -- [ROBOTIS e-Manual](http://emanual.robotis.com/docs/en/software/robotis_framework_packages/#robotis-framework) -- http://wiki.ros.org/robotis_framework +## ROBOTIS e-Manual for ROBOTIS Framework +- [ROBOTIS e-Manual for ROBOTIS Framework](http://emanual.robotis.com/docs/en/software/robotis_framework_packages) + +## Wiki for robotis_framework Packages +- http://wiki.ros.org/robotis_framework (metapackage) - http://wiki.ros.org/robotis_controller - http://wiki.ros.org/robotis_device - http://wiki.ros.org/robotis_framework_common -# ROS packages related to ROBOTIS Framework -- [dynamixel_sdk](https://github.com/ROBOTIS-GIT/DynamixelSDK) +## Open Source related to ROBOTIS Framework - [robotis_framework](https://github.com/ROBOTIS-GIT/ROBOTIS-Framework) - [robotis_controller_msgs](https://github.com/ROBOTIS-GIT/ROBOTIS-Framework-msgs) +- [dynamixel_sdk](https://github.com/ROBOTIS-GIT/DynamixelSDK) -# Documents and Videos for ROBOTIS Framework -- [ROBOTIS e-Manual for Dynamixel SDK](http://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_sdk/overview/) -- [ROBOTIS e-Manual for ROBOTIS Framework](http://emanual.robotis.com/docs/en/software/robotis_framework_packages/) \ No newline at end of file +## Documents and Videos related to ROBOTIS Framework +- [ROBOTIS e-Manual for ROBOTIS Framework](http://emanual.robotis.com/docs/en/software/robotis_framework_packages/) +- [ROBOTIS e-Manual for Dynamixel SDK](http://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_sdk/overview/) \ No newline at end of file From 24cdd3fafd6d8a807257af394e6e21fd91cafe96 Mon Sep 17 00:00:00 2001 From: Pyo Date: Thu, 22 Mar 2018 15:50:12 +0900 Subject: [PATCH 12/37] added travis option to test using source --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 68240e5..0532d36 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,8 +18,9 @@ notifications: - pyo@robotis.com env: matrix: - - ROS_DISTRO=kinetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=debian +# - ROS_DISTRO=kinetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=debian # - ROS_DISTRO=kinetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=debian OS_NAME=debian OS_CODE_NAME=jessie + - ROS_DISTRO=kinetic ROS_REPO=ros UPSTREAM_WORKSPACE=file OS_NAME=debian OS_CODE_NAME=jessie $ROSINSTALL_FILENAME=".robotis_framework.rosinstall" branches: only: - master From 850c1f882c9ab89f540b19c07168e46deef4e54b Mon Sep 17 00:00:00 2001 From: Pyo Date: Thu, 22 Mar 2018 16:43:00 +0900 Subject: [PATCH 13/37] Update .travis.yml --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0532d36..a101867 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,9 +18,9 @@ notifications: - pyo@robotis.com env: matrix: -# - ROS_DISTRO=kinetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=debian + - ROS_DISTRO=kinetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=debian # - ROS_DISTRO=kinetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=debian OS_NAME=debian OS_CODE_NAME=jessie - - ROS_DISTRO=kinetic ROS_REPO=ros UPSTREAM_WORKSPACE=file OS_NAME=debian OS_CODE_NAME=jessie $ROSINSTALL_FILENAME=".robotis_framework.rosinstall" +# - ROS_DISTRO=kinetic ROS_REPO=ros UPSTREAM_WORKSPACE=file OS_NAME=debian OS_CODE_NAME=jessie $ROSINSTALL_FILENAME=".robotis_framework.rosinstall" branches: only: - master @@ -30,4 +30,4 @@ install: - git clone https://github.com/ros-industrial/industrial_ci.git .ci_config script: - source .ci_config/travis.sh - \ No newline at end of file + From 8325af31124741a68e097f41f8c661b94d47e450 Mon Sep 17 00:00:00 2001 From: Kayman Date: Thu, 19 Jul 2018 15:54:37 +0900 Subject: [PATCH 14/37] Update .travis.yml --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index a101867..53f5d3e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,9 +18,9 @@ notifications: - pyo@robotis.com env: matrix: - - ROS_DISTRO=kinetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=debian +# - ROS_DISTRO=kinetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=debian # - ROS_DISTRO=kinetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=debian OS_NAME=debian OS_CODE_NAME=jessie -# - ROS_DISTRO=kinetic ROS_REPO=ros UPSTREAM_WORKSPACE=file OS_NAME=debian OS_CODE_NAME=jessie $ROSINSTALL_FILENAME=".robotis_framework.rosinstall" + - ROS_DISTRO=kinetic ROS_REPO=ros UPSTREAM_WORKSPACE=file OS_NAME=debian OS_CODE_NAME=jessie $ROSINSTALL_FILENAME=".robotis_framework.rosinstall" branches: only: - master From 7ed03c668e1314bb516b44eb7ee5b977973b2280 Mon Sep 17 00:00:00 2001 From: Kayman Date: Thu, 19 Jul 2018 18:29:40 +0900 Subject: [PATCH 15/37] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 53f5d3e..695ee46 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,7 @@ env: matrix: # - ROS_DISTRO=kinetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=debian # - ROS_DISTRO=kinetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=debian OS_NAME=debian OS_CODE_NAME=jessie - - ROS_DISTRO=kinetic ROS_REPO=ros UPSTREAM_WORKSPACE=file OS_NAME=debian OS_CODE_NAME=jessie $ROSINSTALL_FILENAME=".robotis_framework.rosinstall" + - ROS_DISTRO=kinetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=file OS_NAME=ubuntu OS_CODE_NAME=xenial $ROSINSTALL_FILENAME=".robotis_framework.rosinstall" branches: only: - master From 95c35503afbbd0f8dad266801683f6f8f495fa57 Mon Sep 17 00:00:00 2001 From: RonaldsonBellande Date: Fri, 13 May 2022 11:46:53 -0400 Subject: [PATCH 16/37] travis and rosinstall --- .travis.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 695ee46..9696b6b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ services: - docker language: generic python: - - "2.7" + - "3.8" compiler: - gcc notifications: @@ -15,17 +15,14 @@ notifications: on_success: change on_failure: always recipients: - - pyo@robotis.com + - ronaldsonbellande@gmail.com env: matrix: -# - ROS_DISTRO=kinetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=debian -# - ROS_DISTRO=kinetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=debian OS_NAME=debian OS_CODE_NAME=jessie - - ROS_DISTRO=kinetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=file OS_NAME=ubuntu OS_CODE_NAME=xenial $ROSINSTALL_FILENAME=".robotis_framework.rosinstall" + - ROS_DISTRO=noetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=file OS_NAME=ubuntu OS_CODE_NAME=focal $ROSINSTALL_FILENAME=".robotis_framework.rosinstall" branches: only: - master - - develop - - kinetic-devel + - noetic install: - git clone https://github.com/ros-industrial/industrial_ci.git .ci_config script: From bbf8ea871e0d7c704bf98801d16d7ff023b5888d Mon Sep 17 00:00:00 2001 From: Ronaldson Bellande <47253433+RonaldsonBellande@users.noreply.github.com> Date: Sun, 15 May 2022 16:41:00 -0400 Subject: [PATCH 17/37] Create cmake.yml --- .github/workflows/cmake.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/cmake.yml diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml new file mode 100644 index 0000000..97f7fe7 --- /dev/null +++ b/.github/workflows/cmake.yml @@ -0,0 +1,37 @@ +name: CMake + +on: + push: + branches: [ noetic ] + pull_request: + branches: [ noetic ] + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + +jobs: + build: + # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. + # You can convert this to a matrix build if you need cross-platform coverage. + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + + - name: Build + # Build your program with the given configuration + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + + - name: Test + working-directory: ${{github.workspace}}/build + # Execute tests defined by the CMake configuration. + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + run: ctest -C ${{env.BUILD_TYPE}} + From b2ca15d8fe31f91c6d0493894600bc4ad1302a3a Mon Sep 17 00:00:00 2001 From: Ronaldson Bellande <47253433+RonaldsonBellande@users.noreply.github.com> Date: Sun, 15 May 2022 16:41:34 -0400 Subject: [PATCH 18/37] Create docker-publish.yml --- .github/workflows/docker-publish.yml | 93 ++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 .github/workflows/docker-publish.yml diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000..b33bae0 --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,93 @@ +name: Docker + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +on: + schedule: + - cron: '15 20 * * *' + push: + branches: [ noetic ] + # Publish semver tags as releases. + tags: [ 'v*.*.*' ] + pull_request: + branches: [ noetic ] + +env: + # Use docker.io for Docker Hub if empty + REGISTRY: ghcr.io + # github.repository as / + IMAGE_NAME: ${{ github.repository }} + + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + # This is used to complete the identity challenge + # with sigstore/fulcio when running outside of PRs. + id-token: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # Install the cosign tool except on PR + # https://github.com/sigstore/cosign-installer + - name: Install cosign + if: github.event_name != 'pull_request' + uses: sigstore/cosign-installer@d6a3abf1bdea83574e28d40543793018b6035605 + with: + cosign-release: 'v1.7.1' + + + # Workaround: https://github.com/docker/build-push-action/issues/461 + - name: Setup Docker buildx + uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf + + # Login against a Docker registry except on PR + # https://github.com/docker/login-action + - name: Log into registry ${{ env.REGISTRY }} + if: github.event_name != 'pull_request' + uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # Extract metadata (tags, labels) for Docker + # https://github.com/docker/metadata-action + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + # Build and push Docker image with Buildx (don't push on PR) + # https://github.com/docker/build-push-action + - name: Build and push Docker image + id: build-and-push + uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + # Sign the resulting Docker image digest except on PRs. + # This will only write to the public Rekor transparency log when the Docker + # repository is public to avoid leaking data. If you would like to publish + # transparency data even for private images, pass --force to cosign below. + # https://github.com/sigstore/cosign + - name: Sign the published Docker image + if: ${{ github.event_name != 'pull_request' }} + env: + COSIGN_EXPERIMENTAL: "true" + # This step uses the identity token to provision an ephemeral certificate + # against the sigstore community Fulcio instance. + run: cosign sign ${{ steps.meta.outputs.tags }}@${{ steps.build-and-push.outputs.digest }} From 61bc7ceb3b17489ed981a55d290cf9c8c8df15b9 Mon Sep 17 00:00:00 2001 From: Ronaldson Bellande <47253433+RonaldsonBellande@users.noreply.github.com> Date: Tue, 14 Jun 2022 03:34:16 -0400 Subject: [PATCH 19/37] Create docker-image.yml --- .github/workflows/docker-image.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..acdd5fa --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,18 @@ +name: Docker Image CI + +on: + push: + branches: [ "noetic" ] + pull_request: + branches: [ "noetic" ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Build the Docker image + run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) From 8de1a6a85c8b027083d409781b153456a231eefa Mon Sep 17 00:00:00 2001 From: Ronaldson Bellande <47253433+RonaldsonBellande@users.noreply.github.com> Date: Thu, 4 Aug 2022 05:38:18 -0400 Subject: [PATCH 20/37] Update cmake.yml --- .github/workflows/cmake.yml | 71 ++++++++++++++++++++++++++----------- 1 file changed, 50 insertions(+), 21 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 97f7fe7..31edac6 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -2,36 +2,65 @@ name: CMake on: push: - branches: [ noetic ] + branches: [ master ] pull_request: - branches: [ noetic ] + branches: [ master ] env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) BUILD_TYPE: Release jobs: build: - # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. - # You can convert this to a matrix build if you need cross-platform coverage. - # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix runs-on: ubuntu-latest - steps: - uses: actions/checkout@v3 - - name: Configure CMake - # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. - # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} - - - name: Build - # Build your program with the given configuration - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - - - name: Test - working-directory: ${{github.workspace}}/build - # Execute tests defined by the CMake configuration. - # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - run: ctest -C ${{env.BUILD_TYPE}} + - name: Configure CMake 1 + run: cmake -E make_directory ${{runner.workspace}}/robotis_controller/build + - name: Configure CMake 2 + run: cmake -E make_directory ${{runner.workspace}}/robotis_device/build + + - name: Configure CMake 3 + run: cmake -E make_directory ${{runner.workspace}}/robotis_framework/build + + - name: Configure CMake 4 + run: cmake -E make_directory ${{runner.workspace}}/robotis_framework_common/build + + + + - name: Install dependencies + shell: bash + run: sudo apt-get update ; sudo apt-get install Date: Wed, 27 Sep 2023 09:45:50 -0400 Subject: [PATCH 21/37] latest pushes --- .github/workflows/cmake.yml | 67 +++++---------- docker/Dockerfile | 73 ++++++++++++++++ docker/gpu.Dockerfile | 90 ++++++++++++++++++++ requirements/requirements.txt | 39 +++++++++ requirements/ros_repository_requirements.txt | 9 ++ requirements/ros_requirements.txt | 15 ++++ requirements/system_requirements.txt | 29 +++++++ 7 files changed, 274 insertions(+), 48 deletions(-) create mode 100644 docker/Dockerfile create mode 100644 docker/gpu.Dockerfile create mode 100644 requirements/requirements.txt create mode 100644 requirements/ros_repository_requirements.txt create mode 100644 requirements/ros_requirements.txt create mode 100644 requirements/system_requirements.txt diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 31edac6..97f7fe7 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -2,65 +2,36 @@ name: CMake on: push: - branches: [ master ] + branches: [ noetic ] pull_request: - branches: [ master ] + branches: [ noetic ] env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) BUILD_TYPE: Release jobs: build: + # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. + # You can convert this to a matrix build if you need cross-platform coverage. + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix runs-on: ubuntu-latest + steps: - uses: actions/checkout@v3 - - name: Configure CMake 1 - run: cmake -E make_directory ${{runner.workspace}}/robotis_controller/build - - - name: Configure CMake 2 - run: cmake -E make_directory ${{runner.workspace}}/robotis_device/build - - - name: Configure CMake 3 - run: cmake -E make_directory ${{runner.workspace}}/robotis_framework/build - - - name: Configure CMake 4 - run: cmake -E make_directory ${{runner.workspace}}/robotis_framework_common/build - - - - - name: Install dependencies - shell: bash - run: sudo apt-get update ; sudo apt-get install > ~/.bashrc +RUN source ~/.bashrc + +RUN cd $CATKIN_WS \ + && rosdep init \ + && rosdep update \ + && rosdep update --rosdistro noetic \ + && rosdep fix-permissions \ + && rosdep install -y --from-paths . --ignore-src --rosdistro noetic + +# Always source catkin_setup.sh when launching bash +RUN echo "source /usr/local/bin/catkin_setup.sh" >> /root/.bashrc +COPY catkin_setup.sh /usr/local/bin/catkin_setup.sh +RUN chmod +x /usr/local/bin/catkin_setup.sh + +ENTRYPOINT ["/usr/local/bin/catkin_setup.sh"] +CMD ["bash"] diff --git a/docker/gpu.Dockerfile b/docker/gpu.Dockerfile new file mode 100644 index 0000000..df15614 --- /dev/null +++ b/docker/gpu.Dockerfile @@ -0,0 +1,90 @@ +ARG ROS_ARCHITECTURE_VERSION=latest + +FROM ubuntu:20.04 as base_build +FROM nvidia/cuda:11.2.1-base-ubuntu20.04 + +ENV DEBIAN_FRONTEND noninteractive +ENV PYTHON_VERSION="3.8" +ENV CUDNN_VERSION=8.1.0.77 +ENV TF_TENSORRT_VERSION=7.2.2 +ENV CUDA=11.2 +ENV LD_LIBRARY_PATH /usr/local/cuda/extras/CUPTI/lib64:$LD_LIBRARY_PATH + +ARG ROS_ARCHITECTURE_VERSION_GIT_BRANCH=master +ARG ROS_ARCHITECTURE_VERSION_GIT_COMMIT=HEAD + +LABEL maintainer=ronaldsonbellande@gmail.com +LABEL ROS_architecture_github_branchtag=${ROS_ARCHITECTURE_VERSION_GIT_BRANCH} +LABEL ROS_architecture_github_commit=${ROS_ARCHITECTURE_VERSION_GIT_COMMIT} + +# Ubuntu setup +RUN apt-get update -y +RUN apt-get upgrade -y + +# RUN workspace and sourcing +WORKDIR ./ +COPY requirements.txt . +COPY system_requirements.txt . +COPY ros_requirements.txt . +COPY ros_repository_requirements.txt . + +# Install dependencies for system +RUN apt-get update && apt-get install -y --no-install-recommends > ~/.bashrc +RUN source ~/.bashrc + +RUN cd $CATKIN_WS \ + && rosdep init \ + && rosdep update \ + && rosdep update --rosdistro noetic \ + && rosdep fix-permissions \ + && rosdep install -y --from-paths . --ignore-src --rosdistro noetic + +# Always source catkin_setup.sh when launching bash +RUN echo "source /usr/local/bin/catkin_setup.sh" >> /root/.bashrc +COPY catkin_setup.sh /usr/local/bin/catkin_setup.sh +RUN chmod +x /usr/local/bin/catkin_setup.sh + +ENTRYPOINT ["/usr/local/bin/catkin_setup.sh"] +CMD ["bash"] + +RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub && \ + apt-get update && apt-get install -y --no-install-recommends \ + cuda-nvrtc-${CUDA/./-} \ + libcudnn8=${CUDNN_VERSION}-1+cuda${CUDA} \ + -r cuda_requirements.txt + +# We don't install libnvinfer-dev since we don't need to build against TensorRT +RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu2004/x86_64/7fa2af80.pub && \ + echo "deb https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu2004/x86_64 /" > /etc/apt/sources.list.d/tensorRT.list && \ + apt-get update && \ + apt-get install -y --no-install-recommends libnvinfer7=${TF_TENSORRT_VERSION}-1+cuda11.0 \ + libnvinfer-plugin7=${TF_TENSORRT_VERSION}-1+cuda11.0 \ + && apt-get clean && \ + rm -rf /var/lib/apt/lists/*; + diff --git a/requirements/requirements.txt b/requirements/requirements.txt new file mode 100644 index 0000000..d08c640 --- /dev/null +++ b/requirements/requirements.txt @@ -0,0 +1,39 @@ +# Recomandation for library to install in python + +setuptools +pandas +scipy +sklearn +future +grpcio +h5py +requests +opencv-python +python-math +random2 +pytest-warnings +os.path2 +pydicom +glob2 +pytest-shutil +DateTime +zipfile36 +urllib3 +python-time +trimesh +librosa +gym +matplotlib +image-slicer +nvidia-ml-py3 +imgaug +tqdm +rosdep + +protobuf==3.15.2 +numpy==1.19.2 +numba==0.55.2 +imageio==2.9.0 +pillow==7.2.0 +tensorflow==2.7.0 +keras==2.7.0 diff --git a/requirements/ros_repository_requirements.txt b/requirements/ros_repository_requirements.txt new file mode 100644 index 0000000..09c4578 --- /dev/null +++ b/requirements/ros_repository_requirements.txt @@ -0,0 +1,9 @@ +git clone -b https://github.com/Robotics-Sensors/ROBOTIS-OP3-msgs +git clone -b https://github.com/Robotics-Sensors/ROBOTIS-OP3 +git clone -b https://github.com/Robotics-Sensors/ROBOTIS-OP3-Tools +git clone -b https://github.com/Robotics-Sensors/ROBOTIS-Framework-msgs +git clone -b https://github.com/Robotics-Sensors/ROBOTIS-Framework +git clone -b https://github.com/Robotics-Sensors/ROBOTIS-OP3-Common +git clone -b https://github.com/Robotics-Sensors/ROBOTIS-Utility +git clone -b https://github.com/Robotics-Sensors/ROBOTIS-OP3-Demo +git clone -b https://github.com/Robotics-Sensors/ROBOTIS-Math diff --git a/requirements/ros_requirements.txt b/requirements/ros_requirements.txt new file mode 100644 index 0000000..7b80df2 --- /dev/null +++ b/requirements/ros_requirements.txt @@ -0,0 +1,15 @@ +# Recomandation for dependencies for ros system + +ros-noetic-desktop-full +build-essential +ros-noetic-catkin +python-rosdep +python-rosinstall +python-rosinstall-generator +python-wstool +python-catkin-tools +ros-noetic-pcl-ros +ros-noetic-flexbe-behavior-engine +ros-noetic-moveit +ros-noetic-gazebo-ros-pkgs +ros-noetic-gazebo-ros-control diff --git a/requirements/system_requirements.txt b/requirements/system_requirements.txt new file mode 100644 index 0000000..46eea93 --- /dev/null +++ b/requirements/system_requirements.txt @@ -0,0 +1,29 @@ +# Recomandation for dependencies for linux system + +software-properties-common +python3.8 +neovim +apt-utils +automake +build-essential +ca-certificates +pycurl +git +python3-pip +libcurl3-dev +libfreetype6-dev +libpng-dev +libtool +libzmq3-dev +mlocate +openjdk-8-jdk +openjdk-8-jre-headless +pkg-config +python-dev +software-properties-common +swig +unzip +wget +zip +zlib1g-dev +python3-distutils From f98c64dda1bc30ff2e7a80c6316ce4ba5e1ee9c0 Mon Sep 17 00:00:00 2001 From: RonaldsonBellande Date: Wed, 27 Sep 2023 16:21:00 -0400 Subject: [PATCH 22/37] latest pushes --- README.md | 33 +++++++++----------- requirements/ros_repository_requirements.txt | 10 +++--- 2 files changed, 20 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index fc06982..60424a7 100755 --- a/README.md +++ b/README.md @@ -1,22 +1,19 @@ -## ROS Packages for ROBOTIS Framework -|Version|Kinetic + Ubuntu Xenial|Melodic + Ubuntu Bionic| -|:---:|:---:|:---:| -|[![GitHub version](https://badge.fury.io/gh/ROBOTIS-GIT%2FROBOTIS-Framework.svg)](https://badge.fury.io/gh/ROBOTIS-GIT%2FROBOTIS-Framework)|[![Build Status](https://travis-ci.org/ROBOTIS-GIT/ROBOTIS-Framework.svg?branch=master)](https://travis-ci.org/ROBOTIS-GIT/ROBOTIS-Framework)|-| +# ROS/ROS2 Humanoid Robot Framework -## ROBOTIS e-Manual for ROBOTIS Framework -- [ROBOTIS e-Manual for ROBOTIS Framework](http://emanual.robotis.com/docs/en/software/robotis_framework_packages) +-------------------------------------------------------------------------------------------------------- +Updated Version [humanoid_robot_module](https://github.com/Robotics-Sensors/humanoid_robot_framework) readme. -## Wiki for robotis_framework Packages -- http://wiki.ros.org/robotis_framework (metapackage) -- http://wiki.ros.org/robotis_controller -- http://wiki.ros.org/robotis_device -- http://wiki.ros.org/robotis_framework_common +-------------------------------------------------------------------------------------------------------- +## Important +The repository has diverged, as the old commits and codes are under the previous License and +the new commits and codes are under New License -## Open Source related to ROBOTIS Framework -- [robotis_framework](https://github.com/ROBOTIS-GIT/ROBOTIS-Framework) -- [robotis_controller_msgs](https://github.com/ROBOTIS-GIT/ROBOTIS-Framework-msgs) -- [dynamixel_sdk](https://github.com/ROBOTIS-GIT/DynamixelSDK) +-------------------------------------------------------------------------------------------------------- +Latest versions and Maintainer is on organization https://github.com/Robotics-Sensors -## Documents and Videos related to ROBOTIS Framework -- [ROBOTIS e-Manual for ROBOTIS Framework](http://emanual.robotis.com/docs/en/software/robotis_framework_packages/) -- [ROBOTIS e-Manual for Dynamixel SDK](http://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_sdk/overview/) \ No newline at end of file + +### Maintainer +* Ronaldson Bellande + +## License +This SDK is distributed under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0), see [LICENSE](https://github.com/Robotics-Sensors/humanoid_robot_framework/blob/main/LICENSE) and [NOTICE](https://github.com/Robotics-Sensors/humanoid_robot_framework/blob/main/LICENSE) for more information. diff --git a/requirements/ros_repository_requirements.txt b/requirements/ros_repository_requirements.txt index 09c4578..e3c338f 100644 --- a/requirements/ros_repository_requirements.txt +++ b/requirements/ros_repository_requirements.txt @@ -1,9 +1,9 @@ -git clone -b https://github.com/Robotics-Sensors/ROBOTIS-OP3-msgs -git clone -b https://github.com/Robotics-Sensors/ROBOTIS-OP3 -git clone -b https://github.com/Robotics-Sensors/ROBOTIS-OP3-Tools +git clone -b https://github.com/Robotics-Sensors/ROBOTIS-HUMANOID_ROBOT-msgs +git clone -b https://github.com/Robotics-Sensors/ROBOTIS-HUMANOID_ROBOT +git clone -b https://github.com/Robotics-Sensors/ROBOTIS-HUMANOID_ROBOT-Tools git clone -b https://github.com/Robotics-Sensors/ROBOTIS-Framework-msgs git clone -b https://github.com/Robotics-Sensors/ROBOTIS-Framework -git clone -b https://github.com/Robotics-Sensors/ROBOTIS-OP3-Common +git clone -b https://github.com/Robotics-Sensors/ROBOTIS-HUMANOID_ROBOT-Common git clone -b https://github.com/Robotics-Sensors/ROBOTIS-Utility -git clone -b https://github.com/Robotics-Sensors/ROBOTIS-OP3-Demo +git clone -b https://github.com/Robotics-Sensors/ROBOTIS-HUMANOID_ROBOT-Demo git clone -b https://github.com/Robotics-Sensors/ROBOTIS-Math From 8a49fccaf54dca10f25a0962691f359dabf51f88 Mon Sep 17 00:00:00 2001 From: RonaldsonBellande Date: Thu, 28 Sep 2023 00:16:47 -0400 Subject: [PATCH 23/37] latest pushes --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 60424a7..c91aa6b 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # ROS/ROS2 Humanoid Robot Framework -------------------------------------------------------------------------------------------------------- -Updated Version [humanoid_robot_module](https://github.com/Robotics-Sensors/humanoid_robot_framework) readme. +Updated Version [humanoid_robot_framework](https://github.com/Robotics-Sensors/humanoid_robot_framework) readme. -------------------------------------------------------------------------------------------------------- ## Important From 6007876bec667598e4aa3cc9a715a4da8e611325 Mon Sep 17 00:00:00 2001 From: RonaldsonBellande Date: Thu, 28 Sep 2023 09:50:36 -0400 Subject: [PATCH 24/37] latest pushes --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9696b6b..e1e689a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ notifications: - ronaldsonbellande@gmail.com env: matrix: - - ROS_DISTRO=noetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=file OS_NAME=ubuntu OS_CODE_NAME=focal $ROSINSTALL_FILENAME=".robotis_framework.rosinstall" + - ROS_DISTRO=noetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=file OS_NAME=ubuntu OS_CODE_NAME=focal $ROSINSTALL_FILENAME=".humanoid_robot_framework.rosinstall" branches: only: - master From 680112b0dae6edeea8c03be67e9f611f5f9eafa4 Mon Sep 17 00:00:00 2001 From: RonaldsonBellande Date: Thu, 28 Sep 2023 10:57:28 -0400 Subject: [PATCH 25/37] latest pushes --- .gitignore | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.gitignore b/.gitignore index 36a5c0a..a78ffcf 100755 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,13 @@ qtcreator-build *.backup *.user *.autosave + +# Scripts +init_setup.sh +repository_recal.sh +push.sh +publish.sh +ros_publish.sh +prerelease_test.sh +fix_errors.sh +replace_add_index.sh From 0a8fe2eb15452c5f9045bfcb861ab24d8e6fffa7 Mon Sep 17 00:00:00 2001 From: RonaldsonBellande Date: Thu, 28 Sep 2023 12:01:13 -0400 Subject: [PATCH 26/37] latest pushes --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index c91aa6b..fd1e2af 100755 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ -------------------------------------------------------------------------------------------------------- Updated Version [humanoid_robot_framework](https://github.com/Robotics-Sensors/humanoid_robot_framework) readme. +Old Version/Previous Used for Different Context [ROBOTIS-Framework](https://github.com/ROBOTIS-GIT/ROBOTIS-Framework) readme. + -------------------------------------------------------------------------------------------------------- ## Important The repository has diverged, as the old commits and codes are under the previous License and From d481e658d6566b9de216b5062dd37d0c60c7a2d4 Mon Sep 17 00:00:00 2001 From: RonaldsonBellande Date: Sat, 30 Sep 2023 16:51:48 -0400 Subject: [PATCH 27/37] latest pushes --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index fd1e2af..28df683 100755 --- a/README.md +++ b/README.md @@ -14,6 +14,11 @@ the new commits and codes are under New License Latest versions and Maintainer is on organization https://github.com/Robotics-Sensors +# USE CASE +-------------------------------------------------------------------------------------------------------- +* Every repository within our organization is a valuable resource that can be utilized for educational purposes by individuals who actively contribute to the repository or choose to become sponsors of the organization. For those who wish to use our services conversationally, the acquisition of a license and subscription from our company website is mandatory. This ensures that the services are appropriately compensated for their use. Additionally, for the 90% of services designated as private, acquiring a license and subscription can be facilitated through our company website. We encourage interested parties to visit our website to explore and procure the necessary licenses and subscriptions for the diverse range of services and products we offer. Your support and commitment enable us to maintain and enhance the quality of our offerings, contributing to a thriving collaborative environment. +-------------------------------------------------------------------------------------------------------- + ### Maintainer * Ronaldson Bellande From 1040083aaceaf90ca2489bf65c38df0aad63b771 Mon Sep 17 00:00:00 2001 From: Ronaldson Bellande <47253433+RonaldsonBellande@users.noreply.github.com> Date: Tue, 3 Oct 2023 09:04:27 -0400 Subject: [PATCH 28/37] Update LICENSE --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index c0ee812..ffeeac4 100755 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright {yyyy} {name of copyright owner} + Copyright 2023 Ronaldson Bellande Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From 742de0ea3280e63e71b52c05efcb0cc809eb9c37 Mon Sep 17 00:00:00 2001 From: Ronaldson Bellande <47253433+RonaldsonBellande@users.noreply.github.com> Date: Wed, 11 Oct 2023 11:43:46 -0400 Subject: [PATCH 29/37] Create jekyll-gh-pages.yml --- .github/workflows/jekyll-gh-pages.yml | 51 +++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/jekyll-gh-pages.yml diff --git a/.github/workflows/jekyll-gh-pages.yml b/.github/workflows/jekyll-gh-pages.yml new file mode 100644 index 0000000..559bddf --- /dev/null +++ b/.github/workflows/jekyll-gh-pages.yml @@ -0,0 +1,51 @@ +# Sample workflow for building and deploying a Jekyll site to GitHub Pages +name: Deploy Jekyll with GitHub Pages dependencies preinstalled + +on: + # Runs on pushes targeting the default branch + push: + branches: ["main"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Build job + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Pages + uses: actions/configure-pages@v3 + - name: Build with Jekyll + uses: actions/jekyll-build-pages@v1 + with: + source: ./ + destination: ./_site + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 From b0d8d4c926f84e8a1e8627aa531f139e1bd06182 Mon Sep 17 00:00:00 2001 From: Ronaldson Bellande <47253433+RonaldsonBellande@users.noreply.github.com> Date: Thu, 12 Oct 2023 17:47:20 -0400 Subject: [PATCH 30/37] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 28df683..a33ed5e 100755 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # ROS/ROS2 Humanoid Robot Framework +-------------------------------------------------------------------------------------------------------- +# Website +https://robotics-sensors.github.io/humanoid_robot_framework + -------------------------------------------------------------------------------------------------------- Updated Version [humanoid_robot_framework](https://github.com/Robotics-Sensors/humanoid_robot_framework) readme. From f026762b0f126bd30b9444a7d44c1ef18990479a Mon Sep 17 00:00:00 2001 From: Ronaldson Bellande <47253433+RonaldsonBellande@users.noreply.github.com> Date: Tue, 24 Oct 2023 08:55:08 -0400 Subject: [PATCH 31/37] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a33ed5e..0feb9f3 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,10 @@ # ROS/ROS2 Humanoid Robot Framework +[![Website](https://img.shields.io/badge/Visit%20our-Website-0099cc?style=for-the-badge)](https://robotics-sensors.github.io) +[![Discord](https://img.shields.io/badge/Join%20our-Discord-7289DA?logo=discord&style=for-the-badge)](https://discord.gg/Yc72nd4w) +[![Sponsor](https://img.shields.io/badge/Sponsor-Robotics%20Sensors%20Research-red?style=for-the-badge&logo=github)](https://github.com/sponsors/Robotics-Sensors) -------------------------------------------------------------------------------------------------------- -# Website +# Repository Website https://robotics-sensors.github.io/humanoid_robot_framework -------------------------------------------------------------------------------------------------------- From 8a8b9497300dbc6c904449edf326af741facda61 Mon Sep 17 00:00:00 2001 From: Ronaldson Bellande <47253433+RonaldsonBellande@users.noreply.github.com> Date: Thu, 2 Nov 2023 08:34:14 -0400 Subject: [PATCH 32/37] Create dependabot.yml --- .github/dependabot.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..ac6621f --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" From 438764c723c9483a9f63aeb9fe5b0bc0cf30896e Mon Sep 17 00:00:00 2001 From: Ronaldson Bellande <47253433+RonaldsonBellande@users.noreply.github.com> Date: Thu, 2 Nov 2023 08:34:22 -0400 Subject: [PATCH 33/37] Create codeql.yml --- .github/workflows/codeql.yml | 82 ++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..8b343fe --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,82 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ "main" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "main" ] + schedule: + - cron: '37 12 * * 4' + +jobs: + analyze: + name: Analyze + # Runner size impacts CodeQL analysis time. To learn more, please see: + # - https://gh.io/recommended-hardware-resources-for-running-codeql + # - https://gh.io/supported-runners-and-hardware-resources + # - https://gh.io/using-larger-runners + # Consider using larger runners for possible analysis time improvements. + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} + timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'c-cpp' ] + # CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ] + # Use only 'java-kotlin' to analyze code written in Java, Kotlin or both + # Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + + # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + + # If the Autobuild fails above, remove it and uncomment the following three lines. + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. + + # - run: | + # echo "Run, Build Application using script" + # ./location_of_script_within_repo/buildscript.sh + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{matrix.language}}" From d749a81e2340087f93441e8c87ddd1f8bac42434 Mon Sep 17 00:00:00 2001 From: Ronaldson Bellande <47253433+RonaldsonBellande@users.noreply.github.com> Date: Fri, 3 Nov 2023 13:27:21 -0400 Subject: [PATCH 34/37] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0feb9f3..be2980b 100755 --- a/README.md +++ b/README.md @@ -9,9 +9,11 @@ https://robotics-sensors.github.io/humanoid_robot_framework -------------------------------------------------------------------------------------------------------- Updated Version [humanoid_robot_framework](https://github.com/Robotics-Sensors/humanoid_robot_framework) readme. - Old Version/Previous Used for Different Context [ROBOTIS-Framework](https://github.com/ROBOTIS-GIT/ROBOTIS-Framework) readme. +# Contact +If you are interested in accessing the complete version of this repository, we kindly request that you reach out to the organization's director or the company behind this project. We invite you to explore the USE CASE to understand the specific terms and conditions for usage. To utilize this repository, it is imperative that you adhere to the guidelines outlined in the USE CASE. For those interested in showing their support, becoming a sponsor of the organization is an option, and detailed information can be found within the USE CASE and License documents. Furthermore, we encourage you to join our official Discord community, where you can engage with like-minded individuals, contribute to the project, and stay up-to-date with the latest developments. It's worth noting that while a fraction of research is publicly accessible, the majority remains private. To gain insights into the wealth of knowledge held by the Company or the organization's director, we recommend direct contact for more information. + -------------------------------------------------------------------------------------------------------- ## Important The repository has diverged, as the old commits and codes are under the previous License and From 79c80e965dbbb3dd411aae60982dd4675ac201c0 Mon Sep 17 00:00:00 2001 From: Ronaldson Bellande <47253433+RonaldsonBellande@users.noreply.github.com> Date: Sat, 4 Nov 2023 10:46:11 -0400 Subject: [PATCH 35/37] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index be2980b..b891c4f 100755 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Updated Version [humanoid_robot_framework](https://github.com/Robotics-Sensors/h Old Version/Previous Used for Different Context [ROBOTIS-Framework](https://github.com/ROBOTIS-GIT/ROBOTIS-Framework) readme. # Contact -If you are interested in accessing the complete version of this repository, we kindly request that you reach out to the organization's director or the company behind this project. We invite you to explore the USE CASE to understand the specific terms and conditions for usage. To utilize this repository, it is imperative that you adhere to the guidelines outlined in the USE CASE. For those interested in showing their support, becoming a sponsor of the organization is an option, and detailed information can be found within the USE CASE and License documents. Furthermore, we encourage you to join our official Discord community, where you can engage with like-minded individuals, contribute to the project, and stay up-to-date with the latest developments. It's worth noting that while a fraction of research is publicly accessible, the majority remains private. To gain insights into the wealth of knowledge held by the Company or the organization's director, we recommend direct contact for more information. +Depeding on the repository, If you are interested in accessing the complete version or other repository related to this repository, we kindly request that you reach out to the organization's director or the company behind this project. We invite you to explore the USE CASE to understand the specific terms and conditions for usage. To utilize this repository, it is imperative that you adhere to the guidelines outlined in the USE CASE. For those interested in showing their support, becoming a sponsor of the organization is an option, and detailed information can be found within the USE CASE and License documents. Furthermore, we encourage you to join our official Discord community, where you can engage with like-minded individuals, contribute to the project, and stay up-to-date with the latest developments. It's worth noting that while a fraction of research is publicly accessible, the majority remains private. To gain insights into the wealth of knowledge held by the Company or the organization's director, we recommend direct contact for more information. -------------------------------------------------------------------------------------------------------- ## Important From 9bfd17ca910af3dafd3635a42305845f48e09668 Mon Sep 17 00:00:00 2001 From: Ronaldson Bellande <47253433+RonaldsonBellande@users.noreply.github.com> Date: Sun, 5 Nov 2023 01:52:15 -0500 Subject: [PATCH 36/37] Update README.md --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index b891c4f..9968397 100755 --- a/README.md +++ b/README.md @@ -3,6 +3,19 @@ [![Website](https://img.shields.io/badge/Visit%20our-Website-0099cc?style=for-the-badge)](https://robotics-sensors.github.io) [![Discord](https://img.shields.io/badge/Join%20our-Discord-7289DA?logo=discord&style=for-the-badge)](https://discord.gg/Yc72nd4w) [![Sponsor](https://img.shields.io/badge/Sponsor-Robotics%20Sensors%20Research-red?style=for-the-badge&logo=github)](https://github.com/sponsors/Robotics-Sensors) + +# Stats +[![GitHub stars](https://img.shields.io/github/stars/Robotics-Sensors/humanoid_robot_framework.svg?style=social)](https://github.com/Robotics-Sensors/humanoid_robot_framework/stargazers) +[![GitHub forks](https://img.shields.io/github/forks/Robotics-Sensors/humanoid_robot_framework.svg?style=social)](https://github.com/Robotics-Sensors/humanoid_robot_framework/network) +[![GitHub watchers](https://img.shields.io/github/watchers/Robotics-Sensors/humanoid_robot_framework.svg?style=social)](https://github.com/Robotics-Sensors/humanoid_robot_framework/watchers) + +[![GitHub issues](https://img.shields.io/github/issues/Robotics-Sensors/humanoid_robot_framework.svg)](https://github.com/Robotics-Sensors/humanoid_robot_framework/issues) +[![GitHub pull requests](https://img.shields.io/github/issues-pr/Robotics-Sensors/humanoid_robot_framework.svg)](https://github.com/Robotics-Sensors/humanoid_robot_framework/pulls) +[![GitHub license](https://img.shields.io/github/license/Robotics-Sensors/humanoid_robot_framework.svg)](https://github.com/Robotics-Sensors/humanoid_robot_framework/blob/main/LICENSE) + +[![GitHub last commit](https://img.shields.io/github/last-commit/Robotics-Sensors/humanoid_robot_framework.svg)](https://github.com/Robotics-Sensors/humanoid_robot_framework/commits) +[![Visitor & Github Clones](https://img.shields.io/badge/dynamic/json?color=2e8b57&label=Visitor%20%26%20GitHub%20Clones&query=$.count&url=https://api.github.com/repos/Robotics-Sensors/humanoid_robot_framework/traffic)](https://github.com/Robotics-Sensors/humanoid_robot_framework) + -------------------------------------------------------------------------------------------------------- # Repository Website https://robotics-sensors.github.io/humanoid_robot_framework @@ -11,6 +24,9 @@ https://robotics-sensors.github.io/humanoid_robot_framework Updated Version [humanoid_robot_framework](https://github.com/Robotics-Sensors/humanoid_robot_framework) readme. Old Version/Previous Used for Different Context [ROBOTIS-Framework](https://github.com/ROBOTIS-GIT/ROBOTIS-Framework) readme. +# Release +[![Latest Release](https://img.shields.io/github/v/release/Robotics-Sensors/humanoid_robot_tools?style=for-the-badge&color=yellow)](https://github.com/Robotics-Sensors/humanoid_robot_framework/releases/) + # Contact Depeding on the repository, If you are interested in accessing the complete version or other repository related to this repository, we kindly request that you reach out to the organization's director or the company behind this project. We invite you to explore the USE CASE to understand the specific terms and conditions for usage. To utilize this repository, it is imperative that you adhere to the guidelines outlined in the USE CASE. For those interested in showing their support, becoming a sponsor of the organization is an option, and detailed information can be found within the USE CASE and License documents. Furthermore, we encourage you to join our official Discord community, where you can engage with like-minded individuals, contribute to the project, and stay up-to-date with the latest developments. It's worth noting that while a fraction of research is publicly accessible, the majority remains private. To gain insights into the wealth of knowledge held by the Company or the organization's director, we recommend direct contact for more information. From 31a4027b4298801bde48a11e7ca547a3950e67ff Mon Sep 17 00:00:00 2001 From: RonaldsonBellande Date: Mon, 13 Nov 2023 17:55:45 -0500 Subject: [PATCH 37/37] latest pushes --- .travis.yml | 2 +- README.md | 24 +- .../CHANGELOG.rst | 136 + .../CMakeLists.txt | 83 + ...t_intelligence_control_system_controller.h | 209 ++ .../package.xml | 81 + ...intelligence_control_system_controller.cpp | 2625 +++++++++++++++++ .../CHANGELOG.rst | 110 + .../CMakeLists.txt | 51 + .../devices/dynamixel/GRIPPER.device | 73 + .../devices/dynamixel/GRIPPER_TORQUE.device | 74 + .../devices/dynamixel/H42-20-S300-R(A).device | 92 + .../devices/dynamixel/H42-20-S300-R.device | 76 + .../devices/dynamixel/H42P-020-S300-R.device | 92 + .../dynamixel/H54-100-B210-R-NR.device | 76 + .../dynamixel/H54-100-S500-R(A).device | 92 + .../devices/dynamixel/H54-100-S500-R.device | 76 + .../devices/dynamixel/H54-200-B500-R.device | 76 + .../dynamixel/H54-200-S500-R(A).device | 92 + .../devices/dynamixel/H54-200-S500-R.device | 76 + .../devices/dynamixel/H54P-100-S500-R.device | 92 + .../devices/dynamixel/H54P-200-B500-R.device | 92 + .../devices/dynamixel/H54P-200-S500-R.device | 92 + .../devices/dynamixel/L42-10-S300-R.device | 73 + .../devices/dynamixel/L54-30-S400-R.device | 74 + .../devices/dynamixel/L54-30-S500-R.device | 74 + .../devices/dynamixel/L54-50-S290-R.device | 74 + .../devices/dynamixel/L54-50-S500-R.device | 74 + .../devices/dynamixel/M42-10-S260-R.device | 74 + .../devices/dynamixel/M54-40-S250-R.device | 74 + .../devices/dynamixel/M54-60-S250-R.device | 74 + .../devices/dynamixel/MX-106.device | 66 + .../devices/dynamixel/MX-28.device | 62 + .../devices/dynamixel/MX-64.device | 66 + .../devices/dynamixel/PH42-020-S300-R.device | 92 + .../devices/dynamixel/PH54-100-S500-R.device | 92 + .../devices/dynamixel/PH54-200-S500-R.device | 92 + .../devices/dynamixel/RH-P12-RN(A).device | 90 + .../devices/dynamixel/RH-P12-RN.device | 73 + .../devices/dynamixel/XM-430.device | 82 + .../devices/dynamixel/XM430-W210.device | 83 + .../devices/dynamixel/XM430-W350.device | 83 + .../devices/dynamixel/XM540-W150.device | 89 + .../devices/dynamixel/XM540-W270.device | 89 + .../devices/sensor/CM-740.device | 25 + .../devices/sensor/OPEN-CR.device | 30 + .../control_table_item.h | 54 + .../device.h | 54 + .../dynamixel.h | 83 + .../dynamixel_state.h | 82 + .../robot.h | 72 + .../sensor.h | 49 + .../sensor_state.h | 50 + .../time_stamp.h | 39 + .../package.xml | 38 + .../dynamixel.cpp | 119 + .../robot.cpp | 480 +++ .../sensor.cpp | 39 + .../CHANGELOG.rst | 89 + .../CMakeLists.txt | 12 + .../package.xml | 40 + .../CHANGELOG.rst | 82 + .../CMakeLists.txt | 46 + .../motion_module.h | 87 + .../sensor_module.h | 57 + .../singleton.h | 65 + .../package.xml | 33 + 67 files changed, 7854 insertions(+), 13 deletions(-) create mode 100755 humanoid_robot_intelligence_control_system_controller/CHANGELOG.rst create mode 100755 humanoid_robot_intelligence_control_system_controller/CMakeLists.txt create mode 100755 humanoid_robot_intelligence_control_system_controller/include/humanoid_robot_intelligence_control_system_controller/humanoid_robot_intelligence_control_system_controller.h create mode 100755 humanoid_robot_intelligence_control_system_controller/package.xml create mode 100755 humanoid_robot_intelligence_control_system_controller/src/humanoid_robot_intelligence_control_system_controller/humanoid_robot_intelligence_control_system_controller.cpp create mode 100755 humanoid_robot_intelligence_control_system_device/CHANGELOG.rst create mode 100755 humanoid_robot_intelligence_control_system_device/CMakeLists.txt create mode 100755 humanoid_robot_intelligence_control_system_device/devices/dynamixel/GRIPPER.device create mode 100755 humanoid_robot_intelligence_control_system_device/devices/dynamixel/GRIPPER_TORQUE.device create mode 100644 humanoid_robot_intelligence_control_system_device/devices/dynamixel/H42-20-S300-R(A).device create mode 100755 humanoid_robot_intelligence_control_system_device/devices/dynamixel/H42-20-S300-R.device create mode 100644 humanoid_robot_intelligence_control_system_device/devices/dynamixel/H42P-020-S300-R.device create mode 100755 humanoid_robot_intelligence_control_system_device/devices/dynamixel/H54-100-B210-R-NR.device create mode 100644 humanoid_robot_intelligence_control_system_device/devices/dynamixel/H54-100-S500-R(A).device create mode 100755 humanoid_robot_intelligence_control_system_device/devices/dynamixel/H54-100-S500-R.device create mode 100755 humanoid_robot_intelligence_control_system_device/devices/dynamixel/H54-200-B500-R.device create mode 100644 humanoid_robot_intelligence_control_system_device/devices/dynamixel/H54-200-S500-R(A).device create mode 100755 humanoid_robot_intelligence_control_system_device/devices/dynamixel/H54-200-S500-R.device create mode 100644 humanoid_robot_intelligence_control_system_device/devices/dynamixel/H54P-100-S500-R.device create mode 100644 humanoid_robot_intelligence_control_system_device/devices/dynamixel/H54P-200-B500-R.device create mode 100644 humanoid_robot_intelligence_control_system_device/devices/dynamixel/H54P-200-S500-R.device create mode 100755 humanoid_robot_intelligence_control_system_device/devices/dynamixel/L42-10-S300-R.device create mode 100755 humanoid_robot_intelligence_control_system_device/devices/dynamixel/L54-30-S400-R.device create mode 100755 humanoid_robot_intelligence_control_system_device/devices/dynamixel/L54-30-S500-R.device create mode 100755 humanoid_robot_intelligence_control_system_device/devices/dynamixel/L54-50-S290-R.device create mode 100755 humanoid_robot_intelligence_control_system_device/devices/dynamixel/L54-50-S500-R.device create mode 100755 humanoid_robot_intelligence_control_system_device/devices/dynamixel/M42-10-S260-R.device create mode 100755 humanoid_robot_intelligence_control_system_device/devices/dynamixel/M54-40-S250-R.device create mode 100755 humanoid_robot_intelligence_control_system_device/devices/dynamixel/M54-60-S250-R.device create mode 100755 humanoid_robot_intelligence_control_system_device/devices/dynamixel/MX-106.device create mode 100755 humanoid_robot_intelligence_control_system_device/devices/dynamixel/MX-28.device create mode 100755 humanoid_robot_intelligence_control_system_device/devices/dynamixel/MX-64.device create mode 100644 humanoid_robot_intelligence_control_system_device/devices/dynamixel/PH42-020-S300-R.device create mode 100644 humanoid_robot_intelligence_control_system_device/devices/dynamixel/PH54-100-S500-R.device create mode 100644 humanoid_robot_intelligence_control_system_device/devices/dynamixel/PH54-200-S500-R.device create mode 100644 humanoid_robot_intelligence_control_system_device/devices/dynamixel/RH-P12-RN(A).device create mode 100755 humanoid_robot_intelligence_control_system_device/devices/dynamixel/RH-P12-RN.device create mode 100755 humanoid_robot_intelligence_control_system_device/devices/dynamixel/XM-430.device create mode 100644 humanoid_robot_intelligence_control_system_device/devices/dynamixel/XM430-W210.device create mode 100644 humanoid_robot_intelligence_control_system_device/devices/dynamixel/XM430-W350.device create mode 100755 humanoid_robot_intelligence_control_system_device/devices/dynamixel/XM540-W150.device create mode 100755 humanoid_robot_intelligence_control_system_device/devices/dynamixel/XM540-W270.device create mode 100755 humanoid_robot_intelligence_control_system_device/devices/sensor/CM-740.device create mode 100755 humanoid_robot_intelligence_control_system_device/devices/sensor/OPEN-CR.device create mode 100755 humanoid_robot_intelligence_control_system_device/include/humanoid_robot_intelligence_control_system_device/control_table_item.h create mode 100755 humanoid_robot_intelligence_control_system_device/include/humanoid_robot_intelligence_control_system_device/device.h create mode 100755 humanoid_robot_intelligence_control_system_device/include/humanoid_robot_intelligence_control_system_device/dynamixel.h create mode 100755 humanoid_robot_intelligence_control_system_device/include/humanoid_robot_intelligence_control_system_device/dynamixel_state.h create mode 100755 humanoid_robot_intelligence_control_system_device/include/humanoid_robot_intelligence_control_system_device/robot.h create mode 100755 humanoid_robot_intelligence_control_system_device/include/humanoid_robot_intelligence_control_system_device/sensor.h create mode 100755 humanoid_robot_intelligence_control_system_device/include/humanoid_robot_intelligence_control_system_device/sensor_state.h create mode 100755 humanoid_robot_intelligence_control_system_device/include/humanoid_robot_intelligence_control_system_device/time_stamp.h create mode 100755 humanoid_robot_intelligence_control_system_device/package.xml create mode 100755 humanoid_robot_intelligence_control_system_device/src/humanoid_robot_intelligence_control_system_device/dynamixel.cpp create mode 100755 humanoid_robot_intelligence_control_system_device/src/humanoid_robot_intelligence_control_system_device/robot.cpp create mode 100755 humanoid_robot_intelligence_control_system_device/src/humanoid_robot_intelligence_control_system_device/sensor.cpp create mode 100755 humanoid_robot_intelligence_control_system_framework/CHANGELOG.rst create mode 100644 humanoid_robot_intelligence_control_system_framework/CMakeLists.txt create mode 100755 humanoid_robot_intelligence_control_system_framework/package.xml create mode 100755 humanoid_robot_intelligence_control_system_framework_common/CHANGELOG.rst create mode 100755 humanoid_robot_intelligence_control_system_framework_common/CMakeLists.txt create mode 100755 humanoid_robot_intelligence_control_system_framework_common/include/humanoid_robot_intelligence_control_system_framework_common/motion_module.h create mode 100755 humanoid_robot_intelligence_control_system_framework_common/include/humanoid_robot_intelligence_control_system_framework_common/sensor_module.h create mode 100755 humanoid_robot_intelligence_control_system_framework_common/include/humanoid_robot_intelligence_control_system_framework_common/singleton.h create mode 100755 humanoid_robot_intelligence_control_system_framework_common/package.xml diff --git a/.travis.yml b/.travis.yml index e1e689a..43bc280 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ notifications: - ronaldsonbellande@gmail.com env: matrix: - - ROS_DISTRO=noetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=file OS_NAME=ubuntu OS_CODE_NAME=focal $ROSINSTALL_FILENAME=".humanoid_robot_framework.rosinstall" + - ROS_DISTRO=noetic ROS_REPO=ros-shadow-fixed UPSTREAM_WORKSPACE=file OS_NAME=ubuntu OS_CODE_NAME=focal $ROSINSTALL_FILENAME=".humanoid_robot_intelligence_control_system_framework.rosinstall" branches: only: - master diff --git a/README.md b/README.md index 9968397..8b0d5d4 100755 --- a/README.md +++ b/README.md @@ -5,27 +5,27 @@ [![Sponsor](https://img.shields.io/badge/Sponsor-Robotics%20Sensors%20Research-red?style=for-the-badge&logo=github)](https://github.com/sponsors/Robotics-Sensors) # Stats -[![GitHub stars](https://img.shields.io/github/stars/Robotics-Sensors/humanoid_robot_framework.svg?style=social)](https://github.com/Robotics-Sensors/humanoid_robot_framework/stargazers) -[![GitHub forks](https://img.shields.io/github/forks/Robotics-Sensors/humanoid_robot_framework.svg?style=social)](https://github.com/Robotics-Sensors/humanoid_robot_framework/network) -[![GitHub watchers](https://img.shields.io/github/watchers/Robotics-Sensors/humanoid_robot_framework.svg?style=social)](https://github.com/Robotics-Sensors/humanoid_robot_framework/watchers) +[![GitHub stars](https://img.shields.io/github/stars/Robotics-Sensors/humanoid_robot_intelligence_control_system_framework.svg?style=social)](https://github.com/Robotics-Sensors/humanoid_robot_intelligence_control_system_framework/stargazers) +[![GitHub forks](https://img.shields.io/github/forks/Robotics-Sensors/humanoid_robot_intelligence_control_system_framework.svg?style=social)](https://github.com/Robotics-Sensors/humanoid_robot_intelligence_control_system_framework/network) +[![GitHub watchers](https://img.shields.io/github/watchers/Robotics-Sensors/humanoid_robot_intelligence_control_system_framework.svg?style=social)](https://github.com/Robotics-Sensors/humanoid_robot_intelligence_control_system_framework/watchers) -[![GitHub issues](https://img.shields.io/github/issues/Robotics-Sensors/humanoid_robot_framework.svg)](https://github.com/Robotics-Sensors/humanoid_robot_framework/issues) -[![GitHub pull requests](https://img.shields.io/github/issues-pr/Robotics-Sensors/humanoid_robot_framework.svg)](https://github.com/Robotics-Sensors/humanoid_robot_framework/pulls) -[![GitHub license](https://img.shields.io/github/license/Robotics-Sensors/humanoid_robot_framework.svg)](https://github.com/Robotics-Sensors/humanoid_robot_framework/blob/main/LICENSE) +[![GitHub issues](https://img.shields.io/github/issues/Robotics-Sensors/humanoid_robot_intelligence_control_system_framework.svg)](https://github.com/Robotics-Sensors/humanoid_robot_intelligence_control_system_framework/issues) +[![GitHub pull requests](https://img.shields.io/github/issues-pr/Robotics-Sensors/humanoid_robot_intelligence_control_system_framework.svg)](https://github.com/Robotics-Sensors/humanoid_robot_intelligence_control_system_framework/pulls) +[![GitHub license](https://img.shields.io/github/license/Robotics-Sensors/humanoid_robot_intelligence_control_system_framework.svg)](https://github.com/Robotics-Sensors/humanoid_robot_intelligence_control_system_framework/blob/main/LICENSE) -[![GitHub last commit](https://img.shields.io/github/last-commit/Robotics-Sensors/humanoid_robot_framework.svg)](https://github.com/Robotics-Sensors/humanoid_robot_framework/commits) -[![Visitor & Github Clones](https://img.shields.io/badge/dynamic/json?color=2e8b57&label=Visitor%20%26%20GitHub%20Clones&query=$.count&url=https://api.github.com/repos/Robotics-Sensors/humanoid_robot_framework/traffic)](https://github.com/Robotics-Sensors/humanoid_robot_framework) +[![GitHub last commit](https://img.shields.io/github/last-commit/Robotics-Sensors/humanoid_robot_intelligence_control_system_framework.svg)](https://github.com/Robotics-Sensors/humanoid_robot_intelligence_control_system_framework/commits) +[![Visitor & Github Clones](https://img.shields.io/badge/dynamic/json?color=2e8b57&label=Visitor%20%26%20GitHub%20Clones&query=$.count&url=https://api.github.com/repos/Robotics-Sensors/humanoid_robot_intelligence_control_system_framework/traffic)](https://github.com/Robotics-Sensors/humanoid_robot_intelligence_control_system_framework) -------------------------------------------------------------------------------------------------------- # Repository Website -https://robotics-sensors.github.io/humanoid_robot_framework +https://robotics-sensors.github.io/humanoid_robot_intelligence_control_system_framework -------------------------------------------------------------------------------------------------------- -Updated Version [humanoid_robot_framework](https://github.com/Robotics-Sensors/humanoid_robot_framework) readme. +Updated Version [humanoid_robot_intelligence_control_system_framework](https://github.com/Robotics-Sensors/humanoid_robot_intelligence_control_system_framework) readme. Old Version/Previous Used for Different Context [ROBOTIS-Framework](https://github.com/ROBOTIS-GIT/ROBOTIS-Framework) readme. # Release -[![Latest Release](https://img.shields.io/github/v/release/Robotics-Sensors/humanoid_robot_tools?style=for-the-badge&color=yellow)](https://github.com/Robotics-Sensors/humanoid_robot_framework/releases/) +[![Latest Release](https://img.shields.io/github/v/release/Robotics-Sensors/humanoid_robot_intelligence_control_system_tools?style=for-the-badge&color=yellow)](https://github.com/Robotics-Sensors/humanoid_robot_intelligence_control_system_framework/releases/) # Contact Depeding on the repository, If you are interested in accessing the complete version or other repository related to this repository, we kindly request that you reach out to the organization's director or the company behind this project. We invite you to explore the USE CASE to understand the specific terms and conditions for usage. To utilize this repository, it is imperative that you adhere to the guidelines outlined in the USE CASE. For those interested in showing their support, becoming a sponsor of the organization is an option, and detailed information can be found within the USE CASE and License documents. Furthermore, we encourage you to join our official Discord community, where you can engage with like-minded individuals, contribute to the project, and stay up-to-date with the latest developments. It's worth noting that while a fraction of research is publicly accessible, the majority remains private. To gain insights into the wealth of knowledge held by the Company or the organization's director, we recommend direct contact for more information. @@ -48,4 +48,4 @@ Latest versions and Maintainer is on organization https://github.com/Robotics-Se * Ronaldson Bellande ## License -This SDK is distributed under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0), see [LICENSE](https://github.com/Robotics-Sensors/humanoid_robot_framework/blob/main/LICENSE) and [NOTICE](https://github.com/Robotics-Sensors/humanoid_robot_framework/blob/main/LICENSE) for more information. +This SDK is distributed under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0), see [LICENSE](https://github.com/Robotics-Sensors/humanoid_robot_intelligence_control_system_framework/blob/main/LICENSE) and [NOTICE](https://github.com/Robotics-Sensors/humanoid_robot_intelligence_control_system_framework/blob/main/LICENSE) for more information. diff --git a/humanoid_robot_intelligence_control_system_controller/CHANGELOG.rst b/humanoid_robot_intelligence_control_system_controller/CHANGELOG.rst new file mode 100755 index 0000000..0b85c9e --- /dev/null +++ b/humanoid_robot_intelligence_control_system_controller/CHANGELOG.rst @@ -0,0 +1,136 @@ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Changelog for package humanoid_robot_intelligence_control_system_controller +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +0.3.2 (2023-10-03) +------------------ +* Make it compatible for ROS1/ROS2 +* Fix bugs +* Update package.xml and CMakeList.txt for to the latest versions +* Contributors & Maintainer: Ronaldson Bellande + +0.3.1 (2023-09-27) +------------------ +* Starting from this point it under a new license +* Fix errors and Issues +* Rename Repository for a completely different purpose +* Make it compatible with ROS/ROS2 +* Upgrade version of all builds and make it more compatible +* Update package.xml and CMakeList.txt for to the latest versions +* Contributors & Maintainer: Ronaldson Bellande + +0.3.0 (2021-05-03) +------------------ +* Update package.xml and CMakeList.txt for noetic branch +* Contributors: Ronaldson Bellande + +0.2.9 (2018-03-22) +------------------ +* added serivce for setting module +* deleted comment for debug +* modified to prevent duplicate indirect address write +* added boost system dependencies +* fixed a bug that occure when handling bulk read item that does not exist. +* Contributors: Kayman, Zerom, Pyo + +0.2.8 (2018-03-20) +------------------ +* modified CMakeLists.txt for system dependencies (yaml-cpp) +* Contributors: Zerom, Pyo + +0.2.7 (2018-03-15) +------------------ +* changed the License and package format to version 2 +* changed all values read by bulk read are saved to dxl_state\_->bulk_read_table\_. +* Modified to prevent duplicate indirect address write +* Contributors: SCH, Zerom, Pyo + +0.2.6 (2017-08-09) +------------------ +* multi thread bug fixed. +* unnecessary debug print removed. +* OpenCR control table item name changed. (torque_enable -> dynamixel_power) +* fixed to not update update_time_stamp\_ if bulk read fails. +* Contributors: Zerom + +0.2.5 (2017-06-09) +------------------ +* updated for yaml-cpp dependencies +* Contributors: SCH + +0.2.4 (2017-06-07) +------------------ +* added cmake_modules in package.xml +* Contributors: SCH + +0.2.3 (2017-05-23) +------------------ +* updated the cmake file for ros install +* Contributors: SCH + +0.2.2 (2017-04-24) +------------------ +* updated humanoid_robot_intelligence_control_system_controller.cpp +* changed to read control cycle from .robot file +* Contributors: Zerom + +0.2.1 (2016-11-23) +------------------ +* Merge the changes and update +* - Direct Control Mode bug fixed. +* update +* - added writeControlTableCallback +* - added WriteControlTable msg callback +* mode change debugging +* - optimized cpu usage by spin loop (by astumpf) +* - humanoid_robot_intelligence_control_system_controller process() : processing order changed. + * 1st : packet communication + * 2nd : processing modules +* - dependencies fixed. (Pull requests `#26 `_) +* - make setJointCtrlModuleCallback() to the thread function & improved. +* - modified dependency problem. +* - reduce CPU consumption +* Contributors: Jay Song, Pyo, Zerom, SCH + +0.2.0 (2016-08-31) +------------------ +* bug fixed (position pid gain & velocity pid gain sync write). +* added velocity_to_value_ratio to DXL Pro-H series. +* changed some debug messages. +* added velocity p/i/d gain and position i/d gain sync_write code. +* SyncWriteItem bug fixed. +* add function / modified the code simple (using auto / range based for loop) +* added XM-430-W210 / XM-430-W350 device file. +* rename ControlMode(CurrentControl -> TorqueControl) +* rename (port_to_sync_write_torque\_ -> port_to_sync_write_current\_) +* rename (present_current\_ -> present_torque\_) +* modified torque control code +* fixed typos / changed ROS_INFO -> fprintf (for processing speed) +* startTimer() : after bulkread txpacket(), need some sleep() +* changed the order of processing in the Process() function. +* added missing mutex for gazebo +* fixed crash when running in gazebo simulation +* sync write bug fix. +* added position_p_gain sync write +* MotionModule/SensorModule member variable access changed (public -> protected). +* Contributors: Jay Song, Zerom, Pyo, SCH + +0.1.1 (2016-08-18) +------------------ +* updated the package information + +0.1.0 (2016-08-12) +------------------ +* first public release for Kinetic +* modified the package information for release +* develop branch -> master branch +* function name changed : DeviceInit() -> InitDevice() +* Fixed high CPU consumption due to busy waits +* add SensorState + add Singleton template +* XM-430 / CM-740 device file added. + Sensor device added. +* added code to support the gazebo simulator +* added first bulk read failure protection code +* renewal +* Contributors: Alexander Stumpf, Jay Song, Zerom, Pyo diff --git a/humanoid_robot_intelligence_control_system_controller/CMakeLists.txt b/humanoid_robot_intelligence_control_system_controller/CMakeLists.txt new file mode 100755 index 0000000..c69c671 --- /dev/null +++ b/humanoid_robot_intelligence_control_system_controller/CMakeLists.txt @@ -0,0 +1,83 @@ +cmake_minimum_required(VERSION 3.8) +project(humanoid_robot_intelligence_control_system_controller) + +## Compile as C++11, supported in ROS Kinetic and newer +add_compile_options(-std=c++11) + + +if($ENV{ROS_VERSION} EQUAL 1) + find_package(catkin REQUIRED COMPONENTS + roscpp + roslib + std_msgs + sensor_msgs + humanoid_robot_intelligence_control_system_controller_msgs + dynamixel_sdk + humanoid_robot_intelligence_control_system_device + humanoid_robot_intelligence_control_system_framework_common + cmake_modules + ) + + find_package(Boost REQUIRED) + + find_package(PkgConfig REQUIRED) +else() + find_package(ament_cmake REQUIRED) +endif() + + +pkg_check_modules(YAML_CPP REQUIRED yaml-cpp) +find_path(YAML_CPP_INCLUDE_DIR + NAMES yaml_cpp.h + PATHS ${YAML_CPP_INCLUDE_DIRS} +) +find_library(YAML_CPP_LIBRARY + NAMES YAML_CPP + PATHS ${YAML_CPP_LIBRARY_DIRS} +) +link_directories(${YAML_CPP_LIBRARY_DIRS}) + +if(NOT ${YAML_CPP_VERSION} VERSION_LESS "0.5") +add_definitions(-DHAVE_NEW_YAMLCPP) +endif(NOT ${YAML_CPP_VERSION} VERSION_LESS "0.5") + + +if($ENV{ROS_VERSION} EQUAL 1) + catkin_package( + INCLUDE_DIRS include + LIBRARIES humanoid_robot_intelligence_control_system_controller + CATKIN_DEPENDS + roscpp + roslib + std_msgs + sensor_msgs + humanoid_robot_intelligence_control_system_controller_msgs + dynamixel_sdk + humanoid_robot_intelligence_control_system_device + humanoid_robot_intelligence_control_system_framework_common + cmake_modules + DEPENDS Boost + ) +endif() + + +include_directories( + include + ${catkin_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} + ${YAML_CPP_INCLUDE_DIRS} +) + +add_library(humanoid_robot_intelligence_control_system_controller src/humanoid_robot_intelligence_control_system_controller/humanoid_robot_intelligence_control_system_controller.cpp) +add_dependencies(humanoid_robot_intelligence_control_system_controller ${catkin_EXPORTED_TARGETS}) +target_link_libraries(humanoid_robot_intelligence_control_system_controller ${catkin_LIBRARIES} ${Boost_LIBRARIES} ${YAML_CPP_LIBRARIES}) + +install(TARGETS humanoid_robot_intelligence_control_system_controller + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} +) + +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} +) diff --git a/humanoid_robot_intelligence_control_system_controller/include/humanoid_robot_intelligence_control_system_controller/humanoid_robot_intelligence_control_system_controller.h b/humanoid_robot_intelligence_control_system_controller/include/humanoid_robot_intelligence_control_system_controller/humanoid_robot_intelligence_control_system_controller.h new file mode 100755 index 0000000..019a9bb --- /dev/null +++ b/humanoid_robot_intelligence_control_system_controller/include/humanoid_robot_intelligence_control_system_controller/humanoid_robot_intelligence_control_system_controller.h @@ -0,0 +1,209 @@ +/******************************************************************************* + * Copyright 2018 ROBOTIS CO., LTD. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *******************************************************************************/ + +/* + * humanoid_robot_intelligence_control_system_controller.h + * + * Created on: 2016. 1. 15. + * Author: zerom + */ + +#ifndef ROBOTIS_CONTROLLER_ROBOTIS_CONTROLLER_H_ +#define ROBOTIS_CONTROLLER_ROBOTIS_CONTROLLER_H_ + +#include +#include +#include +#include +#include +#include +#include + +#include "humanoid_robot_intelligence_control_system_controller_msgs/GetJointModule.h" +#include "humanoid_robot_intelligence_control_system_controller_msgs/JointCtrlModule.h" +#include "humanoid_robot_intelligence_control_system_controller_msgs/LoadOffset.h" +#include "humanoid_robot_intelligence_control_system_controller_msgs/SetJointModule.h" +#include "humanoid_robot_intelligence_control_system_controller_msgs/SetModule.h" +#include "humanoid_robot_intelligence_control_system_controller_msgs/SyncWriteItem.h" +#include "humanoid_robot_intelligence_control_system_controller_msgs/WriteControlTable.h" + +#include "dynamixel_sdk/group_bulk_read.h" +#include "dynamixel_sdk/group_sync_write.h" +#include "humanoid_robot_intelligence_control_system_device/robot.h" +#include "humanoid_robot_intelligence_control_system_framework_common/motion_module.h" +#include "humanoid_robot_intelligence_control_system_framework_common/sensor_module.h" + +namespace humanoid_robot_intelligence_control_system_framework { + +enum ControllerMode { MotionModuleMode, DirectControlMode }; + +class RobotisController : public Singleton { +private: + boost::thread queue_thread_; + boost::thread gazebo_thread_; + boost::thread set_module_thread_; + boost::mutex queue_mutex_; + + bool init_pose_loaded_; + bool is_timer_running_; + bool is_offset_enabled_; + double offset_ratio_; + bool stop_timer_; + pthread_t timer_thread_; + ControllerMode controller_mode_; + + std::list motion_modules_; + std::list sensor_modules_; + std::vector direct_sync_write_; + + std::map sensor_result_; + + void gazeboTimerThread(); + void msgQueueThread(); + void setCtrlModuleThread(std::string ctrl_module); + void setJointCtrlModuleThread( + const humanoid_robot_intelligence_control_system_controller_msgs::JointCtrlModule::ConstPtr &msg); + + bool isTimerStopped(); + void initializeSyncWrite(); + +public: + const int NONE_GAIN = 65535; + bool DEBUG_PRINT; + Robot *robot_; + + bool gazebo_mode_; + std::string gazebo_robot_name_; + + /* bulk read */ + std::map port_to_bulk_read_; + + /* sync write */ + std::map + port_to_sync_write_position_; + std::map + port_to_sync_write_velocity_; + std::map + port_to_sync_write_current_; + std::map + port_to_sync_write_position_p_gain_; + std::map + port_to_sync_write_position_i_gain_; + std::map + port_to_sync_write_position_d_gain_; + std::map + port_to_sync_write_velocity_p_gain_; + std::map + port_to_sync_write_velocity_i_gain_; + std::map + port_to_sync_write_velocity_d_gain_; + + /* publisher */ + ros::Publisher goal_joint_state_pub_; + ros::Publisher present_joint_state_pub_; + ros::Publisher current_module_pub_; + + std::map gazebo_joint_position_pub_; + std::map gazebo_joint_velocity_pub_; + std::map gazebo_joint_effort_pub_; + + static void *timerThread(void *param); + + RobotisController(); + + bool initialize(const std::string robot_file_path, + const std::string init_file_path); + void initializeDevice(const std::string init_file_path); + void process(); + + void addMotionModule(MotionModule *module); + void removeMotionModule(MotionModule *module); + void addSensorModule(SensorModule *module); + void removeSensorModule(SensorModule *module); + + void startTimer(); + void stopTimer(); + bool isTimerRunning(); + + void setCtrlModule(std::string module_name); + void loadOffset(const std::string path); + + /* ROS Topic Callback Functions */ + void writeControlTableCallback( + const humanoid_robot_intelligence_control_system_controller_msgs::WriteControlTable::ConstPtr &msg); + void syncWriteItemCallback( + const humanoid_robot_intelligence_control_system_controller_msgs::SyncWriteItem::ConstPtr &msg); + void setControllerModeCallback(const std_msgs::String::ConstPtr &msg); + void setJointStatesCallback(const sensor_msgs::JointState::ConstPtr &msg); + void setJointCtrlModuleCallback( + const humanoid_robot_intelligence_control_system_controller_msgs::JointCtrlModule::ConstPtr &msg); + void setCtrlModuleCallback(const std_msgs::String::ConstPtr &msg); + void enableOffsetCallback(const std_msgs::Bool::ConstPtr &msg); + bool getJointCtrlModuleService( + humanoid_robot_intelligence_control_system_controller_msgs::GetJointModule::Request &req, + humanoid_robot_intelligence_control_system_controller_msgs::GetJointModule::Response &res); + bool setJointCtrlModuleService( + humanoid_robot_intelligence_control_system_controller_msgs::SetJointModule::Request &req, + humanoid_robot_intelligence_control_system_controller_msgs::SetJointModule::Response &res); + bool setCtrlModuleService( + humanoid_robot_intelligence_control_system_controller_msgs::SetModule::Request &req, + humanoid_robot_intelligence_control_system_controller_msgs::SetModule::Response &res); + bool + loadOffsetService(humanoid_robot_intelligence_control_system_controller_msgs::LoadOffset::Request &req, + humanoid_robot_intelligence_control_system_controller_msgs::LoadOffset::Response &res); + + void gazeboJointStatesCallback(const sensor_msgs::JointState::ConstPtr &msg); + + int ping(const std::string joint_name, uint8_t *error = 0); + int ping(const std::string joint_name, uint16_t *model_number, + uint8_t *error = 0); + + int action(const std::string joint_name); + int reboot(const std::string joint_name, uint8_t *error = 0); + int factoryReset(const std::string joint_name, uint8_t option = 0, + uint8_t *error = 0); + + int read(const std::string joint_name, uint16_t address, uint16_t length, + uint8_t *data, uint8_t *error = 0); + int readCtrlItem(const std::string joint_name, const std::string item_name, + uint32_t *data, uint8_t *error = 0); + + int read1Byte(const std::string joint_name, uint16_t address, uint8_t *data, + uint8_t *error = 0); + int read2Byte(const std::string joint_name, uint16_t address, uint16_t *data, + uint8_t *error = 0); + int read4Byte(const std::string joint_name, uint16_t address, uint32_t *data, + uint8_t *error = 0); + + int write(const std::string joint_name, uint16_t address, uint16_t length, + uint8_t *data, uint8_t *error = 0); + int writeCtrlItem(const std::string joint_name, const std::string item_name, + uint32_t data, uint8_t *error = 0); + + int write1Byte(const std::string joint_name, uint16_t address, uint8_t data, + uint8_t *error = 0); + int write2Byte(const std::string joint_name, uint16_t address, uint16_t data, + uint8_t *error = 0); + int write4Byte(const std::string joint_name, uint16_t address, uint32_t data, + uint8_t *error = 0); + + int regWrite(const std::string joint_name, uint16_t address, uint16_t length, + uint8_t *data, uint8_t *error = 0); +}; + +} // namespace humanoid_robot_intelligence_control_system_framework + +#endif /* ROBOTIS_CONTROLLER_ROBOTIS_CONTROLLER_H_ */ diff --git a/humanoid_robot_intelligence_control_system_controller/package.xml b/humanoid_robot_intelligence_control_system_controller/package.xml new file mode 100755 index 0000000..302552d --- /dev/null +++ b/humanoid_robot_intelligence_control_system_controller/package.xml @@ -0,0 +1,81 @@ + + + humanoid_robot_intelligence_control_system_controller + 0.3.2 + humanoid_robot_intelligence_control_system_controller package for ROBOTIS's platform like Manipulator-H, THORMANG and OP series + Apache 2.0 + Ronaldson Bellande + + + catkin + + roscpp + roslib + std_msgs + sensor_msgs + humanoid_robot_intelligence_control_system_controller_msgs + dynamixel_sdk + humanoid_robot_intelligence_control_system_device + humanoid_robot_intelligence_control_system_framework_common + cmake_modules + yaml-cpp + + roscpp + roslib + std_msgs + sensor_msgs + humanoid_robot_intelligence_control_system_controller_msgs + dynamixel_sdk + humanoid_robot_intelligence_control_system_device + humanoid_robot_intelligence_control_system_framework_common + cmake_modules + yaml-cpp + + roscpp + roslib + std_msgs + sensor_msgs + humanoid_robot_intelligence_control_system_controller_msgs + dynamixel_sdk + humanoid_robot_intelligence_control_system_device + humanoid_robot_intelligence_control_system_framework_common + cmake_modules + yaml-cpp + + + ament_cmake + + roscpp + roslib + std_msgs + sensor_msgs + humanoid_robot_intelligence_control_system_controller_msgs + dynamixel_sdk + humanoid_robot_intelligence_control_system_device + humanoid_robot_intelligence_control_system_framework_common + cmake_modules + yaml-cpp + + roscpp + roslib + std_msgs + sensor_msgs + humanoid_robot_intelligence_control_system_controller_msgs + dynamixel_sdk + humanoid_robot_intelligence_control_system_device + humanoid_robot_intelligence_control_system_framework_common + cmake_modules + yaml-cpp + + roscpp + roslib + std_msgs + sensor_msgs + humanoid_robot_intelligence_control_system_controller_msgs + dynamixel_sdk + humanoid_robot_intelligence_control_system_device + humanoid_robot_intelligence_control_system_framework_common + cmake_modules + yaml-cpp + + diff --git a/humanoid_robot_intelligence_control_system_controller/src/humanoid_robot_intelligence_control_system_controller/humanoid_robot_intelligence_control_system_controller.cpp b/humanoid_robot_intelligence_control_system_controller/src/humanoid_robot_intelligence_control_system_controller/humanoid_robot_intelligence_control_system_controller.cpp new file mode 100755 index 0000000..1204a29 --- /dev/null +++ b/humanoid_robot_intelligence_control_system_controller/src/humanoid_robot_intelligence_control_system_controller/humanoid_robot_intelligence_control_system_controller.cpp @@ -0,0 +1,2625 @@ +/******************************************************************************* + * Copyright 2018 ROBOTIS CO., LTD. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *******************************************************************************/ + +/* + * humanoid_robot_intelligence_control_system_controller.cpp + * + * Created on: 2016. 1. 15. + * Author: zerom + */ + +#include +#include + +#include "humanoid_robot_intelligence_control_system_controller/humanoid_robot_intelligence_control_system_controller.h" + +using namespace humanoid_robot_intelligence_control_system_framework; + +RobotisController::RobotisController() + : is_timer_running_(false), is_offset_enabled_(true), offset_ratio_(1.0), + stop_timer_(false), init_pose_loaded_(false), timer_thread_(0), + controller_mode_(MotionModuleMode), DEBUG_PRINT(false), robot_(0), + gazebo_mode_(false), + gazebo_robot_name_("humanoid_robot_intelligence_control_system") { + direct_sync_write_.clear(); +} + +void RobotisController::initializeSyncWrite() { + if (gazebo_mode_ == true) + return; + + // ROS_INFO("FIRST BULKREAD"); + for (auto &it : port_to_bulk_read_) + it.second->txRxPacket(); + for (auto &it : port_to_bulk_read_) { + int error_count = 0; + int result = COMM_SUCCESS; + do { + if (++error_count > 10) { + ROS_ERROR("[RobotisController] first bulk read fail!!"); + exit(-1); + } + usleep(10 * 1000); + result = it.second->txRxPacket(); + } while (result != COMM_SUCCESS); + } + init_pose_loaded_ = true; + // ROS_INFO("FIRST BULKREAD END"); + + // clear syncwrite param setting + for (auto &it : port_to_sync_write_position_) { + if (it.second != NULL) + it.second->clearParam(); + } + for (auto &it : port_to_sync_write_position_p_gain_) { + if (it.second != NULL) + it.second->clearParam(); + } + for (auto &it : port_to_sync_write_position_i_gain_) { + if (it.second != NULL) + it.second->clearParam(); + } + for (auto &it : port_to_sync_write_position_d_gain_) { + if (it.second != NULL) + it.second->clearParam(); + } + for (auto &it : port_to_sync_write_velocity_) { + if (it.second != NULL) + it.second->clearParam(); + } + for (auto &it : port_to_sync_write_velocity_p_gain_) { + if (it.second != NULL) + it.second->clearParam(); + } + for (auto &it : port_to_sync_write_velocity_i_gain_) { + if (it.second != NULL) + it.second->clearParam(); + } + for (auto &it : port_to_sync_write_velocity_d_gain_) { + if (it.second != NULL) + it.second->clearParam(); + } + for (auto &it : port_to_sync_write_current_) { + if (it.second != NULL) + it.second->clearParam(); + } + + // set init syncwrite param(from data of bulkread) + for (auto &it : robot_->dxls_) { + std::string joint_name = it.first; + Dynamixel *dxl = it.second; + + for (int i = 0; i < dxl->bulk_read_items_.size(); i++) { + uint32_t read_data = 0; + uint8_t sync_write_data[4]; + + if (port_to_bulk_read_[dxl->port_name_]->isAvailable( + dxl->id_, dxl->bulk_read_items_[i]->address_, + dxl->bulk_read_items_[i]->data_length_) == true) { + read_data = port_to_bulk_read_[dxl->port_name_]->getData( + dxl->id_, dxl->bulk_read_items_[i]->address_, + dxl->bulk_read_items_[i]->data_length_); + + sync_write_data[0] = DXL_LOBYTE(DXL_LOWORD(read_data)); + sync_write_data[1] = DXL_HIBYTE(DXL_LOWORD(read_data)); + sync_write_data[2] = DXL_LOBYTE(DXL_HIWORD(read_data)); + sync_write_data[3] = DXL_HIBYTE(DXL_HIWORD(read_data)); + + if ((dxl->present_position_item_ != 0) && + (dxl->bulk_read_items_[i]->item_name_ == + dxl->present_position_item_->item_name_)) { + dxl->dxl_state_->present_position_ = + dxl->convertValue2Radian(read_data) - + dxl->dxl_state_->position_offset_ * offset_ratio_; + dxl->dxl_state_->goal_position_ = dxl->dxl_state_->present_position_; + + port_to_sync_write_position_[dxl->port_name_]->addParam( + dxl->id_, sync_write_data); + } else if ((dxl->position_p_gain_item_ != 0) && + (dxl->bulk_read_items_[i]->item_name_ == + dxl->position_p_gain_item_->item_name_)) { + dxl->dxl_state_->position_p_gain_ = read_data; + } else if ((dxl->position_i_gain_item_ != 0) && + (dxl->bulk_read_items_[i]->item_name_ == + dxl->position_i_gain_item_->item_name_)) { + dxl->dxl_state_->position_i_gain_ = read_data; + } else if ((dxl->position_d_gain_item_ != 0) && + (dxl->bulk_read_items_[i]->item_name_ == + dxl->position_d_gain_item_->item_name_)) { + dxl->dxl_state_->position_d_gain_ = read_data; + } else if ((dxl->present_velocity_item_ != 0) && + (dxl->bulk_read_items_[i]->item_name_ == + dxl->present_velocity_item_->item_name_)) { + dxl->dxl_state_->present_velocity_ = + dxl->convertValue2Velocity(read_data); + dxl->dxl_state_->goal_velocity_ = dxl->dxl_state_->present_velocity_; + } else if ((dxl->velocity_p_gain_item_ != 0) && + (dxl->bulk_read_items_[i]->item_name_ == + dxl->velocity_p_gain_item_->item_name_)) { + dxl->dxl_state_->velocity_p_gain_ = read_data; + } else if ((dxl->velocity_i_gain_item_ != 0) && + (dxl->bulk_read_items_[i]->item_name_ == + dxl->velocity_i_gain_item_->item_name_)) { + dxl->dxl_state_->velocity_i_gain_ = read_data; + } else if ((dxl->velocity_d_gain_item_ != 0) && + (dxl->bulk_read_items_[i]->item_name_ == + dxl->velocity_d_gain_item_->item_name_)) { + dxl->dxl_state_->velocity_d_gain_ = read_data; + } else if ((dxl->present_current_item_ != 0) && + (dxl->bulk_read_items_[i]->item_name_ == + dxl->present_current_item_->item_name_)) { + dxl->dxl_state_->present_torque_ = + dxl->convertValue2Torque(read_data); + dxl->dxl_state_->goal_torque_ = dxl->dxl_state_->present_torque_; + } + } + } + } +} + +bool RobotisController::initialize(const std::string robot_file_path, + const std::string init_file_path) { + std::string dev_desc_dir_path = + ros::package::getPath( + "humanoid_robot_intelligence_control_system_device") + + "/devices"; + + // load robot info : port , device + robot_ = new Robot(robot_file_path, dev_desc_dir_path); + + if (gazebo_mode_ == true) { + queue_thread_ = + boost::thread(boost::bind(&RobotisController::msgQueueThread, this)); + return true; + } + + for (auto &it : robot_->ports_) { + std::string port_name = it.first; + dynamixel::PortHandler *port = it.second; + dynamixel::PacketHandler *default_pkt_handler = + dynamixel::PacketHandler::getPacketHandler(2.0); + + if (port->setBaudRate(port->getBaudRate()) == false) { + ROS_ERROR("PORT [%s] SETUP ERROR! (baudrate: %d)", port_name.c_str(), + port->getBaudRate()); + exit(-1); + } + + // get the default device info of the port + std::string default_device_name = robot_->port_default_device_[port_name]; + auto dxl_it = robot_->dxls_.find(default_device_name); + auto sensor_it = robot_->sensors_.find(default_device_name); + if (dxl_it != robot_->dxls_.end()) { + Dynamixel *default_device = dxl_it->second; + default_pkt_handler = dynamixel::PacketHandler::getPacketHandler( + default_device->protocol_version_); + + if (default_device->goal_position_item_ != 0) { + port_to_sync_write_position_[port_name] = new dynamixel::GroupSyncWrite( + port, default_pkt_handler, + default_device->goal_position_item_->address_, + default_device->goal_position_item_->data_length_); + } + + if (default_device->position_p_gain_item_ != 0) { + port_to_sync_write_position_p_gain_[port_name] = + new dynamixel::GroupSyncWrite( + port, default_pkt_handler, + default_device->position_p_gain_item_->address_, + default_device->position_p_gain_item_->data_length_); + } + + if (default_device->position_i_gain_item_ != 0) { + port_to_sync_write_position_i_gain_[port_name] = + new dynamixel::GroupSyncWrite( + port, default_pkt_handler, + default_device->position_i_gain_item_->address_, + default_device->position_i_gain_item_->data_length_); + } + + if (default_device->position_d_gain_item_ != 0) { + port_to_sync_write_position_d_gain_[port_name] = + new dynamixel::GroupSyncWrite( + port, default_pkt_handler, + default_device->position_d_gain_item_->address_, + default_device->position_d_gain_item_->data_length_); + } + + if (default_device->goal_velocity_item_ != 0) { + port_to_sync_write_velocity_[port_name] = new dynamixel::GroupSyncWrite( + port, default_pkt_handler, + default_device->goal_velocity_item_->address_, + default_device->goal_velocity_item_->data_length_); + } + + if (default_device->velocity_p_gain_item_ != 0) { + port_to_sync_write_velocity_p_gain_[port_name] = + new dynamixel::GroupSyncWrite( + port, default_pkt_handler, + default_device->velocity_p_gain_item_->address_, + default_device->velocity_p_gain_item_->data_length_); + } + + if (default_device->velocity_i_gain_item_ != 0) { + port_to_sync_write_velocity_i_gain_[port_name] = + new dynamixel::GroupSyncWrite( + port, default_pkt_handler, + default_device->velocity_i_gain_item_->address_, + default_device->velocity_i_gain_item_->data_length_); + } + + if (default_device->velocity_d_gain_item_ != 0) { + port_to_sync_write_velocity_d_gain_[port_name] = + new dynamixel::GroupSyncWrite( + port, default_pkt_handler, + default_device->velocity_d_gain_item_->address_, + default_device->velocity_d_gain_item_->data_length_); + } + + if (default_device->goal_current_item_ != 0) { + port_to_sync_write_current_[port_name] = new dynamixel::GroupSyncWrite( + port, default_pkt_handler, + default_device->goal_current_item_->address_, + default_device->goal_current_item_->data_length_); + } + } else if (sensor_it != robot_->sensors_.end()) { + Sensor *_default_device = sensor_it->second; + default_pkt_handler = dynamixel::PacketHandler::getPacketHandler( + _default_device->protocol_version_); + } + + port_to_bulk_read_[port_name] = + new dynamixel::GroupBulkRead(port, default_pkt_handler); + } + + // (for loop) check all dxls are connected. + for (auto &it : robot_->dxls_) { + std::string joint_name = it.first; + Dynamixel *dxl = it.second; + + if (ping(joint_name) != 0) { + usleep(10 * 1000); + if (ping(joint_name) != 0) + ROS_ERROR("JOINT[%s] does NOT respond!!", joint_name.c_str()); + } + } + + initializeDevice(init_file_path); + + queue_thread_ = + boost::thread(boost::bind(&RobotisController::msgQueueThread, this)); + return true; +} + +void RobotisController::initializeDevice(const std::string init_file_path) { + // device initialize + if (DEBUG_PRINT) + ROS_WARN("INIT FILE LOAD"); + + YAML::Node doc; + try { + doc = YAML::LoadFile(init_file_path.c_str()); + + for (YAML::const_iterator it_doc = doc.begin(); it_doc != doc.end(); + it_doc++) { + std::string joint_name = it_doc->first.as(); + + YAML::Node joint_node = doc[joint_name]; + if (joint_node.size() == 0) + continue; + + Dynamixel *dxl = NULL; + auto dxl_it = robot_->dxls_.find(joint_name); + if (dxl_it != robot_->dxls_.end()) + dxl = dxl_it->second; + + if (dxl == NULL) { + ROS_WARN("Joint [%s] was not found.", joint_name.c_str()); + continue; + } + if (DEBUG_PRINT) + ROS_INFO("JOINT_NAME: %s", joint_name.c_str()); + + uint8_t torque_enabled = 0; + read1Byte(joint_name, dxl->torque_enable_item_->address_, + &torque_enabled); + + for (YAML::const_iterator it_joint = joint_node.begin(); + it_joint != joint_node.end(); it_joint++) { + std::string item_name = it_joint->first.as(); + + if (DEBUG_PRINT) + ROS_INFO(" ITEM_NAME: %s", item_name.c_str()); + + uint32_t value = it_joint->second.as(); + + ControlTableItem *item = dxl->ctrl_table_[item_name]; + if (item == NULL) { + ROS_WARN("Control Item [%s] was not found.", item_name.c_str()); + continue; + } + + if (item->memory_type_ == EEPROM) { + uint8_t data8 = 0; + uint16_t data16 = 0; + uint32_t data32 = 0; + + switch (item->data_length_) { + case 1: + read1Byte(joint_name, item->address_, &data8); + if (data8 == value) + continue; + break; + case 2: + read2Byte(joint_name, item->address_, &data16); + if (data16 == value) + continue; + break; + case 4: + read4Byte(joint_name, item->address_, &data32); + if (data32 == value) + continue; + break; + default: + break; + } + + if (torque_enabled == 1) { + ROS_ERROR( + "################\nThe initial value of the EEPROM area has " + "been changed. \nTurn off Torque Enable and try again."); + exit(-1); + } + } + + switch (item->data_length_) { + case 1: + write1Byte(joint_name, item->address_, (uint8_t)value); + break; + case 2: + write2Byte(joint_name, item->address_, (uint16_t)value); + break; + case 4: + write4Byte(joint_name, item->address_, value); + break; + default: + break; + } + + if (item->memory_type_ == EEPROM) { + // Write to EEPROM -> delay is required (max delay: 55 msec per byte) + usleep(item->data_length_ * 55 * 1000); + } + } + } + } catch (const std::exception &e) { + ROS_INFO("Dynamixel Init file not found."); + } + + // [ BulkRead ] StartAddress : Present Position , Length : 10 ( + // Position/Velocity/Current ) + for (auto &it : robot_->ports_) { + if (port_to_bulk_read_[it.first] != 0) + port_to_bulk_read_[it.first]->clearParam(); + } + for (auto &it : robot_->dxls_) { + std::string joint_name = it.first; + Dynamixel *dxl = it.second; + + if (dxl == NULL) + continue; + + int bulkread_start_addr = 0; + int bulkread_data_length = 0; + + // // bulk read default : present position + // if(dxl->present_position_item != 0) + // { + // bulkread_start_addr = dxl->present_position_item->address; + // bulkread_data_length = dxl->present_position_item->data_length; + // } + + uint8_t torque_enabled = 0; + read1Byte(joint_name, dxl->torque_enable_item_->address_, &torque_enabled); + + // calculate bulk read start address & data length + auto indirect_addr_it = dxl->ctrl_table_.find(INDIRECT_ADDRESS_1); + if (indirect_addr_it != dxl->ctrl_table_.end()) // INDIRECT_ADDRESS_1 exist + { + if (dxl->bulk_read_items_.size() != 0) { + uint16_t data16 = 0; + + bulkread_start_addr = dxl->bulk_read_items_[0]->address_; + bulkread_data_length = 0; + + // set indirect address + int indirect_addr = indirect_addr_it->second->address_; + for (int i = 0; i < dxl->bulk_read_items_.size(); i++) { + int addr_leng = dxl->bulk_read_items_[i]->data_length_; + + bulkread_data_length += addr_leng; + for (int l = 0; l < addr_leng; l++) { + // ROS_WARN("[%12s] INDIR_ADDR: %d, ITEM_ADDR: %d", + // joint_name.c_str(), indirect_addr, + // dxl->ctrl_table[dxl->bulk_read_items[i]->item_name]->address + + // _l); + + read2Byte(joint_name, indirect_addr, &data16); + if (data16 != dxl->ctrl_table_[dxl->bulk_read_items_[i]->item_name_] + ->address_ + + l) { + if (torque_enabled == 1) { + ROS_ERROR("################\nThe indirect address of the " + "EEPROM area has been changed. \nTurn off Torque " + "Enable and try again."); + exit(-1); + } + write2Byte(joint_name, indirect_addr, + dxl->ctrl_table_[dxl->bulk_read_items_[i]->item_name_] + ->address_ + + l); + } + indirect_addr += 2; + } + } + } + } else // INDIRECT_ADDRESS_1 NOT exist + { + if (dxl->bulk_read_items_.size() != 0) { + bulkread_start_addr = dxl->bulk_read_items_[0]->address_; + bulkread_data_length = 0; + + ControlTableItem *last_item = dxl->bulk_read_items_[0]; + + for (int i = 0; i < dxl->bulk_read_items_.size(); i++) { + int addr = dxl->bulk_read_items_[i]->address_; + if (addr < bulkread_start_addr) + bulkread_start_addr = addr; + else if (last_item->address_ < addr) + last_item = dxl->bulk_read_items_[i]; + } + + bulkread_data_length = + last_item->address_ - bulkread_start_addr + last_item->data_length_; + } + } + + // ROS_WARN("[%12s] start_addr: %d, data_length: %d", joint_name.c_str(), + // bulkread_start_addr, bulkread_data_length); + if (bulkread_start_addr != 0) + port_to_bulk_read_[dxl->port_name_]->addParam( + dxl->id_, bulkread_start_addr, bulkread_data_length); + + // Torque ON + if (writeCtrlItem(joint_name, dxl->torque_enable_item_->item_name_, 1) != + COMM_SUCCESS) + writeCtrlItem(joint_name, dxl->torque_enable_item_->item_name_, 1); + } + + for (auto &it : robot_->sensors_) { + std::string sensor_name = it.first; + Sensor *sensor = it.second; + + if (sensor == NULL) + continue; + + int bulkread_start_addr = 0; + int bulkread_data_length = 0; + + // calculate bulk read start address & data length + auto indirect_addr_it = sensor->ctrl_table_.find(INDIRECT_ADDRESS_1); + if (indirect_addr_it != + sensor->ctrl_table_.end()) // INDIRECT_ADDRESS_1 exist + { + if (sensor->bulk_read_items_.size() != 0) { + uint16_t data16 = 0; + + bulkread_start_addr = sensor->bulk_read_items_[0]->address_; + bulkread_data_length = 0; + + // set indirect address + int indirect_addr = indirect_addr_it->second->address_; + for (int i = 0; i < sensor->bulk_read_items_.size(); i++) { + int addr_leng = sensor->bulk_read_items_[i]->data_length_; + + bulkread_data_length += addr_leng; + for (int l = 0; l < addr_leng; l++) { + // ROS_WARN("[%12s] INDIR_ADDR: %d, ITEM_ADDR: %d", + // sensor_name.c_str(), indirect_addr, + // sensor->ctrl_table[sensor->bulk_read_items[i]->item_name]->address + // + _l); + read2Byte(sensor_name, indirect_addr, &data16); + if (data16 != + sensor->ctrl_table_[sensor->bulk_read_items_[i]->item_name_] + ->address_ + + l) { + write2Byte( + sensor_name, indirect_addr, + sensor->ctrl_table_[sensor->bulk_read_items_[i]->item_name_] + ->address_ + + l); + } + indirect_addr += 2; + } + } + } + } else // INDIRECT_ADDRESS_1 NOT exist + { + if (sensor->bulk_read_items_.size() != 0) { + bulkread_start_addr = sensor->bulk_read_items_[0]->address_; + bulkread_data_length = 0; + + ControlTableItem *last_item = sensor->bulk_read_items_[0]; + + for (int i = 0; i < sensor->bulk_read_items_.size(); i++) { + int addr = sensor->bulk_read_items_[i]->address_; + if (addr < bulkread_start_addr) + bulkread_start_addr = addr; + else if (last_item->address_ < addr) + last_item = sensor->bulk_read_items_[i]; + } + + bulkread_data_length = + last_item->address_ - bulkread_start_addr + last_item->data_length_; + } + } + + // ROS_WARN("[%12s] start_addr: %d, data_length: %d", sensor_name.c_str(), + // bulkread_start_addr, bulkread_data_length); + if (bulkread_start_addr != 0) + port_to_bulk_read_[sensor->port_name_]->addParam( + sensor->id_, bulkread_start_addr, bulkread_data_length); + } +} + +void RobotisController::gazeboTimerThread() { + ros::Rate gazebo_rate(1000 / robot_->getControlCycle()); + + while (!stop_timer_) { + if (init_pose_loaded_ == true) + process(); + gazebo_rate.sleep(); + } +} + +void RobotisController::msgQueueThread() { + ros::NodeHandle ros_node; + ros::CallbackQueue callback_queue; + + ros_node.setCallbackQueue(&callback_queue); + + /* subscriber */ + ros::Subscriber write_control_table_sub = ros_node.subscribe( + "/humanoid_robot_intelligence_control_system/write_control_table", 5, + &RobotisController::writeControlTableCallback, this); + ros::Subscriber sync_write_item_sub = ros_node.subscribe( + "/humanoid_robot_intelligence_control_system/sync_write_item", 10, + &RobotisController::syncWriteItemCallback, this); + ros::Subscriber joint_ctrl_modules_sub = ros_node.subscribe( + "/humanoid_robot_intelligence_control_system/set_joint_ctrl_modules", 10, + &RobotisController::setJointCtrlModuleCallback, this); + ros::Subscriber enable_ctrl_module_sub = ros_node.subscribe( + "/humanoid_robot_intelligence_control_system/enable_ctrl_module", 10, + &RobotisController::setCtrlModuleCallback, this); + ros::Subscriber control_mode_sub = ros_node.subscribe( + "/humanoid_robot_intelligence_control_system/set_control_mode", 10, + &RobotisController::setControllerModeCallback, this); + ros::Subscriber joint_states_sub = ros_node.subscribe( + "/humanoid_robot_intelligence_control_system/set_joint_states", 10, + &RobotisController::setJointStatesCallback, this); + ros::Subscriber enable_offset_sub = ros_node.subscribe( + "/humanoid_robot_intelligence_control_system/enable_offset", 10, + &RobotisController::enableOffsetCallback, this); + + ros::Subscriber gazebo_joint_states_sub; + if (gazebo_mode_ == true) + gazebo_joint_states_sub = + ros_node.subscribe("/" + gazebo_robot_name_ + "/joint_states", 10, + &RobotisController::gazeboJointStatesCallback, this); + + /* publisher */ + goal_joint_state_pub_ = ros_node.advertise( + "/humanoid_robot_intelligence_control_system/goal_joint_states", 10); + present_joint_state_pub_ = ros_node.advertise( + "/humanoid_robot_intelligence_control_system/present_joint_states", 10); + current_module_pub_ = ros_node.advertise< + humanoid_robot_intelligence_control_system_controller_msgs:: + JointCtrlModule>( + "/humanoid_robot_intelligence_control_system/present_joint_ctrl_modules", + 10); + + if (gazebo_mode_ == true) { + for (auto &it : robot_->dxls_) { + gazebo_joint_position_pub_[it.first] = + ros_node.advertise( + "/" + gazebo_robot_name_ + "/" + it.first + "_position/command", + 1); + gazebo_joint_velocity_pub_[it.first] = + ros_node.advertise( + "/" + gazebo_robot_name_ + "/" + it.first + "_velocity/command", + 1); + gazebo_joint_effort_pub_[it.first] = + ros_node.advertise( + "/" + gazebo_robot_name_ + "/" + it.first + "_effort/command", 1); + } + } + + /* service */ + ros::ServiceServer get_joint_module_server = ros_node.advertiseService( + "/humanoid_robot_intelligence_control_system/" + "get_present_joint_ctrl_modules", + &RobotisController::getJointCtrlModuleService, this); + ros::ServiceServer set_joint_module_server = ros_node.advertiseService( + "/humanoid_robot_intelligence_control_system/" + "set_present_joint_ctrl_modules", + &RobotisController::setJointCtrlModuleService, this); + ros::ServiceServer set_module_server = ros_node.advertiseService( + "/humanoid_robot_intelligence_control_system/set_present_ctrl_modules", + &RobotisController::setCtrlModuleService, this); + ros::ServiceServer load_offset_server = ros_node.advertiseService( + "/humanoid_robot_intelligence_control_system/load_offset", + &RobotisController::loadOffsetService, this); + + ros::WallDuration duration(robot_->getControlCycle() / 1000.0); + while (ros_node.ok()) + callback_queue.callAvailable(duration); +} + +void *RobotisController::timerThread(void *param) { + RobotisController *controller = (RobotisController *)param; + static struct timespec next_time; + static struct timespec curr_time; + + ROS_DEBUG("controller::thread_proc started"); + + clock_gettime(CLOCK_MONOTONIC, &next_time); + + while (!controller->stop_timer_) { + next_time.tv_sec += + (next_time.tv_nsec + controller->robot_->getControlCycle() * 1000000) / + 1000000000; + next_time.tv_nsec = + (next_time.tv_nsec + controller->robot_->getControlCycle() * 1000000) % + 1000000000; + + controller->process(); + + clock_gettime(CLOCK_MONOTONIC, &curr_time); + long delta_nsec = (next_time.tv_sec - curr_time.tv_sec) * 1000000000 + + (next_time.tv_nsec - curr_time.tv_nsec); + if (delta_nsec < -100000) { + if (controller->DEBUG_PRINT == true) { + fprintf(stderr, + "[RobotisController::ThreadProc] NEXT TIME < CURR TIME.. " + "(%f)[%ld.%09ld / %ld.%09ld]", + delta_nsec / 1000000.0, (long)next_time.tv_sec, + (long)next_time.tv_nsec, (long)curr_time.tv_sec, + (long)curr_time.tv_nsec); + } + + // next_time = curr_time + 3 msec + next_time.tv_sec = + curr_time.tv_sec + (curr_time.tv_nsec + 3000000) / 1000000000; + next_time.tv_nsec = (curr_time.tv_nsec + 3000000) % 1000000000; + } + + clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &next_time, NULL); + } + return 0; +} + +void RobotisController::startTimer() { + if (this->is_timer_running_ == true) + return; + + if (this->gazebo_mode_ == true) { + // create and start the thread + gazebo_thread_ = + boost::thread(boost::bind(&RobotisController::gazeboTimerThread, this)); + } else { + initializeSyncWrite(); + + for (auto &it : port_to_bulk_read_) { + it.second->txPacket(); + } + + usleep(8 * 1000); + + int error; + struct sched_param param; + pthread_attr_t attr; + + pthread_attr_init(&attr); + + error = pthread_attr_setschedpolicy(&attr, SCHED_RR); + if (error != 0) + ROS_ERROR("pthread_attr_setschedpolicy error = %d\n", error); + error = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED); + if (error != 0) + ROS_ERROR("pthread_attr_setinheritsched error = %d\n", error); + + memset(¶m, 0, sizeof(param)); + param.sched_priority = 31; // RT + error = pthread_attr_setschedparam(&attr, ¶m); + if (error != 0) + ROS_ERROR("pthread_attr_setschedparam error = %d\n", error); + + // create and start the thread + if ((error = pthread_create(&this->timer_thread_, &attr, this->timerThread, + this)) != 0) { + ROS_ERROR("Creating timer thread failed!!"); + exit(-1); + } + } + + this->is_timer_running_ = true; +} + +void RobotisController::stopTimer() { + int error = 0; + + // set the flag to stop the thread + if (this->is_timer_running_) { + this->stop_timer_ = true; + + if (this->gazebo_mode_ == false) { + // wait until the thread is stopped. + if ((error = pthread_join(this->timer_thread_, NULL)) != 0) + exit(-1); + + for (auto &it : port_to_bulk_read_) { + if (it.second != NULL) + it.second->rxPacket(); + } + + for (auto &it : port_to_sync_write_position_) { + if (it.second != NULL) + it.second->clearParam(); + } + for (auto &it : port_to_sync_write_position_p_gain_) { + if (it.second != NULL) + it.second->clearParam(); + } + for (auto &it : port_to_sync_write_position_i_gain_) { + if (it.second != NULL) + it.second->clearParam(); + } + for (auto &it : port_to_sync_write_position_d_gain_) { + if (it.second != NULL) + it.second->clearParam(); + } + for (auto &it : port_to_sync_write_velocity_) { + if (it.second != NULL) + it.second->clearParam(); + } + for (auto &it : port_to_sync_write_velocity_p_gain_) { + if (it.second != NULL) + it.second->clearParam(); + } + for (auto &it : port_to_sync_write_velocity_i_gain_) { + if (it.second != NULL) + it.second->clearParam(); + } + for (auto &it : port_to_sync_write_velocity_d_gain_) { + if (it.second != NULL) + it.second->clearParam(); + } + for (auto &it : port_to_sync_write_current_) { + if (it.second != NULL) + it.second->clearParam(); + } + } else { + // wait until the thread is stopped. + gazebo_thread_.join(); + } + + this->stop_timer_ = false; + this->is_timer_running_ = false; + } +} + +bool RobotisController::isTimerRunning() { return this->is_timer_running_; } + +void RobotisController::loadOffset(const std::string path) { + YAML::Node doc; + try { + doc = YAML::LoadFile(path.c_str()); + } catch (const std::exception &e) { + ROS_WARN("Fail to load offset yaml."); + return; + } + + YAML::Node offset_node = doc["offset"]; + if (offset_node.size() == 0) + return; + + ROS_INFO("Load offsets..."); + for (YAML::const_iterator it = offset_node.begin(); it != offset_node.end(); + it++) { + std::string joint_name = it->first.as(); + double offset = it->second.as(); + + auto dxl_it = robot_->dxls_.find(joint_name); + if (dxl_it != robot_->dxls_.end()) + dxl_it->second->dxl_state_->position_offset_ = offset; + } +} + +void RobotisController::process() { + // avoid duplicated function call + static bool is_process_running = false; + if (is_process_running == true) + return; + is_process_running = true; + + // ROS_INFO("Controller::Process()"); + // offset ratio + if (is_offset_enabled_) { + if (offset_ratio_ < 1.0) + offset_ratio_ += 0.01; + else + offset_ratio_ = 1.0; + } else { + if (offset_ratio_ > 0.0) + offset_ratio_ -= 0.01; + else + offset_ratio_ = 0.0; + } + + ros::Time start_time; + ros::Duration time_duration; + + if (DEBUG_PRINT) + start_time = ros::Time::now(); + + sensor_msgs::JointState goal_state; + sensor_msgs::JointState present_state; + + present_state.header.stamp = ros::Time::now(); + goal_state.header.stamp = present_state.header.stamp; + + if (controller_mode_ == MotionModuleMode) { + if (gazebo_mode_ == false) { + // BulkRead Rx + for (auto &it : port_to_bulk_read_) { + robot_->ports_[it.first]->setPacketTimeout(0.0); + if (DEBUG_PRINT) { + int result = it.second->rxPacket(); + if (result != COMM_SUCCESS) + ROS_ERROR_STREAM("Bulk Read Fail : " << it.first); + } else + it.second->rxPacket(); + } + + // -> save to robot->dxls_[]->dxl_state_ + if (robot_->dxls_.size() > 0) { + for (auto &dxl_it : robot_->dxls_) { + Dynamixel *dxl = dxl_it.second; + std::string port_name = dxl_it.second->port_name_; + std::string joint_name = dxl_it.first; + + if (dxl->bulk_read_items_.size() > 0) { + bool updated = false; + uint32_t data = 0; + for (int i = 0; i < dxl->bulk_read_items_.size(); i++) { + ControlTableItem *item = dxl->bulk_read_items_[i]; + if (port_to_bulk_read_[port_name]->isAvailable( + dxl->id_, item->address_, item->data_length_) == true) { + updated = true; + data = port_to_bulk_read_[port_name]->getData( + dxl->id_, item->address_, item->data_length_); + + // change dxl_state + if (dxl->present_position_item_ != 0 && + item->item_name_ == + dxl->present_position_item_->item_name_) { + dxl->dxl_state_->present_position_ = + dxl->convertValue2Radian(data) - + dxl->dxl_state_->position_offset_ * offset_ratio_; + } else if (dxl->present_velocity_item_ != 0 && + item->item_name_ == + dxl->present_velocity_item_->item_name_) + dxl->dxl_state_->present_velocity_ = + dxl->convertValue2Velocity(data); + else if (dxl->present_current_item_ != 0 && + item->item_name_ == + dxl->present_current_item_->item_name_) + dxl->dxl_state_->present_torque_ = + dxl->convertValue2Torque(data); + else if (dxl->goal_position_item_ != 0 && + item->item_name_ == + dxl->goal_position_item_->item_name_) { + dxl->dxl_state_->goal_position_ = + dxl->convertValue2Radian(data) - + dxl->dxl_state_->position_offset_ * offset_ratio_; + } else if (dxl->goal_velocity_item_ != 0 && + item->item_name_ == + dxl->goal_velocity_item_->item_name_) + dxl->dxl_state_->goal_velocity_ = + dxl->convertValue2Velocity(data); + else if (dxl->goal_current_item_ != 0 && + item->item_name_ == + dxl->goal_current_item_->item_name_) + dxl->dxl_state_->goal_torque_ = + dxl->convertValue2Torque(data); + + dxl->dxl_state_->bulk_read_table_[item->item_name_] = data; + } + } + + // -> update time stamp to + // Robot->dxls[]->dynamixel_state.update_time_stamp + if (updated == true) + dxl->dxl_state_->update_time_stamp_ = + TimeStamp(present_state.header.stamp.sec, + present_state.header.stamp.nsec); + } + } + } + + // -> save to robot->sensors_[]->sensor_state_ + if (robot_->sensors_.size() > 0) { + for (auto &sensor_it : robot_->sensors_) { + Sensor *sensor = sensor_it.second; + std::string port_name = sensor_it.second->port_name_; + std::string sensor_name = sensor_it.first; + + if (sensor->bulk_read_items_.size() > 0) { + bool updated = false; + uint32_t data = 0; + for (int i = 0; i < sensor->bulk_read_items_.size(); i++) { + ControlTableItem *item = sensor->bulk_read_items_[i]; + if (port_to_bulk_read_[port_name]->isAvailable( + sensor->id_, item->address_, item->data_length_) == + true) { + updated = true; + data = port_to_bulk_read_[port_name]->getData( + sensor->id_, item->address_, item->data_length_); + + // change sensor_state + sensor->sensor_state_->bulk_read_table_[item->item_name_] = + data; + } + } + + // -> update time stamp to + // Robot->dxls[]->dynamixel_state.update_time_stamp + if (updated == true) + sensor->sensor_state_->update_time_stamp_ = + TimeStamp(present_state.header.stamp.sec, + present_state.header.stamp.nsec); + } + } + } + + if (DEBUG_PRINT) { + time_duration = ros::Time::now() - start_time; + fprintf(stderr, "(%2.6f) BulkRead Rx & update state \n", + time_duration.nsec * 0.000001); + } + + // SyncWrite + queue_mutex_.lock(); + + if (direct_sync_write_.size() > 0) { + for (int i = 0; i < direct_sync_write_.size(); i++) { + direct_sync_write_[i]->txPacket(); + direct_sync_write_[i]->clearParam(); + } + direct_sync_write_.clear(); + } + + if (port_to_sync_write_position_p_gain_.size() > 0) { + for (auto &it : port_to_sync_write_position_p_gain_) { + it.second->txPacket(); + it.second->clearParam(); + } + } + if (port_to_sync_write_position_i_gain_.size() > 0) { + for (auto &it : port_to_sync_write_position_i_gain_) { + it.second->txPacket(); + it.second->clearParam(); + } + } + if (port_to_sync_write_position_d_gain_.size() > 0) { + for (auto &it : port_to_sync_write_position_d_gain_) { + it.second->txPacket(); + it.second->clearParam(); + } + } + if (port_to_sync_write_velocity_p_gain_.size() > 0) { + for (auto &it : port_to_sync_write_velocity_p_gain_) { + it.second->txPacket(); + it.second->clearParam(); + } + } + if (port_to_sync_write_velocity_i_gain_.size() > 0) { + for (auto &it : port_to_sync_write_velocity_i_gain_) { + it.second->txPacket(); + it.second->clearParam(); + } + } + if (port_to_sync_write_velocity_d_gain_.size() > 0) { + for (auto &it : port_to_sync_write_velocity_d_gain_) { + it.second->txPacket(); + it.second->clearParam(); + } + } + for (auto &it : port_to_sync_write_position_) { + if (it.second != NULL) + it.second->txPacket(); + } + for (auto &it : port_to_sync_write_velocity_) { + if (it.second != NULL) + it.second->txPacket(); + } + for (auto &it : port_to_sync_write_current_) { + if (it.second != NULL) + it.second->txPacket(); + } + + queue_mutex_.unlock(); + + // BulkRead Tx + for (auto &it : port_to_bulk_read_) + it.second->txPacket(); + + if (DEBUG_PRINT) { + time_duration = ros::Time::now() - start_time; + fprintf(stderr, "(%2.6f) SyncWrite & BulkRead Tx \n", + time_duration.nsec * 0.000001); + } + } else if (gazebo_mode_ == true) { + std_msgs::Float64 joint_msg; + + for (auto &dxl_it : robot_->dxls_) { + std::string joint_name = dxl_it.first; + Dynamixel *dxl = dxl_it.second; + DynamixelState *dxl_state = dxl_it.second->dxl_state_; + + if (dxl->ctrl_module_name_ == "none") { + joint_msg.data = dxl_state->goal_position_; + gazebo_joint_position_pub_[joint_name].publish(joint_msg); + } + } + + for (auto module_it = motion_modules_.begin(); + module_it != motion_modules_.end(); module_it++) { + if ((*module_it)->getModuleEnable() == false) + continue; + + for (auto &dxl_it : robot_->dxls_) { + std::string joint_name = dxl_it.first; + Dynamixel *dxl = dxl_it.second; + DynamixelState *dxl_state = dxl_it.second->dxl_state_; + + if (dxl->ctrl_module_name_ == (*module_it)->getModuleName()) { + if ((*module_it)->getControlMode() == PositionControl) { + joint_msg.data = dxl_state->goal_position_; + gazebo_joint_position_pub_[joint_name].publish(joint_msg); + } else if ((*module_it)->getControlMode() == VelocityControl) { + joint_msg.data = dxl_state->goal_velocity_; + gazebo_joint_velocity_pub_[joint_name].publish(joint_msg); + } else if ((*module_it)->getControlMode() == TorqueControl) { + joint_msg.data = dxl_state->goal_torque_; + gazebo_joint_effort_pub_[joint_name].publish(joint_msg); + } + } + } + } + } + } else if (controller_mode_ == DirectControlMode) { + if (gazebo_mode_ == false) { + // BulkRead Rx + for (auto &it : port_to_bulk_read_) { + robot_->ports_[it.first]->setPacketTimeout(0.0); + it.second->rxPacket(); + } + + // -> save to robot->dxls_[]->dxl_state_ + if (robot_->dxls_.size() > 0) { + for (auto &dxl_it : robot_->dxls_) { + Dynamixel *dxl = dxl_it.second; + std::string port_name = dxl_it.second->port_name_; + std::string joint_name = dxl_it.first; + + if (dxl->bulk_read_items_.size() > 0) { + uint32_t data = 0; + for (int i = 0; i < dxl->bulk_read_items_.size(); i++) { + ControlTableItem *item = dxl->bulk_read_items_[i]; + if (port_to_bulk_read_[port_name]->isAvailable( + dxl->id_, item->address_, item->data_length_) == true) { + data = port_to_bulk_read_[port_name]->getData( + dxl->id_, item->address_, item->data_length_); + + // change dxl_state + if (dxl->present_position_item_ != 0 && + item->item_name_ == + dxl->present_position_item_->item_name_) { + dxl->dxl_state_->present_position_ = + dxl->convertValue2Radian(data) - + dxl->dxl_state_->position_offset_ * offset_ratio_; + } else if (dxl->present_velocity_item_ != 0 && + item->item_name_ == + dxl->present_velocity_item_->item_name_) + dxl->dxl_state_->present_velocity_ = + dxl->convertValue2Velocity(data); + else if (dxl->present_current_item_ != 0 && + item->item_name_ == + dxl->present_current_item_->item_name_) + dxl->dxl_state_->present_torque_ = + dxl->convertValue2Torque(data); + else if (dxl->goal_position_item_ != 0 && + item->item_name_ == + dxl->goal_position_item_->item_name_) { + dxl->dxl_state_->goal_position_ = + dxl->convertValue2Radian(data) - + dxl->dxl_state_->position_offset_ * offset_ratio_; + } else if (dxl->goal_velocity_item_ != 0 && + item->item_name_ == + dxl->goal_velocity_item_->item_name_) + dxl->dxl_state_->goal_velocity_ = + dxl->convertValue2Velocity(data); + else if (dxl->goal_current_item_ != 0 && + item->item_name_ == + dxl->goal_current_item_->item_name_) + dxl->dxl_state_->goal_torque_ = + dxl->convertValue2Torque(data); + + dxl->dxl_state_->bulk_read_table_[item->item_name_] = data; + } + } + + // -> update time stamp to + // Robot->dxls[]->dynamixel_state.update_time_stamp + dxl->dxl_state_->update_time_stamp_ = + TimeStamp(present_state.header.stamp.sec, + present_state.header.stamp.nsec); + } + } + } + + queue_mutex_.lock(); + + // for (auto& it : port_to_sync_write_position_) + // { + // it.second->txPacket(); + // it.second->clearParam(); + // } + + if (direct_sync_write_.size() > 0) { + for (int i = 0; i < direct_sync_write_.size(); i++) { + direct_sync_write_[i]->txPacket(); + direct_sync_write_[i]->clearParam(); + } + direct_sync_write_.clear(); + } + + queue_mutex_.unlock(); + + // BulkRead Tx + for (auto &it : port_to_bulk_read_) + it.second->txPacket(); + } + } + + // Call SensorModule Process() + // -> for loop : call SensorModule list -> Process() + if (sensor_modules_.size() > 0) { + for (auto module_it = sensor_modules_.begin(); + module_it != sensor_modules_.end(); module_it++) { + (*module_it)->process(robot_->dxls_, robot_->sensors_); + + for (auto &it : (*module_it)->result_) + sensor_result_[it.first] = it.second; + } + } + + if (DEBUG_PRINT) { + time_duration = ros::Time::now() - start_time; + fprintf(stderr, "(%2.6f) SensorModule Process() & save result \n", + time_duration.nsec * 0.000001); + } + + if (controller_mode_ == MotionModuleMode) { + // Call MotionModule Process() + // -> for loop : call MotionModule list -> Process() + if (motion_modules_.size() > 0) { + queue_mutex_.lock(); + + for (auto module_it = motion_modules_.begin(); + module_it != motion_modules_.end(); module_it++) { + if ((*module_it)->getModuleEnable() == false) + continue; + + (*module_it)->process(robot_->dxls_, sensor_result_); + + // for loop : joint list + for (auto &dxl_it : robot_->dxls_) { + std::string joint_name = dxl_it.first; + Dynamixel *dxl = dxl_it.second; + DynamixelState *dxl_state = dxl_it.second->dxl_state_; + + if (dxl->ctrl_module_name_ == (*module_it)->getModuleName()) { + // do_sync_write = true; + DynamixelState *result_state = (*module_it)->result_[joint_name]; + + if (result_state == NULL) { + ROS_ERROR("[%s] %s ", (*module_it)->getModuleName().c_str(), + joint_name.c_str()); + continue; + } + + // TODO: check update time stamp ? + + if ((*module_it)->getControlMode() == PositionControl) { + dxl_state->goal_position_ = result_state->goal_position_; + + if (gazebo_mode_ == false) { + // add offset + uint32_t pos_data; + pos_data = dxl->convertRadian2Value( + dxl_state->goal_position_ + + dxl_state->position_offset_ * offset_ratio_); + + uint8_t sync_write_data[4] = {0}; + sync_write_data[0] = DXL_LOBYTE(DXL_LOWORD(pos_data)); + sync_write_data[1] = DXL_HIBYTE(DXL_LOWORD(pos_data)); + sync_write_data[2] = DXL_LOBYTE(DXL_HIWORD(pos_data)); + sync_write_data[3] = DXL_HIBYTE(DXL_HIWORD(pos_data)); + + if (port_to_sync_write_position_[dxl->port_name_] != NULL) + port_to_sync_write_position_[dxl->port_name_]->changeParam( + dxl->id_, sync_write_data); + + // if position p gain value is changed -> sync write + if (result_state->position_p_gain_ != NONE_GAIN && + dxl_state->position_p_gain_ != + result_state->position_p_gain_) { + dxl_state->position_p_gain_ = result_state->position_p_gain_; + uint8_t sync_write_data[4] = {0}; + sync_write_data[0] = + DXL_LOBYTE(DXL_LOWORD(dxl_state->position_p_gain_)); + sync_write_data[1] = + DXL_HIBYTE(DXL_LOWORD(dxl_state->position_p_gain_)); + sync_write_data[2] = + DXL_LOBYTE(DXL_HIWORD(dxl_state->position_p_gain_)); + sync_write_data[3] = + DXL_HIBYTE(DXL_HIWORD(dxl_state->position_p_gain_)); + + if (port_to_sync_write_position_p_gain_[dxl->port_name_] != + NULL) + port_to_sync_write_position_p_gain_[dxl->port_name_] + ->addParam(dxl->id_, sync_write_data); + } + + // if position i gain value is changed -> sync write + if (result_state->position_i_gain_ != NONE_GAIN && + dxl_state->position_i_gain_ != + result_state->position_i_gain_) { + dxl_state->position_i_gain_ = result_state->position_i_gain_; + uint8_t sync_write_data[4] = {0}; + sync_write_data[0] = + DXL_LOBYTE(DXL_LOWORD(dxl_state->position_i_gain_)); + sync_write_data[1] = + DXL_HIBYTE(DXL_LOWORD(dxl_state->position_i_gain_)); + sync_write_data[2] = + DXL_LOBYTE(DXL_HIWORD(dxl_state->position_i_gain_)); + sync_write_data[3] = + DXL_HIBYTE(DXL_HIWORD(dxl_state->position_i_gain_)); + + if (port_to_sync_write_position_i_gain_[dxl->port_name_] != + NULL) + port_to_sync_write_position_i_gain_[dxl->port_name_] + ->addParam(dxl->id_, sync_write_data); + } + + // if position d gain value is changed -> sync write + if (result_state->position_d_gain_ != NONE_GAIN && + dxl_state->position_d_gain_ != + result_state->position_d_gain_) { + dxl_state->position_d_gain_ = result_state->position_d_gain_; + uint8_t sync_write_data[4] = {0}; + sync_write_data[0] = + DXL_LOBYTE(DXL_LOWORD(dxl_state->position_d_gain_)); + sync_write_data[1] = + DXL_HIBYTE(DXL_LOWORD(dxl_state->position_d_gain_)); + sync_write_data[2] = + DXL_LOBYTE(DXL_HIWORD(dxl_state->position_d_gain_)); + sync_write_data[3] = + DXL_HIBYTE(DXL_HIWORD(dxl_state->position_d_gain_)); + + if (port_to_sync_write_position_d_gain_[dxl->port_name_] != + NULL) + port_to_sync_write_position_d_gain_[dxl->port_name_] + ->addParam(dxl->id_, sync_write_data); + } + + // if velocity p gain gain value is changed -> sync write + if (result_state->velocity_p_gain_ != NONE_GAIN && + dxl_state->velocity_p_gain_ != + result_state->velocity_p_gain_) { + dxl_state->velocity_p_gain_ = result_state->velocity_p_gain_; + uint8_t sync_write_data[4] = {0}; + sync_write_data[0] = + DXL_LOBYTE(DXL_LOWORD(dxl_state->velocity_p_gain_)); + sync_write_data[1] = + DXL_HIBYTE(DXL_LOWORD(dxl_state->velocity_p_gain_)); + sync_write_data[2] = + DXL_LOBYTE(DXL_HIWORD(dxl_state->velocity_p_gain_)); + sync_write_data[3] = + DXL_HIBYTE(DXL_HIWORD(dxl_state->velocity_p_gain_)); + + if (port_to_sync_write_velocity_p_gain_[dxl->port_name_] != + NULL) + port_to_sync_write_velocity_p_gain_[dxl->port_name_] + ->addParam(dxl->id_, sync_write_data); + } + + // if velocity i gain value is changed -> sync write + if (result_state->velocity_i_gain_ != NONE_GAIN && + dxl_state->velocity_i_gain_ != + result_state->velocity_i_gain_) { + dxl_state->velocity_i_gain_ = result_state->velocity_i_gain_; + uint8_t sync_write_data[4] = {0}; + sync_write_data[0] = + DXL_LOBYTE(DXL_LOWORD(dxl_state->velocity_i_gain_)); + sync_write_data[1] = + DXL_HIBYTE(DXL_LOWORD(dxl_state->velocity_i_gain_)); + sync_write_data[2] = + DXL_LOBYTE(DXL_HIWORD(dxl_state->velocity_i_gain_)); + sync_write_data[3] = + DXL_HIBYTE(DXL_HIWORD(dxl_state->velocity_i_gain_)); + + if (port_to_sync_write_velocity_i_gain_[dxl->port_name_] != + NULL) + port_to_sync_write_velocity_i_gain_[dxl->port_name_] + ->addParam(dxl->id_, sync_write_data); + } + } + } else if ((*module_it)->getControlMode() == VelocityControl) { + dxl_state->goal_velocity_ = result_state->goal_velocity_; + + if (gazebo_mode_ == false) { + uint32_t vel_data = + dxl->convertVelocity2Value(dxl_state->goal_velocity_); + uint8_t sync_write_data[4] = {0}; + sync_write_data[0] = DXL_LOBYTE(DXL_LOWORD(vel_data)); + sync_write_data[1] = DXL_HIBYTE(DXL_LOWORD(vel_data)); + sync_write_data[2] = DXL_LOBYTE(DXL_HIWORD(vel_data)); + sync_write_data[3] = DXL_HIBYTE(DXL_HIWORD(vel_data)); + + if (port_to_sync_write_velocity_[dxl->port_name_] != NULL) + port_to_sync_write_velocity_[dxl->port_name_]->changeParam( + dxl->id_, sync_write_data); + + // if velocity p gain gain value is changed -> sync write + if (result_state->velocity_p_gain_ != NONE_GAIN && + dxl_state->velocity_p_gain_ != + result_state->velocity_p_gain_) { + dxl_state->velocity_p_gain_ = result_state->velocity_p_gain_; + uint8_t sync_write_data[4] = {0}; + sync_write_data[0] = + DXL_LOBYTE(DXL_LOWORD(dxl_state->velocity_p_gain_)); + sync_write_data[1] = + DXL_HIBYTE(DXL_LOWORD(dxl_state->velocity_p_gain_)); + sync_write_data[2] = + DXL_LOBYTE(DXL_HIWORD(dxl_state->velocity_p_gain_)); + sync_write_data[3] = + DXL_HIBYTE(DXL_HIWORD(dxl_state->velocity_p_gain_)); + + if (port_to_sync_write_velocity_p_gain_[dxl->port_name_] != + NULL) + port_to_sync_write_velocity_p_gain_[dxl->port_name_] + ->addParam(dxl->id_, sync_write_data); + } + + // if velocity i gain value is changed -> sync write + if (result_state->velocity_i_gain_ != NONE_GAIN && + dxl_state->velocity_i_gain_ != + result_state->velocity_i_gain_) { + dxl_state->velocity_i_gain_ = result_state->velocity_i_gain_; + uint8_t sync_write_data[4] = {0}; + sync_write_data[0] = + DXL_LOBYTE(DXL_LOWORD(dxl_state->velocity_i_gain_)); + sync_write_data[1] = + DXL_HIBYTE(DXL_LOWORD(dxl_state->velocity_i_gain_)); + sync_write_data[2] = + DXL_LOBYTE(DXL_HIWORD(dxl_state->velocity_i_gain_)); + sync_write_data[3] = + DXL_HIBYTE(DXL_HIWORD(dxl_state->velocity_i_gain_)); + + if (port_to_sync_write_velocity_i_gain_[dxl->port_name_] != + NULL) + port_to_sync_write_velocity_i_gain_[dxl->port_name_] + ->addParam(dxl->id_, sync_write_data); + } + + // if velocity d gain value is changed -> sync write + if (result_state->velocity_d_gain_ != NONE_GAIN && + dxl_state->velocity_d_gain_ != + result_state->velocity_d_gain_) { + dxl_state->velocity_d_gain_ = result_state->velocity_d_gain_; + uint8_t sync_write_data[4] = {0}; + sync_write_data[0] = + DXL_LOBYTE(DXL_LOWORD(dxl_state->velocity_d_gain_)); + sync_write_data[1] = + DXL_HIBYTE(DXL_LOWORD(dxl_state->velocity_d_gain_)); + sync_write_data[2] = + DXL_LOBYTE(DXL_HIWORD(dxl_state->velocity_d_gain_)); + sync_write_data[3] = + DXL_HIBYTE(DXL_HIWORD(dxl_state->velocity_d_gain_)); + + if (port_to_sync_write_velocity_d_gain_[dxl->port_name_] != + NULL) + port_to_sync_write_velocity_d_gain_[dxl->port_name_] + ->addParam(dxl->id_, sync_write_data); + } + } + } else if ((*module_it)->getControlMode() == TorqueControl) { + dxl_state->goal_torque_ = result_state->goal_torque_; + + if (gazebo_mode_ == false) { + uint32_t curr_data = + dxl->convertTorque2Value(dxl_state->goal_torque_); + uint8_t sync_write_data[2] = {0}; + sync_write_data[0] = DXL_LOBYTE(curr_data); + sync_write_data[1] = DXL_HIBYTE(curr_data); + + if (port_to_sync_write_current_[dxl->port_name_] != NULL) + port_to_sync_write_current_[dxl->port_name_]->changeParam( + dxl->id_, sync_write_data); + } + } + } + } + } + + queue_mutex_.unlock(); + } + + if (DEBUG_PRINT) { + time_duration = ros::Time::now() - start_time; + fprintf(stderr, "(%2.6f) MotionModule Process() & save result \n", + time_duration.nsec * 0.000001); + } + } + + // publish present & goal position + for (auto &dxl_it : robot_->dxls_) { + std::string joint_name = dxl_it.first; + Dynamixel *dxl = dxl_it.second; + + present_state.name.push_back(joint_name); + present_state.position.push_back(dxl->dxl_state_->present_position_); + present_state.velocity.push_back(dxl->dxl_state_->present_velocity_); + present_state.effort.push_back(dxl->dxl_state_->present_torque_); + + goal_state.name.push_back(joint_name); + goal_state.position.push_back(dxl->dxl_state_->goal_position_); + goal_state.velocity.push_back(dxl->dxl_state_->goal_velocity_); + goal_state.effort.push_back(dxl->dxl_state_->goal_torque_); + } + + // -> publish present joint_states & goal joint states topic + present_joint_state_pub_.publish(present_state); + goal_joint_state_pub_.publish(goal_state); + + if (DEBUG_PRINT) { + time_duration = ros::Time::now() - start_time; + fprintf(stderr, "(%2.6f) Process() DONE \n", time_duration.nsec * 0.000001); + } + + is_process_running = false; +} + +void RobotisController::addMotionModule(MotionModule *module) { + // check whether the module name already exists + for (auto m_it = motion_modules_.begin(); m_it != motion_modules_.end(); + m_it++) { + if ((*m_it)->getModuleName() == module->getModuleName()) { + ROS_ERROR("Motion Module Name [%s] already exist !!", + module->getModuleName().c_str()); + return; + } + } + + module->initialize(robot_->getControlCycle(), robot_); + motion_modules_.push_back(module); + motion_modules_.unique(); +} + +void RobotisController::removeMotionModule(MotionModule *module) { + motion_modules_.remove(module); +} + +void RobotisController::addSensorModule(SensorModule *module) { + // check whether the module name already exists + for (auto m_it = sensor_modules_.begin(); m_it != sensor_modules_.end(); + m_it++) { + if ((*m_it)->getModuleName() == module->getModuleName()) { + ROS_ERROR("Sensor Module Name [%s] already exist !!", + module->getModuleName().c_str()); + return; + } + } + + module->initialize(robot_->getControlCycle(), robot_); + sensor_modules_.push_back(module); + sensor_modules_.unique(); +} + +void RobotisController::removeSensorModule(SensorModule *module) { + sensor_modules_.remove(module); +} + +void RobotisController::writeControlTableCallback( + const humanoid_robot_intelligence_control_system_controller_msgs:: + WriteControlTable::ConstPtr &msg) { + Device *device = NULL; + + if (DEBUG_PRINT) + fprintf(stderr, "[WriteControlTable] led control msg received\n"); + + auto dev_it1 = robot_->dxls_.find(msg->joint_name); + if (dev_it1 != robot_->dxls_.end()) { + device = dev_it1->second; + } else { + auto dev_it2 = robot_->sensors_.find(msg->joint_name); + if (dev_it2 != robot_->sensors_.end()) { + device = dev_it2->second; + } else { + ROS_WARN("[WriteControlTable] Unknown device : %s", + msg->joint_name.c_str()); + return; + } + } + + ControlTableItem *item = NULL; + auto item_it = device->ctrl_table_.find(msg->start_item_name); + if (item_it != device->ctrl_table_.end()) { + item = item_it->second; + } else { + ROS_WARN("[WriteControlTable] Unknown item : %s", + msg->start_item_name.c_str()); + return; + } + + dynamixel::PortHandler *port = robot_->ports_[device->port_name_]; + dynamixel::PacketHandler *packet_handler = + dynamixel::PacketHandler::getPacketHandler(device->protocol_version_); + + if (item->access_type_ == Read) + return; + + queue_mutex_.lock(); + + direct_sync_write_.push_back(new dynamixel::GroupSyncWrite( + port, packet_handler, item->address_, msg->data_length)); + direct_sync_write_[direct_sync_write_.size() - 1]->addParam( + device->id_, (uint8_t *)(msg->data.data())); + + // fprintf(stderr, "[WriteControlTable] %s -> %s : ", + // msg->joint_name.c_str(), msg->start_item_name.c_str()); for (auto &dt : + // msg->data) + // fprintf(stderr, "%02X ", dt); + // fprintf(stderr, "\n"); + + queue_mutex_.unlock(); +} + +void RobotisController::syncWriteItemCallback( + const humanoid_robot_intelligence_control_system_controller_msgs:: + SyncWriteItem::ConstPtr &msg) { + for (int i = 0; i < msg->joint_name.size(); i++) { + Device *device; + + auto d_it1 = robot_->dxls_.find(msg->joint_name[i]); + if (d_it1 != robot_->dxls_.end()) { + device = d_it1->second; + } else { + auto d_it2 = robot_->sensors_.find(msg->joint_name[i]); + if (d_it2 != robot_->sensors_.end()) { + device = d_it2->second; + } else { + ROS_WARN("[SyncWriteItem] Unknown device : %s", + msg->joint_name[i].c_str()); + continue; + } + } + + // ControlTableItem *item = device->ctrl_table_[msg->item_name]; + ControlTableItem *item = NULL; + auto item_it = device->ctrl_table_.find(msg->item_name); + if (item_it != device->ctrl_table_.end()) { + item = item_it->second; + } else { + ROS_WARN("SyncWriteItem] Unknown item : %s", msg->item_name.c_str()); + continue; + } + + dynamixel::PortHandler *port = robot_->ports_[device->port_name_]; + dynamixel::PacketHandler *packet_handler = + dynamixel::PacketHandler::getPacketHandler(device->protocol_version_); + + if (item->access_type_ == Read) + continue; + + queue_mutex_.lock(); + + int idx = 0; + if (direct_sync_write_.size() == 0) { + direct_sync_write_.push_back(new dynamixel::GroupSyncWrite( + port, packet_handler, item->address_, item->data_length_)); + idx = 0; + } else { + for (idx = 0; idx < direct_sync_write_.size(); idx++) { + if (direct_sync_write_[idx]->getPortHandler() == port && + direct_sync_write_[idx]->getPacketHandler() == packet_handler) + break; + } + + if (idx == direct_sync_write_.size()) + direct_sync_write_.push_back(new dynamixel::GroupSyncWrite( + port, packet_handler, item->address_, item->data_length_)); + } + + uint8_t *data = new uint8_t[item->data_length_]; + if (item->data_length_ == 1) + data[0] = (uint8_t)msg->value[i]; + else if (item->data_length_ == 2) { + data[0] = DXL_LOBYTE((uint16_t)msg->value[i]); + data[1] = DXL_HIBYTE((uint16_t)msg->value[i]); + } else if (item->data_length_ == 4) { + data[0] = DXL_LOBYTE(DXL_LOWORD((uint32_t)msg->value[i])); + data[1] = DXL_HIBYTE(DXL_LOWORD((uint32_t)msg->value[i])); + data[2] = DXL_LOBYTE(DXL_HIWORD((uint32_t)msg->value[i])); + data[3] = DXL_HIBYTE(DXL_HIWORD((uint32_t)msg->value[i])); + } + direct_sync_write_[idx]->addParam(device->id_, data); + delete[] data; + + queue_mutex_.unlock(); + } +} + +void RobotisController::setControllerModeCallback( + const std_msgs::String::ConstPtr &msg) { + if (msg->data == "DirectControlMode") { + for (auto &it : port_to_bulk_read_) { + robot_->ports_[it.first]->setPacketTimeout(0.0); + it.second->rxPacket(); + } + controller_mode_ = DirectControlMode; + } else if (msg->data == "MotionModuleMode") { + for (auto &it : port_to_bulk_read_) { + it.second->txPacket(); + } + controller_mode_ = MotionModuleMode; + } +} + +void RobotisController::setJointStatesCallback( + const sensor_msgs::JointState::ConstPtr &msg) { + queue_mutex_.lock(); + + for (int i = 0; i < msg->name.size(); i++) { + Dynamixel *dxl = robot_->dxls_[msg->name[i]]; + if (dxl == NULL) + continue; + + if ((controller_mode_ == DirectControlMode) || + (controller_mode_ == MotionModuleMode && + dxl->ctrl_module_name_ == "none")) { + dxl->dxl_state_->goal_position_ = (double)msg->position[i]; + + if (gazebo_mode_ == false) { + // add offset + uint32_t pos_data; + pos_data = dxl->convertRadian2Value(dxl->dxl_state_->goal_position_ + + dxl->dxl_state_->position_offset_ * + offset_ratio_); + + uint8_t sync_write_data[4] = {0}; + sync_write_data[0] = DXL_LOBYTE(DXL_LOWORD(pos_data)); + sync_write_data[1] = DXL_HIBYTE(DXL_LOWORD(pos_data)); + sync_write_data[2] = DXL_LOBYTE(DXL_HIWORD(pos_data)); + sync_write_data[3] = DXL_HIBYTE(DXL_HIWORD(pos_data)); + + if (port_to_sync_write_position_[dxl->port_name_] != NULL) + port_to_sync_write_position_[dxl->port_name_]->changeParam( + dxl->id_, sync_write_data); + } + } + } + + queue_mutex_.unlock(); +} + +void RobotisController::setCtrlModuleCallback( + const std_msgs::String::ConstPtr &msg) { + if (set_module_thread_.joinable()) + set_module_thread_.join(); + + std::string _module_name_to_set = msg->data; + + set_module_thread_ = boost::thread(boost::bind( + &RobotisController::setCtrlModuleThread, this, _module_name_to_set)); +} + +void RobotisController::setCtrlModule(std::string module_name) { + if (set_module_thread_.joinable()) + set_module_thread_.join(); + + set_module_thread_ = boost::thread( + boost::bind(&RobotisController::setCtrlModuleThread, this, module_name)); +} +void RobotisController::setJointCtrlModuleCallback( + const humanoid_robot_intelligence_control_system_controller_msgs:: + JointCtrlModule::ConstPtr &msg) { + if (msg->joint_name.size() != msg->module_name.size()) + return; + + if (set_module_thread_.joinable()) + set_module_thread_.join(); + + set_module_thread_ = boost::thread( + boost::bind(&RobotisController::setJointCtrlModuleThread, this, msg)); +} + +void RobotisController::enableOffsetCallback( + const std_msgs::Bool::ConstPtr &msg) { + is_offset_enabled_ = (bool)msg->data; + if (is_offset_enabled_) + offset_ratio_ = 0.0; + else + offset_ratio_ = 1.0; +} + +bool RobotisController::getJointCtrlModuleService( + humanoid_robot_intelligence_control_system_controller_msgs::GetJointModule:: + Request &req, + humanoid_robot_intelligence_control_system_controller_msgs::GetJointModule:: + Response &res) { + for (unsigned int idx = 0; idx < req.joint_name.size(); idx++) { + auto d_it = robot_->dxls_.find((std::string)(req.joint_name[idx])); + if (d_it != robot_->dxls_.end()) { + res.joint_name.push_back(req.joint_name[idx]); + res.module_name.push_back(d_it->second->ctrl_module_name_); + } + } + + if (res.joint_name.size() == 0) + return false; + + return true; +} + +bool RobotisController::setJointCtrlModuleService( + humanoid_robot_intelligence_control_system_controller_msgs::SetJointModule:: + Request &req, + humanoid_robot_intelligence_control_system_controller_msgs::SetJointModule:: + Response &res) { + if (set_module_thread_.joinable()) + set_module_thread_.join(); + + humanoid_robot_intelligence_control_system_controller_msgs::JointCtrlModule + modules; + modules.joint_name = req.joint_name; + modules.module_name = req.module_name; + + humanoid_robot_intelligence_control_system_controller_msgs::JointCtrlModule:: + ConstPtr msg_ptr( + new humanoid_robot_intelligence_control_system_controller_msgs:: + JointCtrlModule(modules)); + + if (modules.joint_name.size() != modules.module_name.size()) + return false; + + set_module_thread_ = boost::thread( + boost::bind(&RobotisController::setJointCtrlModuleThread, this, msg_ptr)); + + set_module_thread_.join(); + + return true; +} + +bool RobotisController::setCtrlModuleService( + humanoid_robot_intelligence_control_system_controller_msgs::SetModule:: + Request &req, + humanoid_robot_intelligence_control_system_controller_msgs::SetModule:: + Response &res) { + if (set_module_thread_.joinable()) + set_module_thread_.join(); + + std::string _module_name_to_set = req.module_name; + + set_module_thread_ = boost::thread(boost::bind( + &RobotisController::setCtrlModuleThread, this, _module_name_to_set)); + + set_module_thread_.join(); + + res.result = true; + return true; +} + +bool RobotisController::loadOffsetService( + humanoid_robot_intelligence_control_system_controller_msgs::LoadOffset:: + Request &req, + humanoid_robot_intelligence_control_system_controller_msgs::LoadOffset:: + Response &res) { + loadOffset((std::string)req.file_path); + res.result = true; + return true; +} + +void RobotisController::setJointCtrlModuleThread( + const humanoid_robot_intelligence_control_system_controller_msgs:: + JointCtrlModule::ConstPtr &msg) { + // stop module list + std::list _stop_modules; + std::list _enable_modules; + + for (unsigned int idx = 0; idx < msg->joint_name.size(); idx++) { + Dynamixel *_dxl = NULL; + std::map::iterator _dxl_it = + robot_->dxls_.find((std::string)(msg->joint_name[idx])); + if (_dxl_it != robot_->dxls_.end()) + _dxl = _dxl_it->second; + else + continue; + + // enqueue + if (_dxl->ctrl_module_name_ != msg->module_name[idx]) { + for (std::list::iterator _stop_m_it = + motion_modules_.begin(); + _stop_m_it != motion_modules_.end(); _stop_m_it++) { + if ((*_stop_m_it)->getModuleName() == _dxl->ctrl_module_name_ && + (*_stop_m_it)->getModuleEnable() == true) + _stop_modules.push_back(*_stop_m_it); + } + } + } + + // stop the module + _stop_modules.unique(); + for (std::list::iterator _stop_m_it = _stop_modules.begin(); + _stop_m_it != _stop_modules.end(); _stop_m_it++) { + (*_stop_m_it)->stop(); + } + + // wait to stop + for (std::list::iterator _stop_m_it = _stop_modules.begin(); + _stop_m_it != _stop_modules.end(); _stop_m_it++) { + while ((*_stop_m_it)->isRunning()) + usleep(robot_->getControlCycle() * 1000); + } + + // disable module(s) + for (std::list::iterator _stop_m_it = _stop_modules.begin(); + _stop_m_it != _stop_modules.end(); _stop_m_it++) { + (*_stop_m_it)->setModuleEnable(false); + } + + // set ctrl module + queue_mutex_.lock(); + + for (unsigned int idx = 0; idx < msg->joint_name.size(); idx++) { + std::string ctrl_module = msg->module_name[idx]; + std::string joint_name = msg->joint_name[idx]; + + Dynamixel *_dxl = NULL; + std::map::iterator _dxl_it = + robot_->dxls_.find(joint_name); + if (_dxl_it != robot_->dxls_.end()) + _dxl = _dxl_it->second; + else + continue; + + // none + if (ctrl_module == "" || ctrl_module == "none") { + _dxl->ctrl_module_name_ = "none"; + + if (gazebo_mode_ == true) + continue; + + uint32_t _pos_data; + _pos_data = _dxl->convertRadian2Value(_dxl->dxl_state_->goal_position_ + + _dxl->dxl_state_->position_offset_ * + offset_ratio_); + + uint8_t _sync_write_data[4]; + _sync_write_data[0] = DXL_LOBYTE(DXL_LOWORD(_pos_data)); + _sync_write_data[1] = DXL_HIBYTE(DXL_LOWORD(_pos_data)); + _sync_write_data[2] = DXL_LOBYTE(DXL_HIWORD(_pos_data)); + _sync_write_data[3] = DXL_HIBYTE(DXL_HIWORD(_pos_data)); + + if (port_to_sync_write_position_[_dxl->port_name_] != NULL) + port_to_sync_write_position_[_dxl->port_name_]->addParam( + _dxl->id_, _sync_write_data); + + if (port_to_sync_write_current_[_dxl->port_name_] != NULL) + port_to_sync_write_current_[_dxl->port_name_]->removeParam(_dxl->id_); + if (port_to_sync_write_velocity_[_dxl->port_name_] != NULL) + port_to_sync_write_velocity_[_dxl->port_name_]->removeParam(_dxl->id_); + } else { + // check whether the module exist + for (std::list::iterator _m_it = motion_modules_.begin(); + _m_it != motion_modules_.end(); _m_it++) { + // if it exist + if ((*_m_it)->getModuleName() == ctrl_module) { + std::map::iterator _result_it = + (*_m_it)->result_.find(joint_name); + if (_result_it == (*_m_it)->result_.end()) + break; + + _dxl->ctrl_module_name_ = ctrl_module; + + // enqueue enable module list + _enable_modules.push_back(*_m_it); + ControlMode _mode = (*_m_it)->getControlMode(); + + if (gazebo_mode_ == true) + break; + + if (_mode == PositionControl) { + uint32_t _pos_data; + _pos_data = _dxl->convertRadian2Value( + _dxl->dxl_state_->goal_position_ + + _dxl->dxl_state_->position_offset_ * offset_ratio_); + + uint8_t _sync_write_data[4]; + _sync_write_data[0] = DXL_LOBYTE(DXL_LOWORD(_pos_data)); + _sync_write_data[1] = DXL_HIBYTE(DXL_LOWORD(_pos_data)); + _sync_write_data[2] = DXL_LOBYTE(DXL_HIWORD(_pos_data)); + _sync_write_data[3] = DXL_HIBYTE(DXL_HIWORD(_pos_data)); + + if (port_to_sync_write_position_[_dxl->port_name_] != NULL) + port_to_sync_write_position_[_dxl->port_name_]->addParam( + _dxl->id_, _sync_write_data); + + if (port_to_sync_write_current_[_dxl->port_name_] != NULL) + port_to_sync_write_current_[_dxl->port_name_]->removeParam( + _dxl->id_); + if (port_to_sync_write_velocity_[_dxl->port_name_] != NULL) + port_to_sync_write_velocity_[_dxl->port_name_]->removeParam( + _dxl->id_); + } else if (_mode == VelocityControl) { + uint32_t _vel_data = + _dxl->convertVelocity2Value(_dxl->dxl_state_->goal_velocity_); + uint8_t _sync_write_data[4]; + _sync_write_data[0] = DXL_LOBYTE(DXL_LOWORD(_vel_data)); + _sync_write_data[1] = DXL_HIBYTE(DXL_LOWORD(_vel_data)); + _sync_write_data[2] = DXL_LOBYTE(DXL_HIWORD(_vel_data)); + _sync_write_data[3] = DXL_HIBYTE(DXL_HIWORD(_vel_data)); + + if (port_to_sync_write_velocity_[_dxl->port_name_] != NULL) + port_to_sync_write_velocity_[_dxl->port_name_]->addParam( + _dxl->id_, _sync_write_data); + + if (port_to_sync_write_current_[_dxl->port_name_] != NULL) + port_to_sync_write_current_[_dxl->port_name_]->removeParam( + _dxl->id_); + if (port_to_sync_write_position_[_dxl->port_name_] != NULL) + port_to_sync_write_position_[_dxl->port_name_]->removeParam( + _dxl->id_); + } else if (_mode == TorqueControl) { + uint32_t _curr_data = + _dxl->convertTorque2Value(_dxl->dxl_state_->goal_torque_); + uint8_t _sync_write_data[4]; + _sync_write_data[0] = DXL_LOBYTE(DXL_LOWORD(_curr_data)); + _sync_write_data[1] = DXL_HIBYTE(DXL_LOWORD(_curr_data)); + _sync_write_data[2] = DXL_LOBYTE(DXL_HIWORD(_curr_data)); + _sync_write_data[3] = DXL_HIBYTE(DXL_HIWORD(_curr_data)); + + if (port_to_sync_write_current_[_dxl->port_name_] != NULL) + port_to_sync_write_current_[_dxl->port_name_]->addParam( + _dxl->id_, _sync_write_data); + + if (port_to_sync_write_velocity_[_dxl->port_name_] != NULL) + port_to_sync_write_velocity_[_dxl->port_name_]->removeParam( + _dxl->id_); + if (port_to_sync_write_position_[_dxl->port_name_] != NULL) + port_to_sync_write_position_[_dxl->port_name_]->removeParam( + _dxl->id_); + } + break; + } + } + } + } + + // enable module(s) + _enable_modules.unique(); + for (std::list::iterator _m_it = _enable_modules.begin(); + _m_it != _enable_modules.end(); _m_it++) { + (*_m_it)->setModuleEnable(true); + } + + // TODO: set indirect address + // -> check module's control_mode + + queue_mutex_.unlock(); + + // publish current module + humanoid_robot_intelligence_control_system_controller_msgs::JointCtrlModule + _current_module_msg; + for (std::map::iterator _dxl_iter = + robot_->dxls_.begin(); + _dxl_iter != robot_->dxls_.end(); ++_dxl_iter) { + _current_module_msg.joint_name.push_back(_dxl_iter->first); + _current_module_msg.module_name.push_back( + _dxl_iter->second->ctrl_module_name_); + } + + if (_current_module_msg.joint_name.size() == + _current_module_msg.module_name.size()) + current_module_pub_.publish(_current_module_msg); +} + +void RobotisController::setCtrlModuleThread(std::string ctrl_module) { + // stop module + std::list stop_modules; + + if (ctrl_module == "" || ctrl_module == "none") { + // enqueue all modules in order to stop + for (auto m_it = motion_modules_.begin(); m_it != motion_modules_.end(); + m_it++) { + if ((*m_it)->getModuleEnable() == true) + stop_modules.push_back(*m_it); + } + } else { + for (auto m_it = motion_modules_.begin(); m_it != motion_modules_.end(); + m_it++) { + // if it exist + if ((*m_it)->getModuleName() == ctrl_module) { + // enqueue the module which lost control of joint in order to stop + for (auto &result_it : (*m_it)->result_) { + auto d_it = robot_->dxls_.find(result_it.first); + + if (d_it != robot_->dxls_.end()) { + // enqueue + if (d_it->second->ctrl_module_name_ != ctrl_module) { + for (auto stop_m_it = motion_modules_.begin(); + stop_m_it != motion_modules_.end(); stop_m_it++) { + if (((*stop_m_it)->getModuleName() == + d_it->second->ctrl_module_name_) && + ((*stop_m_it)->getModuleEnable() == true)) { + stop_modules.push_back(*stop_m_it); + } + } + } + } + } + + break; + } + } + } + + // stop the module + stop_modules.unique(); + for (auto stop_m_it = stop_modules.begin(); stop_m_it != stop_modules.end(); + stop_m_it++) { + (*stop_m_it)->stop(); + } + + // wait to stop + for (auto stop_m_it = stop_modules.begin(); stop_m_it != stop_modules.end(); + stop_m_it++) { + while ((*stop_m_it)->isRunning()) + usleep(robot_->getControlCycle() * 1000); + } + + // disable module(s) + for (std::list::iterator _stop_m_it = stop_modules.begin(); + _stop_m_it != stop_modules.end(); _stop_m_it++) { + (*_stop_m_it)->setModuleEnable(false); + } + + // set ctrl module + queue_mutex_.lock(); + + if (DEBUG_PRINT) + ROS_INFO_STREAM("set module : " << ctrl_module); + + // none + if ((ctrl_module == "") || (ctrl_module == "none")) { + // set dxl's control module to "none" + for (auto &d_it : robot_->dxls_) { + Dynamixel *dxl = d_it.second; + dxl->ctrl_module_name_ = "none"; + + if (gazebo_mode_ == true) + continue; + + uint32_t pos_data; + pos_data = dxl->convertRadian2Value(dxl->dxl_state_->goal_position_ + + dxl->dxl_state_->position_offset_ * + offset_ratio_); + + uint8_t sync_write_data[4] = {0}; + sync_write_data[0] = DXL_LOBYTE(DXL_LOWORD(pos_data)); + sync_write_data[1] = DXL_HIBYTE(DXL_LOWORD(pos_data)); + sync_write_data[2] = DXL_LOBYTE(DXL_HIWORD(pos_data)); + sync_write_data[3] = DXL_HIBYTE(DXL_HIWORD(pos_data)); + + if (port_to_sync_write_position_[dxl->port_name_] != NULL) + port_to_sync_write_position_[dxl->port_name_]->addParam( + dxl->id_, sync_write_data); + + if (port_to_sync_write_current_[dxl->port_name_] != NULL) + port_to_sync_write_current_[dxl->port_name_]->removeParam(dxl->id_); + if (port_to_sync_write_velocity_[dxl->port_name_] != NULL) + port_to_sync_write_velocity_[dxl->port_name_]->removeParam(dxl->id_); + } + } else { + // check whether the module exist + for (auto m_it = motion_modules_.begin(); m_it != motion_modules_.end(); + m_it++) { + // if it exist + if ((*m_it)->getModuleName() == ctrl_module) { + ControlMode mode = (*m_it)->getControlMode(); + for (auto &result_it : (*m_it)->result_) { + auto d_it = robot_->dxls_.find(result_it.first); + if (d_it != robot_->dxls_.end()) { + Dynamixel *dxl = d_it->second; + dxl->ctrl_module_name_ = ctrl_module; + + if (gazebo_mode_ == true) + continue; + + if (mode == PositionControl) { + uint32_t pos_data; + pos_data = dxl->convertRadian2Value( + dxl->dxl_state_->goal_position_ + + dxl->dxl_state_->position_offset_ * offset_ratio_); + + uint8_t sync_write_data[4] = {0}; + sync_write_data[0] = DXL_LOBYTE(DXL_LOWORD(pos_data)); + sync_write_data[1] = DXL_HIBYTE(DXL_LOWORD(pos_data)); + sync_write_data[2] = DXL_LOBYTE(DXL_HIWORD(pos_data)); + sync_write_data[3] = DXL_HIBYTE(DXL_HIWORD(pos_data)); + + if (port_to_sync_write_position_[dxl->port_name_] != NULL) + port_to_sync_write_position_[dxl->port_name_]->addParam( + dxl->id_, sync_write_data); + + if (port_to_sync_write_current_[dxl->port_name_] != NULL) + port_to_sync_write_current_[dxl->port_name_]->removeParam( + dxl->id_); + if (port_to_sync_write_velocity_[dxl->port_name_] != NULL) + port_to_sync_write_velocity_[dxl->port_name_]->removeParam( + dxl->id_); + } else if (mode == VelocityControl) { + uint32_t vel_data = + dxl->convertVelocity2Value(dxl->dxl_state_->goal_velocity_); + uint8_t sync_write_data[4] = {0}; + sync_write_data[0] = DXL_LOBYTE(DXL_LOWORD(vel_data)); + sync_write_data[1] = DXL_HIBYTE(DXL_LOWORD(vel_data)); + sync_write_data[2] = DXL_LOBYTE(DXL_HIWORD(vel_data)); + sync_write_data[3] = DXL_HIBYTE(DXL_HIWORD(vel_data)); + + if (port_to_sync_write_velocity_[dxl->port_name_] != NULL) + port_to_sync_write_velocity_[dxl->port_name_]->addParam( + dxl->id_, sync_write_data); + + if (port_to_sync_write_current_[dxl->port_name_] != NULL) + port_to_sync_write_current_[dxl->port_name_]->removeParam( + dxl->id_); + if (port_to_sync_write_position_[dxl->port_name_] != NULL) + port_to_sync_write_position_[dxl->port_name_]->removeParam( + dxl->id_); + } else if (mode == TorqueControl) { + uint32_t curr_data = + dxl->convertTorque2Value(dxl->dxl_state_->goal_torque_); + uint8_t sync_write_data[4] = {0}; + sync_write_data[0] = DXL_LOBYTE(DXL_LOWORD(curr_data)); + sync_write_data[1] = DXL_HIBYTE(DXL_LOWORD(curr_data)); + sync_write_data[2] = DXL_LOBYTE(DXL_HIWORD(curr_data)); + sync_write_data[3] = DXL_HIBYTE(DXL_HIWORD(curr_data)); + + if (port_to_sync_write_current_[dxl->port_name_] != NULL) + port_to_sync_write_current_[dxl->port_name_]->addParam( + dxl->id_, sync_write_data); + + if (port_to_sync_write_velocity_[dxl->port_name_] != NULL) + port_to_sync_write_velocity_[dxl->port_name_]->removeParam( + dxl->id_); + if (port_to_sync_write_position_[dxl->port_name_] != NULL) + port_to_sync_write_position_[dxl->port_name_]->removeParam( + dxl->id_); + } + } + } + + break; + } + } + } + + for (auto m_it = motion_modules_.begin(); m_it != motion_modules_.end(); + m_it++) { + // set all used modules -> enable + for (auto &d_it : robot_->dxls_) { + if (d_it.second->ctrl_module_name_ == (*m_it)->getModuleName()) { + (*m_it)->setModuleEnable(true); + break; + } + } + } + + // TODO: set indirect address + // -> check module's control_mode + + queue_mutex_.unlock(); + + // publish current module + humanoid_robot_intelligence_control_system_controller_msgs::JointCtrlModule + current_module_msg; + for (auto &dxl_iter : robot_->dxls_) { + current_module_msg.joint_name.push_back(dxl_iter.first); + current_module_msg.module_name.push_back( + dxl_iter.second->ctrl_module_name_); + } + + if (current_module_msg.joint_name.size() == + current_module_msg.module_name.size()) + current_module_pub_.publish(current_module_msg); +} + +void RobotisController::gazeboJointStatesCallback( + const sensor_msgs::JointState::ConstPtr &msg) { + queue_mutex_.lock(); + + for (unsigned int i = 0; i < msg->name.size(); i++) { + auto d_it = robot_->dxls_.find((std::string)msg->name[i]); + if (d_it != robot_->dxls_.end()) { + d_it->second->dxl_state_->present_position_ = msg->position[i]; + d_it->second->dxl_state_->present_velocity_ = msg->velocity[i]; + d_it->second->dxl_state_->present_torque_ = msg->effort[i]; + } + } + + if (init_pose_loaded_ == false) { + for (auto &it : robot_->dxls_) + it.second->dxl_state_->goal_position_ = + it.second->dxl_state_->present_position_; + init_pose_loaded_ = true; + } + + queue_mutex_.unlock(); +} + +bool RobotisController::isTimerStopped() { + if (this->is_timer_running_) { + if (DEBUG_PRINT == true) + ROS_WARN("Process Timer is running.. STOP the timer first."); + return false; + } + return true; +} + +int RobotisController::ping(const std::string joint_name, uint8_t *error) { + return ping(joint_name, 0, error); +} +int RobotisController::ping(const std::string joint_name, + uint16_t *model_number, uint8_t *error) { + if (isTimerStopped() == false) + return COMM_PORT_BUSY; + + Dynamixel *dxl = robot_->dxls_[joint_name]; + if (dxl == NULL) + return COMM_NOT_AVAILABLE; + + dynamixel::PacketHandler *pkt_handler = + dynamixel::PacketHandler::getPacketHandler(dxl->protocol_version_); + dynamixel::PortHandler *port_handler = robot_->ports_[dxl->port_name_]; + + return pkt_handler->ping(port_handler, dxl->id_, model_number, error); +} + +int RobotisController::action(const std::string joint_name) { + if (isTimerStopped() == false) + return COMM_PORT_BUSY; + + Dynamixel *dxl = robot_->dxls_[joint_name]; + if (dxl == NULL) + return COMM_NOT_AVAILABLE; + + dynamixel::PacketHandler *pkt_handler = + dynamixel::PacketHandler::getPacketHandler(dxl->protocol_version_); + dynamixel::PortHandler *port_handler = robot_->ports_[dxl->port_name_]; + + return pkt_handler->action(port_handler, dxl->id_); +} +int RobotisController::reboot(const std::string joint_name, uint8_t *error) { + if (isTimerStopped() == false) + return COMM_PORT_BUSY; + + Dynamixel *dxl = robot_->dxls_[joint_name]; + if (dxl == NULL) + return COMM_NOT_AVAILABLE; + + dynamixel::PacketHandler *pkt_handler = + dynamixel::PacketHandler::getPacketHandler(dxl->protocol_version_); + dynamixel::PortHandler *port_handler = robot_->ports_[dxl->port_name_]; + + return pkt_handler->reboot(port_handler, dxl->id_, error); +} +int RobotisController::factoryReset(const std::string joint_name, + uint8_t option, uint8_t *error) { + if (isTimerStopped() == false) + return COMM_PORT_BUSY; + + Dynamixel *dxl = robot_->dxls_[joint_name]; + if (dxl == NULL) + return COMM_NOT_AVAILABLE; + + dynamixel::PacketHandler *pkt_handler = + dynamixel::PacketHandler::getPacketHandler(dxl->protocol_version_); + dynamixel::PortHandler *port_handler = robot_->ports_[dxl->port_name_]; + + return pkt_handler->factoryReset(port_handler, dxl->id_, option, error); +} + +int RobotisController::read(const std::string joint_name, uint16_t address, + uint16_t length, uint8_t *data, uint8_t *error) { + if (isTimerStopped() == false) + return COMM_PORT_BUSY; + + Dynamixel *dxl = robot_->dxls_[joint_name]; + if (dxl == NULL) + return COMM_NOT_AVAILABLE; + + dynamixel::PacketHandler *pkt_handler = + dynamixel::PacketHandler::getPacketHandler(dxl->protocol_version_); + dynamixel::PortHandler *port_handler = robot_->ports_[dxl->port_name_]; + + return pkt_handler->readTxRx(port_handler, dxl->id_, address, length, data, + error); +} + +int RobotisController::readCtrlItem(const std::string joint_name, + const std::string item_name, uint32_t *data, + uint8_t *error) { + if (isTimerStopped() == false) + return COMM_PORT_BUSY; + + Dynamixel *dxl = robot_->dxls_[joint_name]; + if (dxl == NULL) + return COMM_NOT_AVAILABLE; + + ControlTableItem *item = dxl->ctrl_table_[item_name]; + if (item == NULL) + return COMM_NOT_AVAILABLE; + + dynamixel::PacketHandler *pkt_handler = + dynamixel::PacketHandler::getPacketHandler(dxl->protocol_version_); + dynamixel::PortHandler *port_handler = robot_->ports_[dxl->port_name_]; + + int result = COMM_NOT_AVAILABLE; + switch (item->data_length_) { + case 1: { + uint8_t read_data = 0; + result = pkt_handler->read1ByteTxRx(port_handler, dxl->id_, item->address_, + &read_data, error); + if (result == COMM_SUCCESS) + *data = read_data; + break; + } + case 2: { + uint16_t read_data = 0; + result = pkt_handler->read2ByteTxRx(port_handler, dxl->id_, item->address_, + &read_data, error); + if (result == COMM_SUCCESS) + *data = read_data; + break; + } + case 4: { + uint32_t read_data = 0; + result = pkt_handler->read4ByteTxRx(port_handler, dxl->id_, item->address_, + &read_data, error); + if (result == COMM_SUCCESS) + *data = read_data; + break; + } + default: + break; + } + return result; +} + +int RobotisController::read1Byte(const std::string joint_name, uint16_t address, + uint8_t *data, uint8_t *error) { + if (isTimerStopped() == false) + return COMM_PORT_BUSY; + + Dynamixel *dxl = robot_->dxls_[joint_name]; + if (dxl == NULL) + return COMM_NOT_AVAILABLE; + + dynamixel::PacketHandler *pkt_handler = + dynamixel::PacketHandler::getPacketHandler(dxl->protocol_version_); + dynamixel::PortHandler *port_handler = robot_->ports_[dxl->port_name_]; + + return pkt_handler->read1ByteTxRx(port_handler, dxl->id_, address, data, + error); +} + +int RobotisController::read2Byte(const std::string joint_name, uint16_t address, + uint16_t *data, uint8_t *error) { + if (isTimerStopped() == false) + return COMM_PORT_BUSY; + + Dynamixel *dxl = robot_->dxls_[joint_name]; + if (dxl == NULL) + return COMM_NOT_AVAILABLE; + + dynamixel::PacketHandler *pkt_handler = + dynamixel::PacketHandler::getPacketHandler(dxl->protocol_version_); + dynamixel::PortHandler *port_handler = robot_->ports_[dxl->port_name_]; + + return pkt_handler->read2ByteTxRx(port_handler, dxl->id_, address, data, + error); +} + +int RobotisController::read4Byte(const std::string joint_name, uint16_t address, + uint32_t *data, uint8_t *error) { + if (isTimerStopped() == false) + return COMM_PORT_BUSY; + + Dynamixel *dxl = robot_->dxls_[joint_name]; + if (dxl == NULL) + return COMM_NOT_AVAILABLE; + + dynamixel::PacketHandler *pkt_handler = + dynamixel::PacketHandler::getPacketHandler(dxl->protocol_version_); + dynamixel::PortHandler *port_handler = robot_->ports_[dxl->port_name_]; + + return pkt_handler->read4ByteTxRx(port_handler, dxl->id_, address, data, + error); +} + +int RobotisController::write(const std::string joint_name, uint16_t address, + uint16_t length, uint8_t *data, uint8_t *error) { + if (isTimerStopped() == false) + return COMM_PORT_BUSY; + + Dynamixel *dxl = robot_->dxls_[joint_name]; + if (dxl == NULL) + return COMM_NOT_AVAILABLE; + + dynamixel::PacketHandler *pkt_handler = + dynamixel::PacketHandler::getPacketHandler(dxl->protocol_version_); + dynamixel::PortHandler *port_handler = robot_->ports_[dxl->port_name_]; + + return pkt_handler->writeTxRx(port_handler, dxl->id_, address, length, data, + error); +} + +int RobotisController::writeCtrlItem(const std::string joint_name, + const std::string item_name, uint32_t data, + uint8_t *error) { + if (isTimerStopped() == false) + return COMM_PORT_BUSY; + + Dynamixel *dxl = robot_->dxls_[joint_name]; + if (dxl == NULL) + return COMM_NOT_AVAILABLE; + + ControlTableItem *item = dxl->ctrl_table_[item_name]; + if (item == NULL) + return COMM_NOT_AVAILABLE; + + dynamixel::PacketHandler *pkt_handler = + dynamixel::PacketHandler::getPacketHandler(dxl->protocol_version_); + dynamixel::PortHandler *port_handler = robot_->ports_[dxl->port_name_]; + + int result = COMM_NOT_AVAILABLE; + uint8_t *write_data = new uint8_t[item->data_length_]; + if (item->data_length_ == 1) { + write_data[0] = (uint8_t)data; + result = pkt_handler->write1ByteTxRx(port_handler, dxl->id_, item->address_, + data, error); + } else if (item->data_length_ == 2) { + write_data[0] = DXL_LOBYTE((uint16_t)data); + write_data[1] = DXL_HIBYTE((uint16_t)data); + result = pkt_handler->write2ByteTxRx(port_handler, dxl->id_, item->address_, + data, error); + } else if (item->data_length_ == 4) { + write_data[0] = DXL_LOBYTE(DXL_LOWORD((uint32_t)data)); + write_data[1] = DXL_HIBYTE(DXL_LOWORD((uint32_t)data)); + write_data[2] = DXL_LOBYTE(DXL_HIWORD((uint32_t)data)); + write_data[3] = DXL_HIBYTE(DXL_HIWORD((uint32_t)data)); + result = pkt_handler->write4ByteTxRx(port_handler, dxl->id_, item->address_, + data, error); + } + delete[] write_data; + return result; +} + +int RobotisController::write1Byte(const std::string joint_name, + uint16_t address, uint8_t data, + uint8_t *error) { + if (isTimerStopped() == false) + return COMM_PORT_BUSY; + + Dynamixel *dxl = robot_->dxls_[joint_name]; + if (dxl == NULL) + return COMM_NOT_AVAILABLE; + + dynamixel::PacketHandler *pkt_handler = + dynamixel::PacketHandler::getPacketHandler(dxl->protocol_version_); + dynamixel::PortHandler *port_handler = robot_->ports_[dxl->port_name_]; + + return pkt_handler->write1ByteTxRx(port_handler, dxl->id_, address, data, + error); +} + +int RobotisController::write2Byte(const std::string joint_name, + uint16_t address, uint16_t data, + uint8_t *error) { + if (isTimerStopped() == false) + return COMM_PORT_BUSY; + + Dynamixel *dxl = robot_->dxls_[joint_name]; + if (dxl == NULL) + return COMM_NOT_AVAILABLE; + + dynamixel::PacketHandler *pkt_handler = + dynamixel::PacketHandler::getPacketHandler(dxl->protocol_version_); + dynamixel::PortHandler *port_handler = robot_->ports_[dxl->port_name_]; + + return pkt_handler->write2ByteTxRx(port_handler, dxl->id_, address, data, + error); +} + +int RobotisController::write4Byte(const std::string joint_name, + uint16_t address, uint32_t data, + uint8_t *error) { + if (isTimerStopped() == false) + return COMM_PORT_BUSY; + + Dynamixel *dxl = robot_->dxls_[joint_name]; + if (dxl == NULL) + return COMM_NOT_AVAILABLE; + + dynamixel::PacketHandler *pkt_handler = + dynamixel::PacketHandler::getPacketHandler(dxl->protocol_version_); + dynamixel::PortHandler *port_handler = robot_->ports_[dxl->port_name_]; + + return pkt_handler->write4ByteTxRx(port_handler, dxl->id_, address, data, + error); +} + +int RobotisController::regWrite(const std::string joint_name, uint16_t address, + uint16_t length, uint8_t *data, + uint8_t *error) { + if (isTimerStopped() == false) + return COMM_PORT_BUSY; + + Dynamixel *dxl = robot_->dxls_[joint_name]; + if (dxl == NULL) + return COMM_NOT_AVAILABLE; + + dynamixel::PacketHandler *pkt_handler = + dynamixel::PacketHandler::getPacketHandler(dxl->protocol_version_); + dynamixel::PortHandler *port_handler = robot_->ports_[dxl->port_name_]; + + return pkt_handler->regWriteTxRx(port_handler, dxl->id_, address, length, + data, error); +} diff --git a/humanoid_robot_intelligence_control_system_device/CHANGELOG.rst b/humanoid_robot_intelligence_control_system_device/CHANGELOG.rst new file mode 100755 index 0000000..10a041c --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/CHANGELOG.rst @@ -0,0 +1,110 @@ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Changelog for package humanoid_robot_intelligence_control_system_device +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +0.3.2 (2023-10-03) +------------------ +* Make it compatible for ROS1/ROS2 +* Fix bugs +* Update package.xml and CMakeList.txt for to the latest versions +* Contributors & Maintainer: Ronaldson Bellande + +0.3.1 (2023-09-27) +------------------ +* Starting from this point it under a new license +* Fix errors and Issues +* Rename Repository for a completely different purpose +* Make it compatible with ROS/ROS2 +* Upgrade version of all builds and make it more compatible +* Update package.xml and CMakeList.txt for to the latest versions +* Contributors & Maintainer: Ronaldson Bellande + +0.3.0 (2021-05-03) +------------------ +* Update package.xml and CMakeList.txt for noetic branch +* Contributors: Ronaldson Bellande + +0.2.9 (2018-03-22) +------------------ +* modified to prevent duplicate indirect address write +* fixed a bug that occure when handling bulk read item that does not exist +* Contributors: Zerom + +0.2.8 (2018-03-20) +------------------ +* added RH-P12-RN.device file +* Contributors: Zerom, Pyo + +0.2.7 (2018-03-15) +------------------ +* fixed a bug that occur when handling bulk read item that does not exist +* changed the License and package format to version 2 +* Contributors: SCH, Pyo + +0.2.6 (2017-08-09) +------------------ +* OpenCR control table item name changed. (torque_enable -> dynamixel_power) +* fixed to not update update_time_stamp\_ if bulk read fails. +* Contributors: Zerom + +0.2.5 (2017-06-09) +------------------ +* none + +0.2.4 (2017-06-07) +------------------ +* none + +0.2.3 (2017-05-23) +------------------ +* updated the cmake file for ros install +* Contributors: SCH + +0.2.2 (2017-04-24) +------------------ +* added a deivce: OpenCR +* changed to read control cycle from .robot file +* Contributors: Zerom, Kayman + +0.2.1 (2016-11-23) +------------------ +* Merge the changes and update +* mode change debugging +* - convertRadian2Value / convertValue2Radian : commented out the code that limits the maximum/minimum value. +* - modified dependency problem. +* Contributors: Jay Song, Pyo, Zerom, SCH + +0.2.0 (2016-08-31) +------------------ +* bug fixed (position pid gain & velocity pid gain sync write). +* added velocity_to_value_ratio to DXL Pro-H series. +* added velocity p/i/d gain and position i/d gain sync_write code. +* fixed humanoid_robot_intelligence_control_system_device build_depend. +* added XM-430-W210 / XM-430-W350 device file. +* rename (present_current\_ -> present_torque\_) +* modified torque control code +* added device file for MX-64 / MX-106 +* adjusted position min/max value. (MX-28, XM-430) +* Contributors: Zerom, Pyo + +0.1.1 (2016-08-18) +------------------ +* updated the package information +* Contributors: Zerom + +0.1.0 (2016-08-12) +------------------ +* first public release for Kinetic +* modified the package information for release +* develop branch -> master branch +* Setting the license to BSD. +* add SensorState + add Singleton template +* XM-430 / CM-740 device file added. + Sensor device added. +* modified. +* variable name changed. + ConvertRadian2Value / ConvertValue2Radian function bug fixed. +* added code to support the gazebo simulator +* renewal +* Contributors: Zerom diff --git a/humanoid_robot_intelligence_control_system_device/CMakeLists.txt b/humanoid_robot_intelligence_control_system_device/CMakeLists.txt new file mode 100755 index 0000000..a9c5f39 --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/CMakeLists.txt @@ -0,0 +1,51 @@ +cmake_minimum_required(VERSION 3.8) +project(humanoid_robot_intelligence_control_system_device) + + +if($ENV{ROS_VERSION} EQUAL 1) + find_package(catkin REQUIRED COMPONENTS + roscpp + dynamixel_sdk + ) +else() + find_package(ament_cmake REQUIRED) +endif() + + +if($ENV{ROS_VERSION} EQUAL 1) + catkin_package( + INCLUDE_DIRS include + LIBRARIES humanoid_robot_intelligence_control_system_device + CATKIN_DEPENDS + roscpp + dynamixel_sdk + ) +endif() + + +include_directories( + include + ${catkin_INCLUDE_DIRS} +) + +add_library(humanoid_robot_intelligence_control_system_device + src/humanoid_robot_intelligence_control_system_device/robot.cpp + src/humanoid_robot_intelligence_control_system_device/sensor.cpp + src/humanoid_robot_intelligence_control_system_device/dynamixel.cpp +) +add_dependencies(humanoid_robot_intelligence_control_system_device ${catkin_EXPORTED_TARGETS}) +target_link_libraries(humanoid_robot_intelligence_control_system_device ${catkin_LIBRARIES}) + +install(TARGETS humanoid_robot_intelligence_control_system_device + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} +) + +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} +) + +install(DIRECTORY devices + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} +) diff --git a/humanoid_robot_intelligence_control_system_device/devices/dynamixel/GRIPPER.device b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/GRIPPER.device new file mode 100755 index 0000000..7e0846d --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/GRIPPER.device @@ -0,0 +1,73 @@ +[device info] +model_name = GRIPPER +device_type = dynamixel + +[type info] +value_of_0_radian_position = 0 +value_of_min_radian_position = 0 +value_of_max_radian_position = 750 +min_radian = 0 +max_radian = 1.150767 + +torque_enable_item_name = torque_enable +present_position_item_name = present_position +present_velocity_item_name = present_velocity +present_current_item_name = present_current +goal_position_item_name = goal_position +goal_velocity_item_name = goal_velocity +goal_current_item_name = goal_torque +position_d_gain_item_name = +position_i_gain_item_name = +position_p_gain_item_name = position_p_gain +velocity_d_gain_item_name = +velocity_i_gain_item_name = velocity_i_gain +velocity_p_gain_item_name = velocity_p_gain + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 6 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 7 | ID | 1 | RW | EEPROM | 0 | 252 | N + 8 | baudrate | 1 | RW | EEPROM | 0 | 8 | N + 9 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 11 | operating_mode | 1 | RW | EEPROM | 0 | 4 | N + 17 | moving_threshold | 4 | RW | EEPROM | 0 | 2147483647 | N + 21 | max_temperature_limit | 1 | RW | EEPROM | 0 | 100 | N + 22 | max_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 24 | min_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 26 | acceleration_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 30 | torque_limit | 2 | RW | EEPROM | 0 | 32767 | N + 32 | velocity_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 36 | max_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 40 | min_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 44 | external_port_mod_1 | 1 | RW | EEPROM | 0 | 3 | N + 45 | external_port_mod_2 | 1 | RW | EEPROM | 0 | 3 | N + 46 | external_port_mod_3 | 1 | RW | EEPROM | 0 | 3 | N + 47 | external_port_mod_4 | 1 | RW | EEPROM | 0 | 3 | N + 48 | shutdown | 1 | RW | EEPROM | 0 | 255 | N + 49 | indirect_address_1 | 2 | RW | EEPROM | 0 | 65535 | N + 562 | torque_enable | 1 | RW | RAM | 0 | 1 | N + 563 | LED_RED | 1 | RW | RAM | 0 | 255 | N + 564 | LED_GREEN | 1 | RW | RAM | 0 | 255 | N + 565 | LED_BLUE | 1 | RW | RAM | 0 | 255 | N + 586 | velocity_i_gain | 2 | RW | RAM | 0 | 2047 | N + 588 | velocity_p_gain | 2 | RW | RAM | 0 | 2047 | N + 594 | position_p_gain | 2 | RW | RAM | 0 | 2047 | N + 596 | goal_position | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 600 | goal_velocity | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 604 | goal_torque | 2 | RW | RAM | -32768 | 32767 | Y + 606 | goal_acceleration | 4 | RW | RAM | 0 | 2147483647 | N + 610 | is_moving | 1 | R | RAM | 0 | 1 | N + 611 | present_position | 4 | R | RAM | -2147483648 | 2147483647 | Y + 615 | present_velocity | 4 | R | RAM | -2147483648 | 2147483647 | Y + 621 | present_current | 2 | R | RAM | -32768 | 32767 | Y + 623 | present_voltage | 2 | R | RAM | 0 | 500 | N + 625 | present_temperature | 1 | R | RAM | 0 | 200 | N + 626 | external_port_data_1 | 2 | RW | RAM | 0 | 4095 | N + 628 | external_port_data_2 | 2 | RW | RAM | 0 | 4095 | N + 630 | external_port_data_3 | 2 | RW | RAM | 0 | 4095 | N + 632 | external_port_data_4 | 2 | RW | RAM | 0 | 4095 | N + 634 | indirect_data_1 | 1 | RW | RAM | 0 | 255 | N + 890 | registerd_instruction | 1 | R | RAM | 0 | 1 | N + 891 | status_return_level | 1 | RW | RAM | 0 | 2 | N + 892 | hardware_error_status | 2 | R | RAM | 0 | 31 | N diff --git a/humanoid_robot_intelligence_control_system_device/devices/dynamixel/GRIPPER_TORQUE.device b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/GRIPPER_TORQUE.device new file mode 100755 index 0000000..208b7cb --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/GRIPPER_TORQUE.device @@ -0,0 +1,74 @@ +[device info] +model_name = GRIPPER +device_type = dynamixel + +[type info] +value_of_0_radian_position = 0 +value_of_min_radian_position = 0 +value_of_max_radian_position = 750 +min_radian = 0 +max_radian = 1.150767 + +torque_enable_item_name = torque_enable +present_position_item_name = present_position +present_velocity_item_name = present_velocity +present_current_item_name = present_current +goal_position_item_name = goal_position +goal_velocity_item_name = goal_velocity +goal_current_item_name = goal_torque +position_d_gain_item_name = +position_i_gain_item_name = +position_p_gain_item_name = position_p_gain +velocity_d_gain_item_name = +velocity_i_gain_item_name = velocity_i_gain +velocity_p_gain_item_name = velocity_p_gain + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 6 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 7 | ID | 1 | RW | EEPROM | 0 | 252 | N + 8 | baudrate | 1 | RW | EEPROM | 0 | 8 | N + 9 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 11 | operating_mode | 1 | RW | EEPROM | 0 | 4 | N + 17 | moving_threshold | 4 | RW | EEPROM | 0 | 2147483647 | N + 21 | max_temperature_limit | 1 | RW | EEPROM | 0 | 100 | N + 22 | max_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 24 | min_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 26 | acceleration_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 30 | torque_limit | 2 | RW | EEPROM | 0 | 32767 | N + 32 | velocity_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 36 | max_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 40 | min_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 44 | external_port_mod_1 | 1 | RW | EEPROM | 0 | 3 | N + 45 | external_port_mod_2 | 1 | RW | EEPROM | 0 | 3 | N + 46 | external_port_mod_3 | 1 | RW | EEPROM | 0 | 3 | N + 47 | external_port_mod_4 | 1 | RW | EEPROM | 0 | 3 | N + 48 | shutdown | 1 | RW | EEPROM | 0 | 255 | N + 49 | indirect_address_1 | 2 | RW | EEPROM | 0 | 65535 | N + 562 | torque_enable | 1 | RW | RAM | 0 | 1 | N + 563 | LED_RED | 1 | RW | RAM | 0 | 255 | N + 564 | LED_GREEN | 1 | RW | RAM | 0 | 255 | N + 565 | LED_BLUE | 1 | RW | RAM | 0 | 255 | N + 586 | velocity_i_gain | 2 | RW | RAM | 0 | 2047 | N + 588 | velocity_p_gain | 2 | RW | RAM | 0 | 2047 | N + 590 | position_d_gain | 2 | RW | RAM | 0 | 2047 | N + 594 | position_p_gain | 2 | RW | RAM | 0 | 2047 | N + 596 | goal_position | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 600 | goal_velocity | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 604 | goal_torque | 2 | RW | RAM | -32768 | 32767 | Y + 606 | goal_acceleration | 4 | RW | RAM | 0 | 2147483647 | N + 610 | is_moving | 1 | R | RAM | 0 | 1 | N + 611 | present_position | 4 | R | RAM | -2147483648 | 2147483647 | Y + 615 | present_velocity | 4 | R | RAM | -2147483648 | 2147483647 | Y + 621 | present_current | 2 | R | RAM | -32768 | 32767 | Y + 623 | present_voltage | 2 | R | RAM | 0 | 500 | N + 625 | present_temperature | 1 | R | RAM | 0 | 200 | N + 626 | external_port_data_1 | 2 | RW | RAM | 0 | 4095 | N + 628 | external_port_data_2 | 2 | RW | RAM | 0 | 4095 | N + 630 | external_port_data_3 | 2 | RW | RAM | 0 | 4095 | N + 632 | external_port_data_4 | 2 | RW | RAM | 0 | 4095 | N + 634 | indirect_data_1 | 1 | RW | RAM | 0 | 255 | N + 890 | registerd_instruction | 1 | R | RAM | 0 | 1 | N + 891 | status_return_level | 1 | RW | RAM | 0 | 2 | N + 892 | hardware_error_status | 2 | R | RAM | 0 | 31 | N diff --git a/humanoid_robot_intelligence_control_system_device/devices/dynamixel/H42-20-S300-R(A).device b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/H42-20-S300-R(A).device new file mode 100644 index 0000000..a6f523c --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/H42-20-S300-R(A).device @@ -0,0 +1,92 @@ +[device info] +model_name = H42-20-S300-R(A) +device_type = dynamixel + +[type info] +torque_to_current_value_ratio = 109.3747778 +velocity_to_value_ratio = 954.93 +value_of_0_radian_position = 0 +value_of_min_radian_position = -303750 +value_of_max_radian_position = 303750 +min_radian = -3.14159265 +max_radian = 3.14159265 + +torque_enable_item_name = torque_enable +present_position_item_name = present_position +present_velocity_item_name = present_velocity +present_current_item_name = present_current +goal_position_item_name = goal_position +goal_velocity_item_name = goal_velocity +goal_current_item_name = goal_current +position_d_gain_item_name = position_d_gain +position_i_gain_item_name = position_i_gain +position_p_gain_item_name = position_p_gain +velocity_d_gain_item_name = +velocity_i_gain_item_name = velocity_i_gain +velocity_p_gain_item_name = velocity_p_gain + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 6 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 7 | ID | 1 | RW | EEPROM | 0 | 252 | N + 8 | baudrate | 1 | RW | EEPROM | 0 | 8 | N + 9 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 10 | drive_mode | 1 | RW | EEPROM | 0 | 3 | N + 11 | operating_mode | 1 | RW | EEPROM | 0 | 4 | N + 12 | secondary_id | 1 | RW | EEPROM | 0 | 255 | N + 13 | protocol_version | 1 | RW | EEPROM | 1 | 2 | N + 20 | homing_offset | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 24 | moving_threshold | 4 | RW | EEPROM | 0 | 2147483647 | N + 31 | max_temperature_limit | 1 | RW | EEPROM | 0 | 100 | N + 32 | max_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 34 | min_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 36 | pwm_limit | 2 | RW | EEPROM | 0 | 885 | N + 38 | current_limit | 2 | RW | EEPROM | 0 | 32767 | N + 40 | acceleration_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 44 | velocity_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 48 | max_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 52 | min_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 56 | external_port_mod_1 | 1 | RW | EEPROM | 0 | 3 | N + 57 | external_port_mod_2 | 1 | RW | EEPROM | 0 | 3 | N + 58 | external_port_mod_3 | 1 | RW | EEPROM | 0 | 3 | N + 59 | external_port_mod_4 | 1 | RW | EEPROM | 0 | 3 | N + 63 | shutdown | 1 | RW | EEPROM | 0 | 255 | N + 168 | indirect_address_1 | 2 | RW | EEPROM | 0 | 65535 | N + 512 | torque_enable | 1 | RW | RAM | 0 | 1 | N + 513 | LED_RED | 1 | RW | RAM | 0 | 255 | N + 514 | LED_GREEN | 1 | RW | RAM | 0 | 255 | N + 515 | LED_BLUE | 1 | RW | RAM | 0 | 255 | N + 516 | status_return_level | 1 | RW | RAM | 0 | 2 | N + 517 | registerd_instruction | 1 | R | RAM | 0 | 1 | N + 518 | hardware_error_status | 1 | R | RAM | 0 | 31 | N + 524 | velocity_i_gain | 2 | RW | RAM | 0 | 2047 | N + 526 | velocity_p_gain | 2 | RW | RAM | 0 | 2047 | N + 528 | position_d_gain | 2 | RW | RAM | 0 | 2047 | N + 530 | position_i_gain | 2 | RW | RAM | 0 | 2047 | N + 532 | position_p_gain | 2 | RW | RAM | 0 | 2047 | N + 536 | feedforward_2nd_gain | 2 | RW | RAM | 0 | 32767 | N + 538 | feedforward_1st_gain | 2 | RW | RAM | 0 | 32767 | N + 546 | bus_watchdog | 1 | RW | RAM | -1 | 127 | Y + 548 | goal_pwm | 2 | RW | RAM | -2100 | 2100 | Y + 550 | goal_current | 2 | RW | RAM | -32768 | 32767 | Y + 552 | goal_velocity | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 556 | profile_acceleration | 4 | RW | RAM | 0 | 32767 | N + 560 | profile_velocity | 4 | RW | RAM | 0 | 1023 | N + 564 | goal_position | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 568 | realtime_tick | 2 | R | RAM | 0 | 32767 | N + 570 | moving | 1 | R | RAM | 0 | 1 | N + 571 | moving_status | 1 | R | RAM | 0 | 255 | N + 572 | present_pwm | 2 | R | RAM | -2100 | 2100 | Y + 574 | present_current | 2 | R | RAM | -32768 | 32767 | Y + 576 | present_velocity | 4 | R | RAM | -2147483648 | 2147483647 | Y + 580 | present_position | 4 | R | RAM | -2147483648 | 2147483647 | Y + 584 | velocity_trajectory | 4 | R | RAM | 0 | 1023 | N + 588 | position_trajectory | 4 | R | RAM | 0 | 4095 | N + 592 | present_voltage | 2 | R | RAM | 0 | 500 | N + 594 | present_temperature | 1 | R | RAM | 0 | 200 | N + 600 | external_port_data_1 | 2 | RW | RAM | 0 | 4095 | N + 602 | external_port_data_2 | 2 | RW | RAM | 0 | 4095 | N + 604 | external_port_data_3 | 2 | RW | RAM | 0 | 4095 | N + 606 | external_port_data_4 | 2 | RW | RAM | 0 | 4095 | N + 634 | indirect_data_1 | 1 | RW | RAM | 0 | 255 | N diff --git a/humanoid_robot_intelligence_control_system_device/devices/dynamixel/H42-20-S300-R.device b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/H42-20-S300-R.device new file mode 100755 index 0000000..ab7aecb --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/H42-20-S300-R.device @@ -0,0 +1,76 @@ +[device info] +model_name = H42-20-S300-R +device_type = dynamixel + +[type info] +torque_to_current_value_ratio = 27.15146 +velocity_to_value_ratio = 2900.59884 +value_of_0_radian_position = 0 +value_of_min_radian_position = -151900 +value_of_max_radian_position = 151900 +min_radian = -3.14159265 +max_radian = 3.14159265 + +torque_enable_item_name = torque_enable +present_position_item_name = present_position +present_velocity_item_name = present_velocity +present_current_item_name = present_current +goal_position_item_name = goal_position +goal_velocity_item_name = goal_velocity +goal_current_item_name = goal_torque +position_d_gain_item_name = +position_i_gain_item_name = +position_p_gain_item_name = position_p_gain +velocity_d_gain_item_name = +velocity_i_gain_item_name = velocity_i_gain +velocity_p_gain_item_name = velocity_p_gain + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 6 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 7 | ID | 1 | RW | EEPROM | 0 | 252 | N + 8 | baudrate | 1 | RW | EEPROM | 0 | 8 | N + 9 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 11 | operating_mode | 1 | RW | EEPROM | 0 | 4 | N + 13 | homing_offset | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 17 | moving_threshold | 4 | RW | EEPROM | 0 | 2147483647 | N + 21 | max_temperature_limit | 1 | RW | EEPROM | 0 | 100 | N + 22 | max_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 24 | min_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 26 | acceleration_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 30 | torque_limit | 2 | RW | EEPROM | 0 | 32767 | N + 32 | velocity_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 36 | max_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 40 | min_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 44 | external_port_mod_1 | 1 | RW | EEPROM | 0 | 3 | N + 45 | external_port_mod_2 | 1 | RW | EEPROM | 0 | 3 | N + 46 | external_port_mod_3 | 1 | RW | EEPROM | 0 | 3 | N + 47 | external_port_mod_4 | 1 | RW | EEPROM | 0 | 3 | N + 48 | shutdown | 1 | RW | EEPROM | 0 | 255 | N + 49 | indirect_address_1 | 2 | RW | EEPROM | 0 | 65535 | N + 562 | torque_enable | 1 | RW | RAM | 0 | 1 | N + 563 | LED_RED | 1 | RW | RAM | 0 | 255 | N + 564 | LED_GREEN | 1 | RW | RAM | 0 | 255 | N + 565 | LED_BLUE | 1 | RW | RAM | 0 | 255 | N + 586 | velocity_i_gain | 2 | RW | RAM | 0 | 2047 | N + 588 | velocity_p_gain | 2 | RW | RAM | 0 | 2047 | N + 594 | position_p_gain | 2 | RW | RAM | 0 | 2047 | N + 596 | goal_position | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 600 | goal_velocity | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 604 | goal_torque | 2 | RW | RAM | -32768 | 32767 | Y + 606 | goal_acceleration | 4 | RW | RAM | 0 | 2147483647 | N + 610 | is_moving | 1 | R | RAM | 0 | 1 | N + 611 | present_position | 4 | R | RAM | -2147483648 | 2147483647 | Y + 615 | present_velocity | 4 | R | RAM | -2147483648 | 2147483647 | Y + 621 | present_current | 2 | R | RAM | -32768 | 32767 | Y + 623 | present_voltage | 2 | R | RAM | 0 | 500 | N + 625 | present_temperature | 1 | R | RAM | 0 | 200 | N + 626 | external_port_data_1 | 2 | RW | RAM | 0 | 4095 | N + 628 | external_port_data_2 | 2 | RW | RAM | 0 | 4095 | N + 630 | external_port_data_3 | 2 | RW | RAM | 0 | 4095 | N + 632 | external_port_data_4 | 2 | RW | RAM | 0 | 4095 | N + 634 | indirect_data_1 | 1 | RW | RAM | 0 | 255 | N + 890 | registerd_instruction | 1 | R | RAM | 0 | 1 | N + 891 | status_return_level | 1 | RW | RAM | 0 | 2 | N + 892 | hardware_error_status | 2 | R | RAM | 0 | 31 | N diff --git a/humanoid_robot_intelligence_control_system_device/devices/dynamixel/H42P-020-S300-R.device b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/H42P-020-S300-R.device new file mode 100644 index 0000000..92d405a --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/H42P-020-S300-R.device @@ -0,0 +1,92 @@ +[device info] +model_name = H42P-020-S300-R +device_type = dynamixel + +[type info] +torque_to_current_value_ratio = 109.3747778 +velocity_to_value_ratio = 954.93 +value_of_0_radian_position = 0 +value_of_min_radian_position = -303750 +value_of_max_radian_position = 303750 +min_radian = -3.14159265 +max_radian = 3.14159265 + +torque_enable_item_name = torque_enable +present_position_item_name = present_position +present_velocity_item_name = present_velocity +present_current_item_name = present_current +goal_position_item_name = goal_position +goal_velocity_item_name = goal_velocity +goal_current_item_name = goal_current +position_d_gain_item_name = position_d_gain +position_i_gain_item_name = position_i_gain +position_p_gain_item_name = position_p_gain +velocity_d_gain_item_name = +velocity_i_gain_item_name = velocity_i_gain +velocity_p_gain_item_name = velocity_p_gain + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 6 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 7 | ID | 1 | RW | EEPROM | 0 | 252 | N + 8 | baudrate | 1 | RW | EEPROM | 0 | 8 | N + 9 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 10 | drive_mode | 1 | RW | EEPROM | 0 | 3 | N + 11 | operating_mode | 1 | RW | EEPROM | 0 | 4 | N + 12 | secondary_id | 1 | RW | EEPROM | 0 | 255 | N + 13 | protocol_version | 1 | RW | EEPROM | 1 | 2 | N + 20 | homing_offset | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 24 | moving_threshold | 4 | RW | EEPROM | 0 | 2147483647 | N + 31 | max_temperature_limit | 1 | RW | EEPROM | 0 | 100 | N + 32 | max_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 34 | min_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 36 | pwm_limit | 2 | RW | EEPROM | 0 | 885 | N + 38 | current_limit | 2 | RW | EEPROM | 0 | 32767 | N + 40 | acceleration_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 44 | velocity_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 48 | max_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 52 | min_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 56 | external_port_mod_1 | 1 | RW | EEPROM | 0 | 3 | N + 57 | external_port_mod_2 | 1 | RW | EEPROM | 0 | 3 | N + 58 | external_port_mod_3 | 1 | RW | EEPROM | 0 | 3 | N + 59 | external_port_mod_4 | 1 | RW | EEPROM | 0 | 3 | N + 63 | shutdown | 1 | RW | EEPROM | 0 | 255 | N + 168 | indirect_address_1 | 2 | RW | EEPROM | 0 | 65535 | N + 512 | torque_enable | 1 | RW | RAM | 0 | 1 | N + 513 | LED_RED | 1 | RW | RAM | 0 | 255 | N + 514 | LED_GREEN | 1 | RW | RAM | 0 | 255 | N + 515 | LED_BLUE | 1 | RW | RAM | 0 | 255 | N + 516 | status_return_level | 1 | RW | RAM | 0 | 2 | N + 517 | registerd_instruction | 1 | R | RAM | 0 | 1 | N + 518 | hardware_error_status | 1 | R | RAM | 0 | 31 | N + 524 | velocity_i_gain | 2 | RW | RAM | 0 | 2047 | N + 526 | velocity_p_gain | 2 | RW | RAM | 0 | 2047 | N + 528 | position_d_gain | 2 | RW | RAM | 0 | 2047 | N + 530 | position_i_gain | 2 | RW | RAM | 0 | 2047 | N + 532 | position_p_gain | 2 | RW | RAM | 0 | 2047 | N + 536 | feedforward_2nd_gain | 2 | RW | RAM | 0 | 32767 | N + 538 | feedforward_1st_gain | 2 | RW | RAM | 0 | 32767 | N + 546 | bus_watchdog | 1 | RW | RAM | -1 | 127 | Y + 548 | goal_pwm | 2 | RW | RAM | -2100 | 2100 | Y + 550 | goal_current | 2 | RW | RAM | -32768 | 32767 | Y + 552 | goal_velocity | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 556 | profile_acceleration | 4 | RW | RAM | 0 | 32767 | N + 560 | profile_velocity | 4 | RW | RAM | 0 | 1023 | N + 564 | goal_position | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 568 | realtime_tick | 2 | R | RAM | 0 | 32767 | N + 570 | moving | 1 | R | RAM | 0 | 1 | N + 571 | moving_status | 1 | R | RAM | 0 | 255 | N + 572 | present_pwm | 2 | R | RAM | -2100 | 2100 | Y + 574 | present_current | 2 | R | RAM | -32768 | 32767 | Y + 576 | present_velocity | 4 | R | RAM | -2147483648 | 2147483647 | Y + 580 | present_position | 4 | R | RAM | -2147483648 | 2147483647 | Y + 584 | velocity_trajectory | 4 | R | RAM | 0 | 1023 | N + 588 | position_trajectory | 4 | R | RAM | 0 | 4095 | N + 592 | present_voltage | 2 | R | RAM | 0 | 500 | N + 594 | present_temperature | 1 | R | RAM | 0 | 200 | N + 600 | external_port_data_1 | 2 | RW | RAM | 0 | 4095 | N + 602 | external_port_data_2 | 2 | RW | RAM | 0 | 4095 | N + 604 | external_port_data_3 | 2 | RW | RAM | 0 | 4095 | N + 606 | external_port_data_4 | 2 | RW | RAM | 0 | 4095 | N + 634 | indirect_data_1 | 1 | RW | RAM | 0 | 255 | N diff --git a/humanoid_robot_intelligence_control_system_device/devices/dynamixel/H54-100-B210-R-NR.device b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/H54-100-B210-R-NR.device new file mode 100755 index 0000000..42342ae --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/H54-100-B210-R-NR.device @@ -0,0 +1,76 @@ +[device info] +model_name = H54-100-B210-R-NR +device_type = dynamixel + +[type info] +torque_to_current_value_ratio = 9.09201 +velocity_to_value_ratio = 2046.2777 +value_of_0_radian_position = 0 +value_of_min_radian_position = -250950 +value_of_max_radian_position = 250950 +min_radian = -3.14159265 +max_radian = 3.14159265 + +torque_enable_item_name = torque_enable +present_position_item_name = present_position +present_velocity_item_name = present_velocity +present_current_item_name = present_current +goal_position_item_name = goal_position +goal_velocity_item_name = goal_velocity +goal_current_item_name = goal_torque +position_d_gain_item_name = +position_i_gain_item_name = +position_p_gain_item_name = position_p_gain +velocity_d_gain_item_name = +velocity_i_gain_item_name = velocity_i_gain +velocity_p_gain_item_name = velocity_p_gain + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 6 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 7 | ID | 1 | RW | EEPROM | 0 | 252 | N + 8 | baudrate | 1 | RW | EEPROM | 0 | 8 | N + 9 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 11 | operating_mode | 1 | RW | EEPROM | 0 | 4 | N + 13 | homing_offset | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 17 | moving_threshold | 4 | RW | EEPROM | 0 | 2147483647 | N + 21 | max_temperature_limit | 1 | RW | EEPROM | 0 | 100 | N + 22 | max_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 24 | min_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 26 | acceleration_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 30 | torque_limit | 2 | RW | EEPROM | 0 | 32767 | N + 32 | velocity_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 36 | max_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 40 | min_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 44 | external_port_mod_1 | 1 | RW | EEPROM | 0 | 3 | N + 45 | external_port_mod_2 | 1 | RW | EEPROM | 0 | 3 | N + 46 | external_port_mod_3 | 1 | RW | EEPROM | 0 | 3 | N + 47 | external_port_mod_4 | 1 | RW | EEPROM | 0 | 3 | N + 48 | shutdown | 1 | RW | EEPROM | 0 | 255 | N + 49 | indirect_address_1 | 2 | RW | EEPROM | 0 | 65535 | N + 562 | torque_enable | 1 | RW | RAM | 0 | 1 | N + 563 | LED_RED | 1 | RW | RAM | 0 | 255 | N + 564 | LED_GREEN | 1 | RW | RAM | 0 | 255 | N + 565 | LED_BLUE | 1 | RW | RAM | 0 | 255 | N + 586 | velocity_i_gain | 2 | RW | RAM | 0 | 2047 | N + 588 | velocity_p_gain | 2 | RW | RAM | 0 | 2047 | N + 594 | position_p_gain | 2 | RW | RAM | 0 | 2047 | N + 596 | goal_position | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 600 | goal_velocity | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 604 | goal_torque | 2 | RW | RAM | -32768 | 32767 | Y + 606 | goal_acceleration | 4 | RW | RAM | 0 | 2147483647 | N + 610 | is_moving | 1 | R | RAM | 0 | 1 | N + 611 | present_position | 4 | R | RAM | -2147483648 | 2147483647 | Y + 615 | present_velocity | 4 | R | RAM | -2147483648 | 2147483647 | Y + 621 | present_current | 2 | R | RAM | -32768 | 32767 | Y + 623 | present_voltage | 2 | R | RAM | 0 | 500 | N + 625 | present_temperature | 1 | R | RAM | 0 | 200 | N + 626 | external_port_data_1 | 2 | RW | RAM | 0 | 4095 | N + 628 | external_port_data_2 | 2 | RW | RAM | 0 | 4095 | N + 630 | external_port_data_3 | 2 | RW | RAM | 0 | 4095 | N + 632 | external_port_data_4 | 2 | RW | RAM | 0 | 4095 | N + 634 | indirect_data_1 | 1 | RW | RAM | 0 | 255 | N + 890 | registerd_instruction | 1 | R | RAM | 0 | 1 | N + 891 | status_return_level | 1 | RW | RAM | 0 | 2 | N + 892 | hardware_error_status | 2 | R | RAM | 0 | 31 | N diff --git a/humanoid_robot_intelligence_control_system_device/devices/dynamixel/H54-100-S500-R(A).device b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/H54-100-S500-R(A).device new file mode 100644 index 0000000..fe706cc --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/H54-100-S500-R(A).device @@ -0,0 +1,92 @@ +[device info] +model_name = H54-100-S500-R(A) +device_type = dynamixel + +[type info] +torque_to_current_value_ratio = 155.658486 +velocity_to_value_ratio = 954.93 +value_of_0_radian_position = 0 +value_of_min_radian_position = -501923 +value_of_max_radian_position = 501923 +min_radian = -3.14159265 +max_radian = 3.14159265 + +torque_enable_item_name = torque_enable +present_position_item_name = present_position +present_velocity_item_name = present_velocity +present_current_item_name = present_current +goal_position_item_name = goal_position +goal_velocity_item_name = goal_velocity +goal_current_item_name = goal_current +position_d_gain_item_name = position_d_gain +position_i_gain_item_name = position_i_gain +position_p_gain_item_name = position_p_gain +velocity_d_gain_item_name = +velocity_i_gain_item_name = velocity_i_gain +velocity_p_gain_item_name = velocity_p_gain + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 6 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 7 | ID | 1 | RW | EEPROM | 0 | 252 | N + 8 | baudrate | 1 | RW | EEPROM | 0 | 8 | N + 9 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 10 | drive_mode | 1 | RW | EEPROM | 0 | 3 | N + 11 | operating_mode | 1 | RW | EEPROM | 0 | 4 | N + 12 | secondary_id | 1 | RW | EEPROM | 0 | 255 | N + 13 | protocol_version | 1 | RW | EEPROM | 1 | 2 | N + 20 | homing_offset | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 24 | moving_threshold | 4 | RW | EEPROM | 0 | 2147483647 | N + 31 | max_temperature_limit | 1 | RW | EEPROM | 0 | 100 | N + 32 | max_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 34 | min_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 36 | pwm_limit | 2 | RW | EEPROM | 0 | 885 | N + 38 | current_limit | 2 | RW | EEPROM | 0 | 32767 | N + 40 | acceleration_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 44 | velocity_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 48 | max_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 52 | min_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 56 | external_port_mod_1 | 1 | RW | EEPROM | 0 | 3 | N + 57 | external_port_mod_2 | 1 | RW | EEPROM | 0 | 3 | N + 58 | external_port_mod_3 | 1 | RW | EEPROM | 0 | 3 | N + 59 | external_port_mod_4 | 1 | RW | EEPROM | 0 | 3 | N + 63 | shutdown | 1 | RW | EEPROM | 0 | 255 | N + 168 | indirect_address_1 | 2 | RW | EEPROM | 0 | 65535 | N + 512 | torque_enable | 1 | RW | RAM | 0 | 1 | N + 513 | LED_RED | 1 | RW | RAM | 0 | 255 | N + 514 | LED_GREEN | 1 | RW | RAM | 0 | 255 | N + 515 | LED_BLUE | 1 | RW | RAM | 0 | 255 | N + 516 | status_return_level | 1 | RW | RAM | 0 | 2 | N + 517 | registerd_instruction | 1 | R | RAM | 0 | 1 | N + 518 | hardware_error_status | 1 | R | RAM | 0 | 31 | N + 524 | velocity_i_gain | 2 | RW | RAM | 0 | 2047 | N + 526 | velocity_p_gain | 2 | RW | RAM | 0 | 2047 | N + 528 | position_d_gain | 2 | RW | RAM | 0 | 2047 | N + 530 | position_i_gain | 2 | RW | RAM | 0 | 2047 | N + 532 | position_p_gain | 2 | RW | RAM | 0 | 2047 | N + 536 | feedforward_2nd_gain | 2 | RW | RAM | 0 | 32767 | N + 538 | feedforward_1st_gain | 2 | RW | RAM | 0 | 32767 | N + 546 | bus_watchdog | 1 | RW | RAM | -1 | 127 | Y + 548 | goal_pwm | 2 | RW | RAM | -2100 | 2100 | Y + 550 | goal_current | 2 | RW | RAM | -32768 | 32767 | Y + 552 | goal_velocity | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 556 | profile_acceleration | 4 | RW | RAM | 0 | 32767 | N + 560 | profile_velocity | 4 | RW | RAM | 0 | 1023 | N + 564 | goal_position | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 568 | realtime_tick | 2 | R | RAM | 0 | 32767 | N + 570 | moving | 1 | R | RAM | 0 | 1 | N + 571 | moving_status | 1 | R | RAM | 0 | 255 | N + 572 | present_pwm | 2 | R | RAM | -2100 | 2100 | Y + 574 | present_current | 2 | R | RAM | -32768 | 32767 | Y + 576 | present_velocity | 4 | R | RAM | -2147483648 | 2147483647 | Y + 580 | present_position | 4 | R | RAM | -2147483648 | 2147483647 | Y + 584 | velocity_trajectory | 4 | R | RAM | 0 | 1023 | N + 588 | position_trajectory | 4 | R | RAM | 0 | 4095 | N + 592 | present_voltage | 2 | R | RAM | 0 | 500 | N + 594 | present_temperature | 1 | R | RAM | 0 | 200 | N + 600 | external_port_data_1 | 2 | RW | RAM | 0 | 4095 | N + 602 | external_port_data_2 | 2 | RW | RAM | 0 | 4095 | N + 604 | external_port_data_3 | 2 | RW | RAM | 0 | 4095 | N + 606 | external_port_data_4 | 2 | RW | RAM | 0 | 4095 | N + 634 | indirect_data_1 | 1 | RW | RAM | 0 | 255 | N diff --git a/humanoid_robot_intelligence_control_system_device/devices/dynamixel/H54-100-S500-R.device b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/H54-100-S500-R.device new file mode 100755 index 0000000..b042f27 --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/H54-100-S500-R.device @@ -0,0 +1,76 @@ +[device info] +model_name = H54-100-S500-R +device_type = dynamixel + +[type info] +torque_to_current_value_ratio = 9.66026 +velocity_to_value_ratio = 4793.01226 +value_of_0_radian_position = 0 +value_of_min_radian_position = -250950 +value_of_max_radian_position = 250950 +min_radian = -3.14159265 +max_radian = 3.14159265 + +torque_enable_item_name = torque_enable +present_position_item_name = present_position +present_velocity_item_name = present_velocity +present_current_item_name = present_current +goal_position_item_name = goal_position +goal_velocity_item_name = goal_velocity +goal_current_item_name = goal_torque +position_d_gain_item_name = +position_i_gain_item_name = +position_p_gain_item_name = position_p_gain +velocity_d_gain_item_name = +velocity_i_gain_item_name = velocity_i_gain +velocity_p_gain_item_name = velocity_p_gain + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 6 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 7 | ID | 1 | RW | EEPROM | 0 | 252 | N + 8 | baudrate | 1 | RW | EEPROM | 0 | 8 | N + 9 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 11 | operating_mode | 1 | RW | EEPROM | 0 | 4 | N + 13 | homing_offset | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 17 | moving_threshold | 4 | RW | EEPROM | 0 | 2147483647 | N + 21 | max_temperature_limit | 1 | RW | EEPROM | 0 | 100 | N + 22 | max_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 24 | min_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 26 | acceleration_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 30 | torque_limit | 2 | RW | EEPROM | 0 | 32767 | N + 32 | velocity_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 36 | max_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 40 | min_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 44 | external_port_mod_1 | 1 | RW | EEPROM | 0 | 3 | N + 45 | external_port_mod_2 | 1 | RW | EEPROM | 0 | 3 | N + 46 | external_port_mod_3 | 1 | RW | EEPROM | 0 | 3 | N + 47 | external_port_mod_4 | 1 | RW | EEPROM | 0 | 3 | N + 48 | shutdown | 1 | RW | EEPROM | 0 | 255 | N + 49 | indirect_address_1 | 2 | RW | EEPROM | 0 | 65535 | N + 562 | torque_enable | 1 | RW | RAM | 0 | 1 | N + 563 | LED_RED | 1 | RW | RAM | 0 | 255 | N + 564 | LED_GREEN | 1 | RW | RAM | 0 | 255 | N + 565 | LED_BLUE | 1 | RW | RAM | 0 | 255 | N + 586 | velocity_i_gain | 2 | RW | RAM | 0 | 2047 | N + 588 | velocity_p_gain | 2 | RW | RAM | 0 | 2047 | N + 594 | position_p_gain | 2 | RW | RAM | 0 | 2047 | N + 596 | goal_position | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 600 | goal_velocity | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 604 | goal_torque | 2 | RW | RAM | -32768 | 32767 | Y + 606 | goal_acceleration | 4 | RW | RAM | 0 | 2147483647 | N + 610 | is_moving | 1 | R | RAM | 0 | 1 | N + 611 | present_position | 4 | R | RAM | -2147483648 | 2147483647 | Y + 615 | present_velocity | 4 | R | RAM | -2147483648 | 2147483647 | Y + 621 | present_current | 2 | R | RAM | -32768 | 32767 | Y + 623 | present_voltage | 2 | R | RAM | 0 | 500 | N + 625 | present_temperature | 1 | R | RAM | 0 | 200 | N + 626 | external_port_data_1 | 2 | RW | RAM | 0 | 4095 | N + 628 | external_port_data_2 | 2 | RW | RAM | 0 | 4095 | N + 630 | external_port_data_3 | 2 | RW | RAM | 0 | 4095 | N + 632 | external_port_data_4 | 2 | RW | RAM | 0 | 4095 | N + 634 | indirect_data_1 | 1 | RW | RAM | 0 | 255 | N + 890 | registerd_instruction | 1 | R | RAM | 0 | 1 | N + 891 | status_return_level | 1 | RW | RAM | 0 | 2 | N + 892 | hardware_error_status | 2 | R | RAM | 0 | 31 | N diff --git a/humanoid_robot_intelligence_control_system_device/devices/dynamixel/H54-200-B500-R.device b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/H54-200-B500-R.device new file mode 100755 index 0000000..ca52162 --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/H54-200-B500-R.device @@ -0,0 +1,76 @@ +[device info] +model_name = H54-200-B500-R +device_type = dynamixel + +[type info] +torque_to_current_value_ratio = 9.09201 +velocity_to_value_ratio = 4793.01226 +value_of_0_radian_position = 0 +value_of_min_radian_position = -250950 +value_of_max_radian_position = 250950 +min_radian = -3.14159265 +max_radian = 3.14159265 + +torque_enable_item_name = torque_enable +present_position_item_name = present_position +present_velocity_item_name = present_velocity +present_current_item_name = present_current +goal_position_item_name = goal_position +goal_velocity_item_name = goal_velocity +goal_current_item_name = goal_torque +position_d_gain_item_name = +position_i_gain_item_name = +position_p_gain_item_name = position_p_gain +velocity_d_gain_item_name = +velocity_i_gain_item_name = velocity_i_gain +velocity_p_gain_item_name = velocity_p_gain + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 6 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 7 | ID | 1 | RW | EEPROM | 0 | 252 | N + 8 | baudrate | 1 | RW | EEPROM | 0 | 8 | N + 9 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 11 | operating_mode | 1 | RW | EEPROM | 0 | 4 | N + 13 | homing_offset | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 17 | moving_threshold | 4 | RW | EEPROM | 0 | 2147483647 | N + 21 | max_temperature_limit | 1 | RW | EEPROM | 0 | 100 | N + 22 | max_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 24 | min_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 26 | acceleration_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 30 | torque_limit | 2 | RW | EEPROM | 0 | 32767 | N + 32 | velocity_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 36 | max_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 40 | min_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 44 | external_port_mod_1 | 1 | RW | EEPROM | 0 | 3 | N + 45 | external_port_mod_2 | 1 | RW | EEPROM | 0 | 3 | N + 46 | external_port_mod_3 | 1 | RW | EEPROM | 0 | 3 | N + 47 | external_port_mod_4 | 1 | RW | EEPROM | 0 | 3 | N + 48 | shutdown | 1 | RW | EEPROM | 0 | 255 | N + 49 | indirect_address_1 | 2 | RW | EEPROM | 0 | 65535 | N + 562 | torque_enable | 1 | RW | RAM | 0 | 1 | N + 563 | LED_RED | 1 | RW | RAM | 0 | 255 | N + 564 | LED_GREEN | 1 | RW | RAM | 0 | 255 | N + 565 | LED_BLUE | 1 | RW | RAM | 0 | 255 | N + 586 | velocity_i_gain | 2 | RW | RAM | 0 | 2047 | N + 588 | velocity_p_gain | 2 | RW | RAM | 0 | 2047 | N + 594 | position_p_gain | 2 | RW | RAM | 0 | 2047 | N + 596 | goal_position | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 600 | goal_velocity | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 604 | goal_torque | 2 | RW | RAM | -32768 | 32767 | Y + 606 | goal_acceleration | 4 | RW | RAM | 0 | 2147483647 | N + 610 | is_moving | 1 | R | RAM | 0 | 1 | N + 611 | present_position | 4 | R | RAM | -2147483648 | 2147483647 | Y + 615 | present_velocity | 4 | R | RAM | -2147483648 | 2147483647 | Y + 621 | present_current | 2 | R | RAM | -32768 | 32767 | Y + 623 | present_voltage | 2 | R | RAM | 0 | 500 | N + 625 | present_temperature | 1 | R | RAM | 0 | 200 | N + 626 | external_port_data_1 | 2 | RW | RAM | 0 | 4095 | N + 628 | external_port_data_2 | 2 | RW | RAM | 0 | 4095 | N + 630 | external_port_data_3 | 2 | RW | RAM | 0 | 4095 | N + 632 | external_port_data_4 | 2 | RW | RAM | 0 | 4095 | N + 634 | indirect_data_1 | 1 | RW | RAM | 0 | 255 | N + 890 | registerd_instruction | 1 | R | RAM | 0 | 1 | N + 891 | status_return_level | 1 | RW | RAM | 0 | 2 | N + 892 | hardware_error_status | 2 | R | RAM | 0 | 31 | N diff --git a/humanoid_robot_intelligence_control_system_device/devices/dynamixel/H54-200-S500-R(A).device b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/H54-200-S500-R(A).device new file mode 100644 index 0000000..3cfb758 --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/H54-200-S500-R(A).device @@ -0,0 +1,92 @@ +[device info] +model_name = H54-200-S500-R(A) +device_type = dynamixel + +[type info] +torque_to_current_value_ratio = 146.502114 +velocity_to_value_ratio = 954.93 +value_of_0_radian_position = 0 +value_of_min_radian_position = -501923 +value_of_max_radian_position = 501923 +min_radian = -3.14159265 +max_radian = 3.14159265 + +torque_enable_item_name = torque_enable +present_position_item_name = present_position +present_velocity_item_name = present_velocity +present_current_item_name = present_current +goal_position_item_name = goal_position +goal_velocity_item_name = goal_velocity +goal_current_item_name = goal_current +position_d_gain_item_name = position_d_gain +position_i_gain_item_name = position_i_gain +position_p_gain_item_name = position_p_gain +velocity_d_gain_item_name = +velocity_i_gain_item_name = velocity_i_gain +velocity_p_gain_item_name = velocity_p_gain + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 6 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 7 | ID | 1 | RW | EEPROM | 0 | 252 | N + 8 | baudrate | 1 | RW | EEPROM | 0 | 8 | N + 9 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 10 | drive_mode | 1 | RW | EEPROM | 0 | 3 | N + 11 | operating_mode | 1 | RW | EEPROM | 0 | 4 | N + 12 | secondary_id | 1 | RW | EEPROM | 0 | 255 | N + 13 | protocol_version | 1 | RW | EEPROM | 1 | 2 | N + 20 | homing_offset | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 24 | moving_threshold | 4 | RW | EEPROM | 0 | 2147483647 | N + 31 | max_temperature_limit | 1 | RW | EEPROM | 0 | 100 | N + 32 | max_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 34 | min_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 36 | pwm_limit | 2 | RW | EEPROM | 0 | 885 | N + 38 | current_limit | 2 | RW | EEPROM | 0 | 32767 | N + 40 | acceleration_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 44 | velocity_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 48 | max_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 52 | min_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 56 | external_port_mod_1 | 1 | RW | EEPROM | 0 | 3 | N + 57 | external_port_mod_2 | 1 | RW | EEPROM | 0 | 3 | N + 58 | external_port_mod_3 | 1 | RW | EEPROM | 0 | 3 | N + 59 | external_port_mod_4 | 1 | RW | EEPROM | 0 | 3 | N + 63 | shutdown | 1 | RW | EEPROM | 0 | 255 | N + 168 | indirect_address_1 | 2 | RW | EEPROM | 0 | 65535 | N + 512 | torque_enable | 1 | RW | RAM | 0 | 1 | N + 513 | LED_RED | 1 | RW | RAM | 0 | 255 | N + 514 | LED_GREEN | 1 | RW | RAM | 0 | 255 | N + 515 | LED_BLUE | 1 | RW | RAM | 0 | 255 | N + 516 | status_return_level | 1 | RW | RAM | 0 | 2 | N + 517 | registerd_instruction | 1 | R | RAM | 0 | 1 | N + 518 | hardware_error_status | 1 | R | RAM | 0 | 31 | N + 524 | velocity_i_gain | 2 | RW | RAM | 0 | 2047 | N + 526 | velocity_p_gain | 2 | RW | RAM | 0 | 2047 | N + 528 | position_d_gain | 2 | RW | RAM | 0 | 2047 | N + 530 | position_i_gain | 2 | RW | RAM | 0 | 2047 | N + 532 | position_p_gain | 2 | RW | RAM | 0 | 2047 | N + 536 | feedforward_2nd_gain | 2 | RW | RAM | 0 | 32767 | N + 538 | feedforward_1st_gain | 2 | RW | RAM | 0 | 32767 | N + 546 | bus_watchdog | 1 | RW | RAM | -1 | 127 | Y + 548 | goal_pwm | 2 | RW | RAM | -2100 | 2100 | Y + 550 | goal_current | 2 | RW | RAM | -32768 | 32767 | Y + 552 | goal_velocity | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 556 | profile_acceleration | 4 | RW | RAM | 0 | 32767 | N + 560 | profile_velocity | 4 | RW | RAM | 0 | 1023 | N + 564 | goal_position | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 568 | realtime_tick | 2 | R | RAM | 0 | 32767 | N + 570 | moving | 1 | R | RAM | 0 | 1 | N + 571 | moving_status | 1 | R | RAM | 0 | 255 | N + 572 | present_pwm | 2 | R | RAM | -2100 | 2100 | Y + 574 | present_current | 2 | R | RAM | -32768 | 32767 | Y + 576 | present_velocity | 4 | R | RAM | -2147483648 | 2147483647 | Y + 580 | present_position | 4 | R | RAM | -2147483648 | 2147483647 | Y + 584 | velocity_trajectory | 4 | R | RAM | 0 | 1023 | N + 588 | position_trajectory | 4 | R | RAM | 0 | 4095 | N + 592 | present_voltage | 2 | R | RAM | 0 | 500 | N + 594 | present_temperature | 1 | R | RAM | 0 | 200 | N + 600 | external_port_data_1 | 2 | RW | RAM | 0 | 4095 | N + 602 | external_port_data_2 | 2 | RW | RAM | 0 | 4095 | N + 604 | external_port_data_3 | 2 | RW | RAM | 0 | 4095 | N + 606 | external_port_data_4 | 2 | RW | RAM | 0 | 4095 | N + 634 | indirect_data_1 | 1 | RW | RAM | 0 | 255 | N diff --git a/humanoid_robot_intelligence_control_system_device/devices/dynamixel/H54-200-S500-R.device b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/H54-200-S500-R.device new file mode 100755 index 0000000..4f81222 --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/H54-200-S500-R.device @@ -0,0 +1,76 @@ +[device info] +model_name = H54-200-S500-R +device_type = dynamixel + +[type info] +torque_to_current_value_ratio = 9.09201 +velocity_to_value_ratio = 4793.01226 +value_of_0_radian_position = 0 +value_of_min_radian_position = -250950 +value_of_max_radian_position = 250950 +min_radian = -3.14159265 +max_radian = 3.14159265 + +torque_enable_item_name = torque_enable +present_position_item_name = present_position +present_velocity_item_name = present_velocity +present_current_item_name = present_current +goal_position_item_name = goal_position +goal_velocity_item_name = goal_velocity +goal_current_item_name = goal_torque +position_d_gain_item_name = +position_i_gain_item_name = +position_p_gain_item_name = position_p_gain +velocity_d_gain_item_name = +velocity_i_gain_item_name = velocity_i_gain +velocity_p_gain_item_name = velocity_p_gain + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 6 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 7 | ID | 1 | RW | EEPROM | 0 | 252 | N + 8 | baudrate | 1 | RW | EEPROM | 0 | 8 | N + 9 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 11 | operating_mode | 1 | RW | EEPROM | 0 | 4 | N + 13 | homing_offset | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 17 | moving_threshold | 4 | RW | EEPROM | 0 | 2147483647 | N + 21 | max_temperature_limit | 1 | RW | EEPROM | 0 | 100 | N + 22 | max_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 24 | min_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 26 | acceleration_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 30 | torque_limit | 2 | RW | EEPROM | 0 | 32767 | N + 32 | velocity_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 36 | max_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 40 | min_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 44 | external_port_mod_1 | 1 | RW | EEPROM | 0 | 3 | N + 45 | external_port_mod_2 | 1 | RW | EEPROM | 0 | 3 | N + 46 | external_port_mod_3 | 1 | RW | EEPROM | 0 | 3 | N + 47 | external_port_mod_4 | 1 | RW | EEPROM | 0 | 3 | N + 48 | shutdown | 1 | RW | EEPROM | 0 | 255 | N + 49 | indirect_address_1 | 2 | RW | EEPROM | 0 | 65535 | N + 562 | torque_enable | 1 | RW | RAM | 0 | 1 | N + 563 | LED_RED | 1 | RW | RAM | 0 | 255 | N + 564 | LED_GREEN | 1 | RW | RAM | 0 | 255 | N + 565 | LED_BLUE | 1 | RW | RAM | 0 | 255 | N + 586 | velocity_i_gain | 2 | RW | RAM | 0 | 2047 | N + 588 | velocity_p_gain | 2 | RW | RAM | 0 | 2047 | N + 594 | position_p_gain | 2 | RW | RAM | 0 | 2047 | N + 596 | goal_position | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 600 | goal_velocity | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 604 | goal_torque | 2 | RW | RAM | -32768 | 32767 | Y + 606 | goal_acceleration | 4 | RW | RAM | 0 | 2147483647 | N + 610 | is_moving | 1 | R | RAM | 0 | 1 | N + 611 | present_position | 4 | R | RAM | -2147483648 | 2147483647 | Y + 615 | present_velocity | 4 | R | RAM | -2147483648 | 2147483647 | Y + 621 | present_current | 2 | R | RAM | -32768 | 32767 | Y + 623 | present_voltage | 2 | R | RAM | 0 | 500 | N + 625 | present_temperature | 1 | R | RAM | 0 | 200 | N + 626 | external_port_data_1 | 2 | RW | RAM | 0 | 4095 | N + 628 | external_port_data_2 | 2 | RW | RAM | 0 | 4095 | N + 630 | external_port_data_3 | 2 | RW | RAM | 0 | 4095 | N + 632 | external_port_data_4 | 2 | RW | RAM | 0 | 4095 | N + 634 | indirect_data_1 | 1 | RW | RAM | 0 | 255 | N + 890 | registerd_instruction | 1 | R | RAM | 0 | 1 | N + 891 | status_return_level | 1 | RW | RAM | 0 | 2 | N + 892 | hardware_error_status | 2 | R | RAM | 0 | 31 | N diff --git a/humanoid_robot_intelligence_control_system_device/devices/dynamixel/H54P-100-S500-R.device b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/H54P-100-S500-R.device new file mode 100644 index 0000000..e9661e0 --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/H54P-100-S500-R.device @@ -0,0 +1,92 @@ +[device info] +model_name = H54P-100-S500-R +device_type = dynamixel + +[type info] +torque_to_current_value_ratio = 155.658486 +velocity_to_value_ratio = 954.93 +value_of_0_radian_position = 0 +value_of_min_radian_position = -501923 +value_of_max_radian_position = 501923 +min_radian = -3.14159265 +max_radian = 3.14159265 + +torque_enable_item_name = torque_enable +present_position_item_name = present_position +present_velocity_item_name = present_velocity +present_current_item_name = present_current +goal_position_item_name = goal_position +goal_velocity_item_name = goal_velocity +goal_current_item_name = goal_current +position_d_gain_item_name = position_d_gain +position_i_gain_item_name = position_i_gain +position_p_gain_item_name = position_p_gain +velocity_d_gain_item_name = +velocity_i_gain_item_name = velocity_i_gain +velocity_p_gain_item_name = velocity_p_gain + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 6 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 7 | ID | 1 | RW | EEPROM | 0 | 252 | N + 8 | baudrate | 1 | RW | EEPROM | 0 | 8 | N + 9 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 10 | drive_mode | 1 | RW | EEPROM | 0 | 3 | N + 11 | operating_mode | 1 | RW | EEPROM | 0 | 4 | N + 12 | secondary_id | 1 | RW | EEPROM | 0 | 255 | N + 13 | protocol_version | 1 | RW | EEPROM | 1 | 2 | N + 20 | homing_offset | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 24 | moving_threshold | 4 | RW | EEPROM | 0 | 2147483647 | N + 31 | max_temperature_limit | 1 | RW | EEPROM | 0 | 100 | N + 32 | max_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 34 | min_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 36 | pwm_limit | 2 | RW | EEPROM | 0 | 885 | N + 38 | current_limit | 2 | RW | EEPROM | 0 | 32767 | N + 40 | acceleration_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 44 | velocity_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 48 | max_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 52 | min_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 56 | external_port_mod_1 | 1 | RW | EEPROM | 0 | 3 | N + 57 | external_port_mod_2 | 1 | RW | EEPROM | 0 | 3 | N + 58 | external_port_mod_3 | 1 | RW | EEPROM | 0 | 3 | N + 59 | external_port_mod_4 | 1 | RW | EEPROM | 0 | 3 | N + 63 | shutdown | 1 | RW | EEPROM | 0 | 255 | N + 168 | indirect_address_1 | 2 | RW | EEPROM | 0 | 65535 | N + 512 | torque_enable | 1 | RW | RAM | 0 | 1 | N + 513 | LED_RED | 1 | RW | RAM | 0 | 255 | N + 514 | LED_GREEN | 1 | RW | RAM | 0 | 255 | N + 515 | LED_BLUE | 1 | RW | RAM | 0 | 255 | N + 516 | status_return_level | 1 | RW | RAM | 0 | 2 | N + 517 | registerd_instruction | 1 | R | RAM | 0 | 1 | N + 518 | hardware_error_status | 1 | R | RAM | 0 | 31 | N + 524 | velocity_i_gain | 2 | RW | RAM | 0 | 2047 | N + 526 | velocity_p_gain | 2 | RW | RAM | 0 | 2047 | N + 528 | position_d_gain | 2 | RW | RAM | 0 | 2047 | N + 530 | position_i_gain | 2 | RW | RAM | 0 | 2047 | N + 532 | position_p_gain | 2 | RW | RAM | 0 | 2047 | N + 536 | feedforward_2nd_gain | 2 | RW | RAM | 0 | 32767 | N + 538 | feedforward_1st_gain | 2 | RW | RAM | 0 | 32767 | N + 546 | bus_watchdog | 1 | RW | RAM | -1 | 127 | Y + 548 | goal_pwm | 2 | RW | RAM | -2100 | 2100 | Y + 550 | goal_current | 2 | RW | RAM | -32768 | 32767 | Y + 552 | goal_velocity | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 556 | profile_acceleration | 4 | RW | RAM | 0 | 32767 | N + 560 | profile_velocity | 4 | RW | RAM | 0 | 1023 | N + 564 | goal_position | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 568 | realtime_tick | 2 | R | RAM | 0 | 32767 | N + 570 | moving | 1 | R | RAM | 0 | 1 | N + 571 | moving_status | 1 | R | RAM | 0 | 255 | N + 572 | present_pwm | 2 | R | RAM | -2100 | 2100 | Y + 574 | present_current | 2 | R | RAM | -32768 | 32767 | Y + 576 | present_velocity | 4 | R | RAM | -2147483648 | 2147483647 | Y + 580 | present_position | 4 | R | RAM | -2147483648 | 2147483647 | Y + 584 | velocity_trajectory | 4 | R | RAM | 0 | 1023 | N + 588 | position_trajectory | 4 | R | RAM | 0 | 4095 | N + 592 | present_voltage | 2 | R | RAM | 0 | 500 | N + 594 | present_temperature | 1 | R | RAM | 0 | 200 | N + 600 | external_port_data_1 | 2 | RW | RAM | 0 | 4095 | N + 602 | external_port_data_2 | 2 | RW | RAM | 0 | 4095 | N + 604 | external_port_data_3 | 2 | RW | RAM | 0 | 4095 | N + 606 | external_port_data_4 | 2 | RW | RAM | 0 | 4095 | N + 634 | indirect_data_1 | 1 | RW | RAM | 0 | 255 | N diff --git a/humanoid_robot_intelligence_control_system_device/devices/dynamixel/H54P-200-B500-R.device b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/H54P-200-B500-R.device new file mode 100644 index 0000000..97f44c5 --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/H54P-200-B500-R.device @@ -0,0 +1,92 @@ +[device info] +model_name = H54P-200-B500-R +device_type = dynamixel + +[type info] +torque_to_current_value_ratio = 146.502114 +velocity_to_value_ratio = 954.93 +value_of_0_radian_position = 0 +value_of_min_radian_position = -501923 +value_of_max_radian_position = 501923 +min_radian = -3.14159265 +max_radian = 3.14159265 + +torque_enable_item_name = torque_enable +present_position_item_name = present_position +present_velocity_item_name = present_velocity +present_current_item_name = present_current +goal_position_item_name = goal_position +goal_velocity_item_name = goal_velocity +goal_current_item_name = goal_current +position_d_gain_item_name = position_d_gain +position_i_gain_item_name = position_i_gain +position_p_gain_item_name = position_p_gain +velocity_d_gain_item_name = +velocity_i_gain_item_name = velocity_i_gain +velocity_p_gain_item_name = velocity_p_gain + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 6 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 7 | ID | 1 | RW | EEPROM | 0 | 252 | N + 8 | baudrate | 1 | RW | EEPROM | 0 | 8 | N + 9 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 10 | drive_mode | 1 | RW | EEPROM | 0 | 3 | N + 11 | operating_mode | 1 | RW | EEPROM | 0 | 4 | N + 12 | secondary_id | 1 | RW | EEPROM | 0 | 255 | N + 13 | protocol_version | 1 | RW | EEPROM | 1 | 2 | N + 20 | homing_offset | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 24 | moving_threshold | 4 | RW | EEPROM | 0 | 2147483647 | N + 31 | max_temperature_limit | 1 | RW | EEPROM | 0 | 100 | N + 32 | max_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 34 | min_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 36 | pwm_limit | 2 | RW | EEPROM | 0 | 885 | N + 38 | current_limit | 2 | RW | EEPROM | 0 | 32767 | N + 40 | acceleration_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 44 | velocity_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 48 | max_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 52 | min_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 56 | external_port_mod_1 | 1 | RW | EEPROM | 0 | 3 | N + 57 | external_port_mod_2 | 1 | RW | EEPROM | 0 | 3 | N + 58 | external_port_mod_3 | 1 | RW | EEPROM | 0 | 3 | N + 59 | external_port_mod_4 | 1 | RW | EEPROM | 0 | 3 | N + 63 | shutdown | 1 | RW | EEPROM | 0 | 255 | N + 168 | indirect_address_1 | 2 | RW | EEPROM | 0 | 65535 | N + 512 | torque_enable | 1 | RW | RAM | 0 | 1 | N + 513 | LED_RED | 1 | RW | RAM | 0 | 255 | N + 514 | LED_GREEN | 1 | RW | RAM | 0 | 255 | N + 515 | LED_BLUE | 1 | RW | RAM | 0 | 255 | N + 516 | status_return_level | 1 | RW | RAM | 0 | 2 | N + 517 | registerd_instruction | 1 | R | RAM | 0 | 1 | N + 518 | hardware_error_status | 1 | R | RAM | 0 | 31 | N + 524 | velocity_i_gain | 2 | RW | RAM | 0 | 2047 | N + 526 | velocity_p_gain | 2 | RW | RAM | 0 | 2047 | N + 528 | position_d_gain | 2 | RW | RAM | 0 | 2047 | N + 530 | position_i_gain | 2 | RW | RAM | 0 | 2047 | N + 532 | position_p_gain | 2 | RW | RAM | 0 | 2047 | N + 536 | feedforward_2nd_gain | 2 | RW | RAM | 0 | 32767 | N + 538 | feedforward_1st_gain | 2 | RW | RAM | 0 | 32767 | N + 546 | bus_watchdog | 1 | RW | RAM | -1 | 127 | Y + 548 | goal_pwm | 2 | RW | RAM | -2100 | 2100 | Y + 550 | goal_current | 2 | RW | RAM | -32768 | 32767 | Y + 552 | goal_velocity | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 556 | profile_acceleration | 4 | RW | RAM | 0 | 32767 | N + 560 | profile_velocity | 4 | RW | RAM | 0 | 1023 | N + 564 | goal_position | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 568 | realtime_tick | 2 | R | RAM | 0 | 32767 | N + 570 | moving | 1 | R | RAM | 0 | 1 | N + 571 | moving_status | 1 | R | RAM | 0 | 255 | N + 572 | present_pwm | 2 | R | RAM | -2100 | 2100 | Y + 574 | present_current | 2 | R | RAM | -32768 | 32767 | Y + 576 | present_velocity | 4 | R | RAM | -2147483648 | 2147483647 | Y + 580 | present_position | 4 | R | RAM | -2147483648 | 2147483647 | Y + 584 | velocity_trajectory | 4 | R | RAM | 0 | 1023 | N + 588 | position_trajectory | 4 | R | RAM | 0 | 4095 | N + 592 | present_voltage | 2 | R | RAM | 0 | 500 | N + 594 | present_temperature | 1 | R | RAM | 0 | 200 | N + 600 | external_port_data_1 | 2 | RW | RAM | 0 | 4095 | N + 602 | external_port_data_2 | 2 | RW | RAM | 0 | 4095 | N + 604 | external_port_data_3 | 2 | RW | RAM | 0 | 4095 | N + 606 | external_port_data_4 | 2 | RW | RAM | 0 | 4095 | N + 634 | indirect_data_1 | 1 | RW | RAM | 0 | 255 | N diff --git a/humanoid_robot_intelligence_control_system_device/devices/dynamixel/H54P-200-S500-R.device b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/H54P-200-S500-R.device new file mode 100644 index 0000000..c58460e --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/H54P-200-S500-R.device @@ -0,0 +1,92 @@ +[device info] +model_name = H54P-200-S500-R +device_type = dynamixel + +[type info] +torque_to_current_value_ratio = 146.502114 +velocity_to_value_ratio = 954.93 +value_of_0_radian_position = 0 +value_of_min_radian_position = -501923 +value_of_max_radian_position = 501923 +min_radian = -3.14159265 +max_radian = 3.14159265 + +torque_enable_item_name = torque_enable +present_position_item_name = present_position +present_velocity_item_name = present_velocity +present_current_item_name = present_current +goal_position_item_name = goal_position +goal_velocity_item_name = goal_velocity +goal_current_item_name = goal_current +position_d_gain_item_name = position_d_gain +position_i_gain_item_name = position_i_gain +position_p_gain_item_name = position_p_gain +velocity_d_gain_item_name = +velocity_i_gain_item_name = velocity_i_gain +velocity_p_gain_item_name = velocity_p_gain + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 6 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 7 | ID | 1 | RW | EEPROM | 0 | 252 | N + 8 | baudrate | 1 | RW | EEPROM | 0 | 8 | N + 9 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 10 | drive_mode | 1 | RW | EEPROM | 0 | 3 | N + 11 | operating_mode | 1 | RW | EEPROM | 0 | 4 | N + 12 | secondary_id | 1 | RW | EEPROM | 0 | 255 | N + 13 | protocol_version | 1 | RW | EEPROM | 1 | 2 | N + 20 | homing_offset | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 24 | moving_threshold | 4 | RW | EEPROM | 0 | 2147483647 | N + 31 | max_temperature_limit | 1 | RW | EEPROM | 0 | 100 | N + 32 | max_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 34 | min_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 36 | pwm_limit | 2 | RW | EEPROM | 0 | 885 | N + 38 | current_limit | 2 | RW | EEPROM | 0 | 32767 | N + 40 | acceleration_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 44 | velocity_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 48 | max_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 52 | min_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 56 | external_port_mod_1 | 1 | RW | EEPROM | 0 | 3 | N + 57 | external_port_mod_2 | 1 | RW | EEPROM | 0 | 3 | N + 58 | external_port_mod_3 | 1 | RW | EEPROM | 0 | 3 | N + 59 | external_port_mod_4 | 1 | RW | EEPROM | 0 | 3 | N + 63 | shutdown | 1 | RW | EEPROM | 0 | 255 | N + 168 | indirect_address_1 | 2 | RW | EEPROM | 0 | 65535 | N + 512 | torque_enable | 1 | RW | RAM | 0 | 1 | N + 513 | LED_RED | 1 | RW | RAM | 0 | 255 | N + 514 | LED_GREEN | 1 | RW | RAM | 0 | 255 | N + 515 | LED_BLUE | 1 | RW | RAM | 0 | 255 | N + 516 | status_return_level | 1 | RW | RAM | 0 | 2 | N + 517 | registerd_instruction | 1 | R | RAM | 0 | 1 | N + 518 | hardware_error_status | 1 | R | RAM | 0 | 31 | N + 524 | velocity_i_gain | 2 | RW | RAM | 0 | 2047 | N + 526 | velocity_p_gain | 2 | RW | RAM | 0 | 2047 | N + 528 | position_d_gain | 2 | RW | RAM | 0 | 2047 | N + 530 | position_i_gain | 2 | RW | RAM | 0 | 2047 | N + 532 | position_p_gain | 2 | RW | RAM | 0 | 2047 | N + 536 | feedforward_2nd_gain | 2 | RW | RAM | 0 | 32767 | N + 538 | feedforward_1st_gain | 2 | RW | RAM | 0 | 32767 | N + 546 | bus_watchdog | 1 | RW | RAM | -1 | 127 | Y + 548 | goal_pwm | 2 | RW | RAM | -2100 | 2100 | Y + 550 | goal_current | 2 | RW | RAM | -32768 | 32767 | Y + 552 | goal_velocity | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 556 | profile_acceleration | 4 | RW | RAM | 0 | 32767 | N + 560 | profile_velocity | 4 | RW | RAM | 0 | 1023 | N + 564 | goal_position | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 568 | realtime_tick | 2 | R | RAM | 0 | 32767 | N + 570 | moving | 1 | R | RAM | 0 | 1 | N + 571 | moving_status | 1 | R | RAM | 0 | 255 | N + 572 | present_pwm | 2 | R | RAM | -2100 | 2100 | Y + 574 | present_current | 2 | R | RAM | -32768 | 32767 | Y + 576 | present_velocity | 4 | R | RAM | -2147483648 | 2147483647 | Y + 580 | present_position | 4 | R | RAM | -2147483648 | 2147483647 | Y + 584 | velocity_trajectory | 4 | R | RAM | 0 | 1023 | N + 588 | position_trajectory | 4 | R | RAM | 0 | 4095 | N + 592 | present_voltage | 2 | R | RAM | 0 | 500 | N + 594 | present_temperature | 1 | R | RAM | 0 | 200 | N + 600 | external_port_data_1 | 2 | RW | RAM | 0 | 4095 | N + 602 | external_port_data_2 | 2 | RW | RAM | 0 | 4095 | N + 604 | external_port_data_3 | 2 | RW | RAM | 0 | 4095 | N + 606 | external_port_data_4 | 2 | RW | RAM | 0 | 4095 | N + 634 | indirect_data_1 | 1 | RW | RAM | 0 | 255 | N diff --git a/humanoid_robot_intelligence_control_system_device/devices/dynamixel/L42-10-S300-R.device b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/L42-10-S300-R.device new file mode 100755 index 0000000..8d861f1 --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/L42-10-S300-R.device @@ -0,0 +1,73 @@ +[device info] +model_name = L42-10-S300-R +device_type = dynamixel + +[type info] +value_of_0_radian_position = 0 +value_of_min_radian_position = -2047 +value_of_max_radian_position = 2048 +min_radian = -3.14159265 +max_radian = 3.14159265 + +torque_enable_item_name = torque_enable +present_position_item_name = present_position +present_velocity_item_name = present_velocity +present_current_item_name = present_current +goal_position_item_name = goal_position +goal_velocity_item_name = goal_velocity +goal_current_item_name = goal_torque +position_d_gain_item_name = +position_i_gain_item_name = +position_p_gain_item_name = position_p_gain +velocity_d_gain_item_name = +velocity_i_gain_item_name = velocity_i_gain +velocity_p_gain_item_name = velocity_p_gain + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 6 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 7 | ID | 1 | RW | EEPROM | 0 | 252 | N + 8 | baudrate | 1 | RW | EEPROM | 0 | 8 | N + 9 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 11 | operating_mode | 1 | RW | EEPROM | 0 | 4 | N + 17 | moving_threshold | 4 | RW | EEPROM | 0 | 2147483647 | N + 21 | max_temperature_limit | 1 | RW | EEPROM | 0 | 100 | N + 22 | max_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 24 | min_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 26 | acceleration_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 30 | torque_limit | 2 | RW | EEPROM | 0 | 32767 | N + 32 | velocity_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 36 | max_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 40 | min_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 44 | external_port_mod_1 | 1 | RW | EEPROM | 0 | 3 | N + 45 | external_port_mod_2 | 1 | RW | EEPROM | 0 | 3 | N + 46 | external_port_mod_3 | 1 | RW | EEPROM | 0 | 3 | N + 47 | external_port_mod_4 | 1 | RW | EEPROM | 0 | 3 | N + 48 | shutdown | 1 | RW | EEPROM | 0 | 255 | N + 49 | indirect_address_1 | 2 | RW | EEPROM | 0 | 65535 | N + 562 | torque_enable | 1 | RW | RAM | 0 | 1 | N + 563 | LED_RED | 1 | RW | RAM | 0 | 255 | N + 564 | LED_GREEN | 1 | RW | RAM | 0 | 255 | N + 565 | LED_BLUE | 1 | RW | RAM | 0 | 255 | N + 586 | velocity_i_gain | 2 | RW | RAM | 0 | 2047 | N + 588 | velocity_p_gain | 2 | RW | RAM | 0 | 2047 | N + 594 | position_p_gain | 2 | RW | RAM | 0 | 2047 | N + 596 | goal_position | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 600 | goal_velocity | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 604 | goal_torque | 2 | RW | RAM | -32768 | 32767 | Y + 606 | goal_acceleration | 4 | RW | RAM | 0 | 2147483647 | N + 610 | is_moving | 1 | R | RAM | 0 | 1 | N + 611 | present_position | 4 | R | RAM | -2147483648 | 2147483647 | Y + 615 | present_velocity | 4 | R | RAM | -2147483648 | 2147483647 | Y + 621 | present_current | 2 | R | RAM | -32768 | 32767 | Y + 623 | present_voltage | 2 | R | RAM | 0 | 500 | N + 625 | present_temperature | 1 | R | RAM | 0 | 200 | N + 626 | external_port_data_1 | 2 | RW | RAM | 0 | 4095 | N + 628 | external_port_data_2 | 2 | RW | RAM | 0 | 4095 | N + 630 | external_port_data_3 | 2 | RW | RAM | 0 | 4095 | N + 632 | external_port_data_4 | 2 | RW | RAM | 0 | 4095 | N + 634 | indirect_data_1 | 1 | RW | RAM | 0 | 255 | N + 890 | registerd_instruction | 1 | R | RAM | 0 | 1 | N + 891 | status_return_level | 1 | RW | RAM | 0 | 2 | N + 892 | hardware_error_status | 2 | R | RAM | 0 | 31 | N diff --git a/humanoid_robot_intelligence_control_system_device/devices/dynamixel/L54-30-S400-R.device b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/L54-30-S400-R.device new file mode 100755 index 0000000..71fa09d --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/L54-30-S400-R.device @@ -0,0 +1,74 @@ +[device info] +model_name = L54-30-S400-R +device_type = dynamixel + +[type info] +value_of_0_radian_position = 0 +value_of_min_radian_position = -144198 +value_of_max_radian_position = 144198 +min_radian = -3.14159265 +max_radian = 3.14159265 + +torque_enable_item_name = torque_enable +present_position_item_name = present_position +present_velocity_item_name = present_velocity +present_current_item_name = present_current +goal_position_item_name = goal_position +goal_velocity_item_name = goal_velocity +goal_current_item_name = goal_torque +position_d_gain_item_name = +position_i_gain_item_name = +position_p_gain_item_name = position_p_gain +velocity_d_gain_item_name = +velocity_i_gain_item_name = velocity_i_gain +velocity_p_gain_item_name = velocity_p_gain + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 6 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 7 | ID | 1 | RW | EEPROM | 0 | 252 | N + 8 | baudrate | 1 | RW | EEPROM | 0 | 8 | N + 9 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 11 | operating_mode | 1 | RW | EEPROM | 0 | 4 | N + 13 | homing_offset | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 17 | moving_threshold | 4 | RW | EEPROM | 0 | 2147483647 | N + 21 | max_temperature_limit | 1 | RW | EEPROM | 0 | 100 | N + 22 | max_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 24 | min_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 26 | acceleration_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 30 | torque_limit | 2 | RW | EEPROM | 0 | 32767 | N + 32 | velocity_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 36 | max_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 40 | min_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 44 | external_port_mod_1 | 1 | RW | EEPROM | 0 | 3 | N + 45 | external_port_mod_2 | 1 | RW | EEPROM | 0 | 3 | N + 46 | external_port_mod_3 | 1 | RW | EEPROM | 0 | 3 | N + 47 | external_port_mod_4 | 1 | RW | EEPROM | 0 | 3 | N + 48 | shutdown | 1 | RW | EEPROM | 0 | 255 | N + 49 | indirect_address_1 | 2 | RW | EEPROM | 0 | 65535 | N + 562 | torque_enable | 1 | RW | RAM | 0 | 1 | N + 563 | LED_RED | 1 | RW | RAM | 0 | 255 | N + 564 | LED_GREEN | 1 | RW | RAM | 0 | 255 | N + 565 | LED_BLUE | 1 | RW | RAM | 0 | 255 | N + 586 | velocity_i_gain | 2 | RW | RAM | 0 | 2047 | N + 588 | velocity_p_gain | 2 | RW | RAM | 0 | 2047 | N + 594 | position_p_gain | 2 | RW | RAM | 0 | 2047 | N + 596 | goal_position | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 600 | goal_velocity | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 604 | goal_torque | 2 | RW | RAM | -32768 | 32767 | Y + 606 | goal_acceleration | 4 | RW | RAM | 0 | 2147483647 | N + 610 | is_moving | 1 | R | RAM | 0 | 1 | N + 611 | present_position | 4 | R | RAM | -2147483648 | 2147483647 | Y + 615 | present_velocity | 4 | R | RAM | -2147483648 | 2147483647 | Y + 621 | present_current | 2 | R | RAM | -32768 | 32767 | Y + 623 | present_voltage | 2 | R | RAM | 0 | 500 | N + 625 | present_temperature | 1 | R | RAM | 0 | 200 | N + 626 | external_port_data_1 | 2 | RW | RAM | 0 | 4095 | N + 628 | external_port_data_2 | 2 | RW | RAM | 0 | 4095 | N + 630 | external_port_data_3 | 2 | RW | RAM | 0 | 4095 | N + 632 | external_port_data_4 | 2 | RW | RAM | 0 | 4095 | N + 634 | indirect_data_1 | 1 | RW | RAM | 0 | 255 | N + 890 | registerd_instruction | 1 | R | RAM | 0 | 1 | N + 891 | status_return_level | 1 | RW | RAM | 0 | 2 | N + 892 | hardware_error_status | 2 | R | RAM | 0 | 31 | N diff --git a/humanoid_robot_intelligence_control_system_device/devices/dynamixel/L54-30-S500-R.device b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/L54-30-S500-R.device new file mode 100755 index 0000000..5a8add7 --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/L54-30-S500-R.device @@ -0,0 +1,74 @@ +[device info] +model_name = L54-30-S500-R +device_type = dynamixel + +[type info] +value_of_0_radian_position = 0 +value_of_min_radian_position = -180684 +value_of_max_radian_position = 180684 +min_radian = -3.14159265 +max_radian = 3.14159265 + +torque_enable_item_name = torque_enable +present_position_item_name = present_position +present_velocity_item_name = present_velocity +present_current_item_name = present_current +goal_position_item_name = goal_position +goal_velocity_item_name = goal_velocity +goal_current_item_name = goal_torque +position_d_gain_item_name = +position_i_gain_item_name = +position_p_gain_item_name = position_p_gain +velocity_d_gain_item_name = +velocity_i_gain_item_name = velocity_i_gain +velocity_p_gain_item_name = velocity_p_gain + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 6 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 7 | ID | 1 | RW | EEPROM | 0 | 252 | N + 8 | baudrate | 1 | RW | EEPROM | 0 | 8 | N + 9 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 11 | operating_mode | 1 | RW | EEPROM | 0 | 4 | N + 13 | homing_offset | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 17 | moving_threshold | 4 | RW | EEPROM | 0 | 2147483647 | N + 21 | max_temperature_limit | 1 | RW | EEPROM | 0 | 100 | N + 22 | max_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 24 | min_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 26 | acceleration_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 30 | torque_limit | 2 | RW | EEPROM | 0 | 32767 | N + 32 | velocity_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 36 | max_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 40 | min_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 44 | external_port_mod_1 | 1 | RW | EEPROM | 0 | 3 | N + 45 | external_port_mod_2 | 1 | RW | EEPROM | 0 | 3 | N + 46 | external_port_mod_3 | 1 | RW | EEPROM | 0 | 3 | N + 47 | external_port_mod_4 | 1 | RW | EEPROM | 0 | 3 | N + 48 | shutdown | 1 | RW | EEPROM | 0 | 255 | N + 49 | indirect_address_1 | 2 | RW | EEPROM | 0 | 65535 | N + 562 | torque_enable | 1 | RW | RAM | 0 | 1 | N + 563 | LED_RED | 1 | RW | RAM | 0 | 255 | N + 564 | LED_GREEN | 1 | RW | RAM | 0 | 255 | N + 565 | LED_BLUE | 1 | RW | RAM | 0 | 255 | N + 586 | velocity_i_gain | 2 | RW | RAM | 0 | 2047 | N + 588 | velocity_p_gain | 2 | RW | RAM | 0 | 2047 | N + 594 | position_p_gain | 2 | RW | RAM | 0 | 2047 | N + 596 | goal_position | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 600 | goal_velocity | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 604 | goal_torque | 2 | RW | RAM | -32768 | 32767 | Y + 606 | goal_acceleration | 4 | RW | RAM | 0 | 2147483647 | N + 610 | is_moving | 1 | R | RAM | 0 | 1 | N + 611 | present_position | 4 | R | RAM | -2147483648 | 2147483647 | Y + 615 | present_velocity | 4 | R | RAM | -2147483648 | 2147483647 | Y + 621 | present_current | 2 | R | RAM | -32768 | 32767 | Y + 623 | present_voltage | 2 | R | RAM | 0 | 500 | N + 625 | present_temperature | 1 | R | RAM | 0 | 200 | N + 626 | external_port_data_1 | 2 | RW | RAM | 0 | 4095 | N + 628 | external_port_data_2 | 2 | RW | RAM | 0 | 4095 | N + 630 | external_port_data_3 | 2 | RW | RAM | 0 | 4095 | N + 632 | external_port_data_4 | 2 | RW | RAM | 0 | 4095 | N + 634 | indirect_data_1 | 1 | RW | RAM | 0 | 255 | N + 890 | registerd_instruction | 1 | R | RAM | 0 | 1 | N + 891 | status_return_level | 1 | RW | RAM | 0 | 2 | N + 892 | hardware_error_status | 2 | R | RAM | 0 | 31 | N diff --git a/humanoid_robot_intelligence_control_system_device/devices/dynamixel/L54-50-S290-R.device b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/L54-50-S290-R.device new file mode 100755 index 0000000..7af9c22 --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/L54-50-S290-R.device @@ -0,0 +1,74 @@ +[device info] +model_name = L54-50-S290-R +device_type = dynamixel + +[type info] +value_of_0_radian_position = 0 +value_of_min_radian_position = -103860 +value_of_max_radian_position = 103860 +min_radian = -3.14159265 +max_radian = 3.14159265 + +torque_enable_item_name = torque_enable +present_position_item_name = present_position +present_velocity_item_name = present_velocity +present_current_item_name = present_current +goal_position_item_name = goal_position +goal_velocity_item_name = goal_velocity +goal_current_item_name = goal_torque +position_d_gain_item_name = +position_i_gain_item_name = +position_p_gain_item_name = position_p_gain +velocity_d_gain_item_name = +velocity_i_gain_item_name = velocity_i_gain +velocity_p_gain_item_name = velocity_p_gain + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 6 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 7 | ID | 1 | RW | EEPROM | 0 | 252 | N + 8 | baudrate | 1 | RW | EEPROM | 0 | 8 | N + 9 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 11 | operating_mode | 1 | RW | EEPROM | 0 | 4 | N + 13 | homing_offset | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 17 | moving_threshold | 4 | RW | EEPROM | 0 | 2147483647 | N + 21 | max_temperature_limit | 1 | RW | EEPROM | 0 | 100 | N + 22 | max_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 24 | min_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 26 | acceleration_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 30 | torque_limit | 2 | RW | EEPROM | 0 | 32767 | N + 32 | velocity_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 36 | max_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 40 | min_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 44 | external_port_mod_1 | 1 | RW | EEPROM | 0 | 3 | N + 45 | external_port_mod_2 | 1 | RW | EEPROM | 0 | 3 | N + 46 | external_port_mod_3 | 1 | RW | EEPROM | 0 | 3 | N + 47 | external_port_mod_4 | 1 | RW | EEPROM | 0 | 3 | N + 48 | shutdown | 1 | RW | EEPROM | 0 | 255 | N + 49 | indirect_address_1 | 2 | RW | EEPROM | 0 | 65535 | N + 562 | torque_enable | 1 | RW | RAM | 0 | 1 | N + 563 | LED_RED | 1 | RW | RAM | 0 | 255 | N + 564 | LED_GREEN | 1 | RW | RAM | 0 | 255 | N + 565 | LED_BLUE | 1 | RW | RAM | 0 | 255 | N + 586 | velocity_i_gain | 2 | RW | RAM | 0 | 2047 | N + 588 | velocity_p_gain | 2 | RW | RAM | 0 | 2047 | N + 594 | position_p_gain | 2 | RW | RAM | 0 | 2047 | N + 596 | goal_position | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 600 | goal_velocity | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 604 | goal_torque | 2 | RW | RAM | -32768 | 32767 | Y + 606 | goal_acceleration | 4 | RW | RAM | 0 | 2147483647 | N + 610 | is_moving | 1 | R | RAM | 0 | 1 | N + 611 | present_position | 4 | R | RAM | -2147483648 | 2147483647 | Y + 615 | present_velocity | 4 | R | RAM | -2147483648 | 2147483647 | Y + 621 | present_current | 2 | R | RAM | -32768 | 32767 | Y + 623 | present_voltage | 2 | R | RAM | 0 | 500 | N + 625 | present_temperature | 1 | R | RAM | 0 | 200 | N + 626 | external_port_data_1 | 2 | RW | RAM | 0 | 4095 | N + 628 | external_port_data_2 | 2 | RW | RAM | 0 | 4095 | N + 630 | external_port_data_3 | 2 | RW | RAM | 0 | 4095 | N + 632 | external_port_data_4 | 2 | RW | RAM | 0 | 4095 | N + 634 | indirect_data_1 | 1 | RW | RAM | 0 | 255 | N + 890 | registerd_instruction | 1 | R | RAM | 0 | 1 | N + 891 | status_return_level | 1 | RW | RAM | 0 | 2 | N + 892 | hardware_error_status | 2 | R | RAM | 0 | 31 | N diff --git a/humanoid_robot_intelligence_control_system_device/devices/dynamixel/L54-50-S500-R.device b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/L54-50-S500-R.device new file mode 100755 index 0000000..11d63b3 --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/L54-50-S500-R.device @@ -0,0 +1,74 @@ +[device info] +model_name = L54-50-S500-R +device_type = dynamixel + +[type info] +value_of_0_radian_position = 0 +value_of_min_radian_position = -180684 +value_of_max_radian_position = 180684 +min_radian = -3.14159265 +max_radian = 3.14159265 + +torque_enable_item_name = torque_enable +present_position_item_name = present_position +present_velocity_item_name = present_velocity +present_current_item_name = present_current +goal_position_item_name = goal_position +goal_velocity_item_name = goal_velocity +goal_current_item_name = goal_torque +position_d_gain_item_name = +position_i_gain_item_name = +position_p_gain_item_name = position_p_gain +velocity_d_gain_item_name = +velocity_i_gain_item_name = velocity_i_gain +velocity_p_gain_item_name = velocity_p_gain + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 6 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 7 | ID | 1 | RW | EEPROM | 0 | 252 | N + 8 | baudrate | 1 | RW | EEPROM | 0 | 8 | N + 9 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 11 | operating_mode | 1 | RW | EEPROM | 0 | 4 | N + 13 | homing_offset | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 17 | moving_threshold | 4 | RW | EEPROM | 0 | 2147483647 | N + 21 | max_temperature_limit | 1 | RW | EEPROM | 0 | 100 | N + 22 | max_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 24 | min_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 26 | acceleration_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 30 | torque_limit | 2 | RW | EEPROM | 0 | 32767 | N + 32 | velocity_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 36 | max_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 40 | min_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 44 | external_port_mod_1 | 1 | RW | EEPROM | 0 | 3 | N + 45 | external_port_mod_2 | 1 | RW | EEPROM | 0 | 3 | N + 46 | external_port_mod_3 | 1 | RW | EEPROM | 0 | 3 | N + 47 | external_port_mod_4 | 1 | RW | EEPROM | 0 | 3 | N + 48 | shutdown | 1 | RW | EEPROM | 0 | 255 | N + 49 | indirect_address_1 | 2 | RW | EEPROM | 0 | 65535 | N + 562 | torque_enable | 1 | RW | RAM | 0 | 1 | N + 563 | LED_RED | 1 | RW | RAM | 0 | 255 | N + 564 | LED_GREEN | 1 | RW | RAM | 0 | 255 | N + 565 | LED_BLUE | 1 | RW | RAM | 0 | 255 | N + 586 | velocity_i_gain | 2 | RW | RAM | 0 | 2047 | N + 588 | velocity_p_gain | 2 | RW | RAM | 0 | 2047 | N + 594 | position_p_gain | 2 | RW | RAM | 0 | 2047 | N + 596 | goal_position | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 600 | goal_velocity | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 604 | goal_torque | 2 | RW | RAM | -32768 | 32767 | Y + 606 | goal_acceleration | 4 | RW | RAM | 0 | 2147483647 | N + 610 | is_moving | 1 | R | RAM | 0 | 1 | N + 611 | present_position | 4 | R | RAM | -2147483648 | 2147483647 | Y + 615 | present_velocity | 4 | R | RAM | -2147483648 | 2147483647 | Y + 621 | present_current | 2 | R | RAM | -32768 | 32767 | Y + 623 | present_voltage | 2 | R | RAM | 0 | 500 | N + 625 | present_temperature | 1 | R | RAM | 0 | 200 | N + 626 | external_port_data_1 | 2 | RW | RAM | 0 | 4095 | N + 628 | external_port_data_2 | 2 | RW | RAM | 0 | 4095 | N + 630 | external_port_data_3 | 2 | RW | RAM | 0 | 4095 | N + 632 | external_port_data_4 | 2 | RW | RAM | 0 | 4095 | N + 634 | indirect_data_1 | 1 | RW | RAM | 0 | 255 | N + 890 | registerd_instruction | 1 | R | RAM | 0 | 1 | N + 891 | status_return_level | 1 | RW | RAM | 0 | 2 | N + 892 | hardware_error_status | 2 | R | RAM | 0 | 31 | N diff --git a/humanoid_robot_intelligence_control_system_device/devices/dynamixel/M42-10-S260-R.device b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/M42-10-S260-R.device new file mode 100755 index 0000000..ba205bb --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/M42-10-S260-R.device @@ -0,0 +1,74 @@ +[device info] +model_name = M42-10-S260-R +device_type = dynamixel + +[type info] +value_of_0_radian_position = 0 +value_of_min_radian_position = -131584 +value_of_max_radian_position = 131584 +min_radian = -3.14159265 +max_radian = 3.14159265 + +torque_enable_item_name = torque_enable +present_position_item_name = present_position +present_velocity_item_name = present_velocity +present_current_item_name = present_current +goal_position_item_name = goal_position +goal_velocity_item_name = goal_velocity +goal_current_item_name = goal_torque +position_d_gain_item_name = +position_i_gain_item_name = +position_p_gain_item_name = position_p_gain +velocity_d_gain_item_name = +velocity_i_gain_item_name = velocity_i_gain +velocity_p_gain_item_name = velocity_p_gain + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 6 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 7 | ID | 1 | RW | EEPROM | 0 | 252 | N + 8 | baudrate | 1 | RW | EEPROM | 0 | 8 | N + 9 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 11 | operating_mode | 1 | RW | EEPROM | 0 | 4 | N + 13 | homing_offset | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 17 | moving_threshold | 4 | RW | EEPROM | 0 | 2147483647 | N + 21 | max_temperature_limit | 1 | RW | EEPROM | 0 | 100 | N + 22 | max_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 24 | min_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 26 | acceleration_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 30 | torque_limit | 2 | RW | EEPROM | 0 | 32767 | N + 32 | velocity_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 36 | max_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 40 | min_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 44 | external_port_mod_1 | 1 | RW | EEPROM | 0 | 3 | N + 45 | external_port_mod_2 | 1 | RW | EEPROM | 0 | 3 | N + 46 | external_port_mod_3 | 1 | RW | EEPROM | 0 | 3 | N + 47 | external_port_mod_4 | 1 | RW | EEPROM | 0 | 3 | N + 48 | shutdown | 1 | RW | EEPROM | 0 | 255 | N + 49 | indirect_address_1 | 2 | RW | EEPROM | 0 | 65535 | N + 562 | torque_enable | 1 | RW | RAM | 0 | 1 | N + 563 | LED_RED | 1 | RW | RAM | 0 | 255 | N + 564 | LED_GREEN | 1 | RW | RAM | 0 | 255 | N + 565 | LED_BLUE | 1 | RW | RAM | 0 | 255 | N + 586 | velocity_i_gain | 2 | RW | RAM | 0 | 2047 | N + 588 | velocity_p_gain | 2 | RW | RAM | 0 | 2047 | N + 594 | position_p_gain | 2 | RW | RAM | 0 | 2047 | N + 596 | goal_position | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 600 | goal_velocity | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 604 | goal_torque | 2 | RW | RAM | -32768 | 32767 | Y + 606 | goal_acceleration | 4 | RW | RAM | 0 | 2147483647 | N + 610 | is_moving | 1 | R | RAM | 0 | 1 | N + 611 | present_position | 4 | R | RAM | -2147483648 | 2147483647 | Y + 615 | present_velocity | 4 | R | RAM | -2147483648 | 2147483647 | Y + 621 | present_current | 2 | R | RAM | -32768 | 32767 | Y + 623 | present_voltage | 2 | R | RAM | 0 | 500 | N + 625 | present_temperature | 1 | R | RAM | 0 | 200 | N + 626 | external_port_data_1 | 2 | RW | RAM | 0 | 4095 | N + 628 | external_port_data_2 | 2 | RW | RAM | 0 | 4095 | N + 630 | external_port_data_3 | 2 | RW | RAM | 0 | 4095 | N + 632 | external_port_data_4 | 2 | RW | RAM | 0 | 4095 | N + 634 | indirect_data_1 | 1 | RW | RAM | 0 | 255 | N + 890 | registerd_instruction | 1 | R | RAM | 0 | 1 | N + 891 | status_return_level | 1 | RW | RAM | 0 | 2 | N + 892 | hardware_error_status | 2 | R | RAM | 0 | 31 | N diff --git a/humanoid_robot_intelligence_control_system_device/devices/dynamixel/M54-40-S250-R.device b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/M54-40-S250-R.device new file mode 100755 index 0000000..62f9990 --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/M54-40-S250-R.device @@ -0,0 +1,74 @@ +[device info] +model_name = M54-40-S250-R +device_type = dynamixel + +[type info] +value_of_0_radian_position = 0 +value_of_min_radian_position = -125700 +value_of_max_radian_position = 125700 +min_radian = -3.14159265 +max_radian = 3.14159265 + +torque_enable_item_name = torque_enable +present_position_item_name = present_position +present_velocity_item_name = present_velocity +present_current_item_name = present_current +goal_position_item_name = goal_position +goal_velocity_item_name = goal_velocity +goal_current_item_name = goal_torque +position_d_gain_item_name = +position_i_gain_item_name = +position_p_gain_item_name = position_p_gain +velocity_d_gain_item_name = +velocity_i_gain_item_name = velocity_i_gain +velocity_p_gain_item_name = velocity_p_gain + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 6 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 7 | ID | 1 | RW | EEPROM | 0 | 252 | N + 8 | baudrate | 1 | RW | EEPROM | 0 | 8 | N + 9 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 11 | operating_mode | 1 | RW | EEPROM | 0 | 4 | N + 13 | homing_offset | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 17 | moving_threshold | 4 | RW | EEPROM | 0 | 2147483647 | N + 21 | max_temperature_limit | 1 | RW | EEPROM | 0 | 100 | N + 22 | max_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 24 | min_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 26 | acceleration_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 30 | torque_limit | 2 | RW | EEPROM | 0 | 32767 | N + 32 | velocity_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 36 | max_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 40 | min_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 44 | external_port_mod_1 | 1 | RW | EEPROM | 0 | 3 | N + 45 | external_port_mod_2 | 1 | RW | EEPROM | 0 | 3 | N + 46 | external_port_mod_3 | 1 | RW | EEPROM | 0 | 3 | N + 47 | external_port_mod_4 | 1 | RW | EEPROM | 0 | 3 | N + 48 | shutdown | 1 | RW | EEPROM | 0 | 255 | N + 49 | indirect_address_1 | 2 | RW | EEPROM | 0 | 65535 | N + 562 | torque_enable | 1 | RW | RAM | 0 | 1 | N + 563 | LED_RED | 1 | RW | RAM | 0 | 255 | N + 564 | LED_GREEN | 1 | RW | RAM | 0 | 255 | N + 565 | LED_BLUE | 1 | RW | RAM | 0 | 255 | N + 586 | velocity_i_gain | 2 | RW | RAM | 0 | 2047 | N + 588 | velocity_p_gain | 2 | RW | RAM | 0 | 2047 | N + 594 | position_p_gain | 2 | RW | RAM | 0 | 2047 | N + 596 | goal_position | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 600 | goal_velocity | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 604 | goal_torque | 2 | RW | RAM | -32768 | 32767 | Y + 606 | goal_acceleration | 4 | RW | RAM | 0 | 2147483647 | N + 610 | is_moving | 1 | R | RAM | 0 | 1 | N + 611 | present_position | 4 | R | RAM | -2147483648 | 2147483647 | Y + 615 | present_velocity | 4 | R | RAM | -2147483648 | 2147483647 | Y + 621 | present_current | 2 | R | RAM | -32768 | 32767 | Y + 623 | present_voltage | 2 | R | RAM | 0 | 500 | N + 625 | present_temperature | 1 | R | RAM | 0 | 200 | N + 626 | external_port_data_1 | 2 | RW | RAM | 0 | 4095 | N + 628 | external_port_data_2 | 2 | RW | RAM | 0 | 4095 | N + 630 | external_port_data_3 | 2 | RW | RAM | 0 | 4095 | N + 632 | external_port_data_4 | 2 | RW | RAM | 0 | 4095 | N + 634 | indirect_data_1 | 1 | RW | RAM | 0 | 255 | N + 890 | registerd_instruction | 1 | R | RAM | 0 | 1 | N + 891 | status_return_level | 1 | RW | RAM | 0 | 2 | N + 892 | hardware_error_status | 2 | R | RAM | 0 | 31 | N diff --git a/humanoid_robot_intelligence_control_system_device/devices/dynamixel/M54-60-S250-R.device b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/M54-60-S250-R.device new file mode 100755 index 0000000..dd2efde --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/M54-60-S250-R.device @@ -0,0 +1,74 @@ +[device info] +model_name = M54-60-S250-R +device_type = dynamixel + +[type info] +value_of_0_radian_position = 0 +value_of_min_radian_position = -125700 +value_of_max_radian_position = 125700 +min_radian = -3.14159265 +max_radian = 3.14159265 + +torque_enable_item_name = torque_enable +present_position_item_name = present_position +present_velocity_item_name = present_velocity +present_current_item_name = present_current +goal_position_item_name = goal_position +goal_velocity_item_name = goal_velocity +goal_current_item_name = goal_torque +position_d_gain_item_name = +position_i_gain_item_name = +position_p_gain_item_name = position_p_gain +velocity_d_gain_item_name = +velocity_i_gain_item_name = velocity_i_gain +velocity_p_gain_item_name = velocity_p_gain + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 6 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 7 | ID | 1 | RW | EEPROM | 0 | 252 | N + 8 | baudrate | 1 | RW | EEPROM | 0 | 8 | N + 9 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 11 | operating_mode | 1 | RW | EEPROM | 0 | 4 | N + 13 | homing_offset | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 17 | moving_threshold | 4 | RW | EEPROM | 0 | 2147483647 | N + 21 | max_temperature_limit | 1 | RW | EEPROM | 0 | 100 | N + 22 | max_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 24 | min_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 26 | acceleration_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 30 | torque_limit | 2 | RW | EEPROM | 0 | 32767 | N + 32 | velocity_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 36 | max_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 40 | min_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 44 | external_port_mod_1 | 1 | RW | EEPROM | 0 | 3 | N + 45 | external_port_mod_2 | 1 | RW | EEPROM | 0 | 3 | N + 46 | external_port_mod_3 | 1 | RW | EEPROM | 0 | 3 | N + 47 | external_port_mod_4 | 1 | RW | EEPROM | 0 | 3 | N + 48 | shutdown | 1 | RW | EEPROM | 0 | 255 | N + 49 | indirect_address_1 | 2 | RW | EEPROM | 0 | 65535 | N + 562 | torque_enable | 1 | RW | RAM | 0 | 1 | N + 563 | LED_RED | 1 | RW | RAM | 0 | 255 | N + 564 | LED_GREEN | 1 | RW | RAM | 0 | 255 | N + 565 | LED_BLUE | 1 | RW | RAM | 0 | 255 | N + 586 | velocity_i_gain | 2 | RW | RAM | 0 | 2047 | N + 588 | velocity_p_gain | 2 | RW | RAM | 0 | 2047 | N + 594 | position_p_gain | 2 | RW | RAM | 0 | 2047 | N + 596 | goal_position | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 600 | goal_velocity | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 604 | goal_torque | 2 | RW | RAM | -32768 | 32767 | Y + 606 | goal_acceleration | 4 | RW | RAM | 0 | 2147483647 | N + 610 | is_moving | 1 | R | RAM | 0 | 1 | N + 611 | present_position | 4 | R | RAM | -2147483648 | 2147483647 | Y + 615 | present_velocity | 4 | R | RAM | -2147483648 | 2147483647 | Y + 621 | present_current | 2 | R | RAM | -32768 | 32767 | Y + 623 | present_voltage | 2 | R | RAM | 0 | 500 | N + 625 | present_temperature | 1 | R | RAM | 0 | 200 | N + 626 | external_port_data_1 | 2 | RW | RAM | 0 | 4095 | N + 628 | external_port_data_2 | 2 | RW | RAM | 0 | 4095 | N + 630 | external_port_data_3 | 2 | RW | RAM | 0 | 4095 | N + 632 | external_port_data_4 | 2 | RW | RAM | 0 | 4095 | N + 634 | indirect_data_1 | 1 | RW | RAM | 0 | 255 | N + 890 | registerd_instruction | 1 | R | RAM | 0 | 1 | N + 891 | status_return_level | 1 | RW | RAM | 0 | 2 | N + 892 | hardware_error_status | 2 | R | RAM | 0 | 31 | N diff --git a/humanoid_robot_intelligence_control_system_device/devices/dynamixel/MX-106.device b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/MX-106.device new file mode 100755 index 0000000..a122831 --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/MX-106.device @@ -0,0 +1,66 @@ +[device info] +model_name = MX-106 +device_type = dynamixel + +[type info] +value_of_0_radian_position = 2048 +value_of_min_radian_position = 0 +value_of_max_radian_position = 4095 +min_radian = -3.14159265 +max_radian = 3.14159265 + +torque_enable_item_name = torque_enable +present_position_item_name = present_position +present_velocity_item_name = present_velocity +present_current_item_name = +goal_position_item_name = goal_position +goal_velocity_item_name = goal_velocity +goal_current_item_name = +position_d_gain_item_name = position_d_gain +position_i_gain_item_name = position_i_gain +position_p_gain_item_name = position_p_gain +velocity_d_gain_item_name = +velocity_i_gain_item_name = +velocity_p_gain_item_name = + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 2 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 3 | ID | 1 | RW | EEPROM | 0 | 252 | N + 4 | baudrate | 1 | RW | EEPROM | 0 | 252 | N + 5 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 6 | CW_angle_limit | 2 | RW | EEPROM | 0 | 4095 | N + 8 | CCW_angle_limit | 2 | RW | EEPROM | 0 | 4095 | N + 10 | drive_mode | 1 | RW | EEPROM | 0 | 3 | N + 11 | max_temperature_limit | 1 | RW | EEPROM | 0 | 99 | N + 12 | min_voltage_limit | 1 | RW | EEPROM | 0 | 250 | N + 13 | max_voltage_limit | 1 | RW | EEPROM | 0 | 250 | N + 14 | max_torque | 2 | RW | EEPROM | 0 | 1023 | N + 16 | status_return_level | 1 | RW | EEPROM | 0 | 2 | N + 17 | alarm_LED | 1 | RW | EEPROM | 0 | 127 | N + 18 | alarm_shutdown | 1 | RW | EEPROM | 0 | 127 | N + 20 | multi_turn_offset | 2 | RW | EEPROM | -26624 | 26624 | Y + 22 | resolution_dividor | 1 | RW | EEPROM | 1 | 255 | N + 24 | torque_enable | 1 | RW | RAM | 0 | 1 | N + 25 | LED | 1 | RW | RAM | 0 | 1 | N + 26 | position_d_gain | 1 | RW | RAM | 0 | 254 | N + 27 | position_i_gain | 1 | RW | RAM | 0 | 254 | N + 28 | position_p_gain | 1 | RW | RAM | 0 | 254 | N + 30 | goal_position | 2 | RW | RAM | -28672 | 28672 | Y + 32 | goal_velocity | 2 | RW | RAM | 0 | 1023 | N + 34 | goal_torque | 2 | RW | RAM | 0 | 1023 | N + 36 | present_position | 2 | R | RAM | -32768 | 32767 | Y + 38 | present_velocity | 2 | R | RAM | 0 | 2048 | N + 40 | present_load | 2 | R | RAM | 0 | 2048 | N + 42 | present_voltage | 1 | R | RAM | 50 | 250 | N + 43 | present_temperature | 1 | R | RAM | 0 | 99 | N + 44 | registered_instruction | 1 | R | RAM | 0 | 1 | N + 46 | is_moving | 1 | R | RAM | 0 | 1 | N + 47 | EEPROM_lock | 1 | RW | RAM | 0 | 1 | N + 48 | punch | 2 | RW | RAM | 0 | 1023 | N + 68 | current_consumption | 2 | RW | RAM | 0 | 4095 | N + 70 | torque_control_mode | 1 | RW | RAM | 0 | 1 | N + 71 | torque_control_goal | 2 | RW | RAM | 0 | 2047 | N + 73 | goal_acceleration | 1 | RW | RAM | 0 | 254 | N + diff --git a/humanoid_robot_intelligence_control_system_device/devices/dynamixel/MX-28.device b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/MX-28.device new file mode 100755 index 0000000..ae1f877 --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/MX-28.device @@ -0,0 +1,62 @@ +[device info] +model_name = MX-28 +device_type = dynamixel + +[type info] +value_of_0_radian_position = 2048 +value_of_min_radian_position = 0 +value_of_max_radian_position = 4095 +min_radian = -3.14159265 +max_radian = 3.14159265 + +torque_enable_item_name = torque_enable +present_position_item_name = present_position +present_velocity_item_name = present_velocity +present_current_item_name = +goal_position_item_name = goal_position +goal_velocity_item_name = goal_velocity +goal_current_item_name = +position_d_gain_item_name = position_d_gain +position_i_gain_item_name = position_i_gain +position_p_gain_item_name = position_p_gain +velocity_d_gain_item_name = +velocity_i_gain_item_name = +velocity_p_gain_item_name = + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 2 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 3 | ID | 1 | RW | EEPROM | 0 | 252 | N + 4 | baudrate | 1 | RW | EEPROM | 0 | 252 | N + 5 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 6 | CW_angle_limit | 2 | RW | EEPROM | 0 | 4095 | N + 8 | CCW_angle_limit | 2 | RW | EEPROM | 0 | 4095 | N + 10 | drive_mode | 1 | RW | EEPROM | 0 | 3 | N + 11 | max_temperature_limit | 1 | RW | EEPROM | 0 | 99 | N + 12 | min_voltage_limit | 1 | RW | EEPROM | 0 | 250 | N + 13 | max_voltage_limit | 1 | RW | EEPROM | 0 | 250 | N + 14 | max_torque | 2 | RW | EEPROM | 0 | 1023 | N + 16 | status_return_level | 1 | RW | EEPROM | 0 | 2 | N + 17 | alarm_LED | 1 | RW | EEPROM | 0 | 127 | N + 18 | alarm_shutdown | 1 | RW | EEPROM | 0 | 127 | N + 20 | multi_turn_offset | 2 | RW | EEPROM | -26624 | 26624 | Y + 22 | resolution_dividor | 1 | RW | EEPROM | 1 | 255 | N + 24 | torque_enable | 1 | RW | RAM | 0 | 1 | N + 25 | LED | 1 | RW | RAM | 0 | 1 | N + 26 | position_d_gain | 1 | RW | RAM | 0 | 254 | N + 27 | position_i_gain | 1 | RW | RAM | 0 | 254 | N + 28 | position_p_gain | 1 | RW | RAM | 0 | 254 | N + 30 | goal_position | 2 | RW | RAM | -28672 | 28672 | Y + 32 | goal_velocity | 2 | RW | RAM | 0 | 1023 | N + 34 | goal_torque | 2 | RW | RAM | 0 | 1023 | N + 36 | present_position | 2 | R | RAM | -32768 | 32767 | Y + 38 | present_velocity | 2 | R | RAM | 0 | 2048 | N + 40 | present_load | 2 | R | RAM | 0 | 2048 | N + 42 | present_voltage | 1 | R | RAM | 50 | 250 | N + 43 | present_temperature | 1 | R | RAM | 0 | 99 | N + 44 | registered_instruction | 1 | R | RAM | 0 | 1 | N + 46 | is_moving | 1 | R | RAM | 0 | 1 | N + 47 | EEPROM_lock | 1 | RW | RAM | 0 | 1 | N + 48 | punch | 2 | RW | RAM | 0 | 1023 | N + 73 | goal_acceleration | 1 | RW | RAM | 0 | 254 | N diff --git a/humanoid_robot_intelligence_control_system_device/devices/dynamixel/MX-64.device b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/MX-64.device new file mode 100755 index 0000000..c6a50de --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/MX-64.device @@ -0,0 +1,66 @@ +[device info] +model_name = MX-64 +device_type = dynamixel + +[type info] +value_of_0_radian_position = 2048 +value_of_min_radian_position = 0 +value_of_max_radian_position = 4095 +min_radian = -3.14159265 +max_radian = 3.14159265 + +torque_enable_item_name = torque_enable +present_position_item_name = present_position +present_velocity_item_name = present_velocity +present_current_item_name = +goal_position_item_name = goal_position +goal_velocity_item_name = goal_velocity +goal_current_item_name = +position_d_gain_item_name = position_d_gain +position_i_gain_item_name = position_i_gain +position_p_gain_item_name = position_p_gain +velocity_d_gain_item_name = +velocity_i_gain_item_name = +velocity_p_gain_item_name = + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 2 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 3 | ID | 1 | RW | EEPROM | 0 | 252 | N + 4 | baudrate | 1 | RW | EEPROM | 0 | 252 | N + 5 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 6 | CW_angle_limit | 2 | RW | EEPROM | 0 | 4095 | N + 8 | CCW_angle_limit | 2 | RW | EEPROM | 0 | 4095 | N + 10 | drive_mode | 1 | RW | EEPROM | 0 | 3 | N + 11 | max_temperature_limit | 1 | RW | EEPROM | 0 | 99 | N + 12 | min_voltage_limit | 1 | RW | EEPROM | 0 | 250 | N + 13 | max_voltage_limit | 1 | RW | EEPROM | 0 | 250 | N + 14 | max_torque | 2 | RW | EEPROM | 0 | 1023 | N + 16 | status_return_level | 1 | RW | EEPROM | 0 | 2 | N + 17 | alarm_LED | 1 | RW | EEPROM | 0 | 127 | N + 18 | alarm_shutdown | 1 | RW | EEPROM | 0 | 127 | N + 20 | multi_turn_offset | 2 | RW | EEPROM | -26624 | 26624 | Y + 22 | resolution_dividor | 1 | RW | EEPROM | 1 | 255 | N + 24 | torque_enable | 1 | RW | RAM | 0 | 1 | N + 25 | LED | 1 | RW | RAM | 0 | 1 | N + 26 | position_d_gain | 1 | RW | RAM | 0 | 254 | N + 27 | position_i_gain | 1 | RW | RAM | 0 | 254 | N + 28 | position_p_gain | 1 | RW | RAM | 0 | 254 | N + 30 | goal_position | 2 | RW | RAM | -28672 | 28672 | Y + 32 | goal_velocity | 2 | RW | RAM | 0 | 1023 | N + 34 | goal_torque | 2 | RW | RAM | 0 | 1023 | N + 36 | present_position | 2 | R | RAM | -32768 | 32767 | Y + 38 | present_velocity | 2 | R | RAM | 0 | 2048 | N + 40 | present_load | 2 | R | RAM | 0 | 2048 | N + 42 | present_voltage | 1 | R | RAM | 50 | 250 | N + 43 | present_temperature | 1 | R | RAM | 0 | 99 | N + 44 | registered_instruction | 1 | R | RAM | 0 | 1 | N + 46 | is_moving | 1 | R | RAM | 0 | 1 | N + 47 | EEPROM_lock | 1 | RW | RAM | 0 | 1 | N + 48 | punch | 2 | RW | RAM | 0 | 1023 | N + 68 | current_consumption | 2 | RW | RAM | 0 | 4095 | N + 70 | torque_control_mode | 1 | RW | RAM | 0 | 1 | N + 71 | torque_control_goal | 2 | RW | RAM | 0 | 2047 | N + 73 | goal_acceleration | 1 | RW | RAM | 0 | 254 | N + diff --git a/humanoid_robot_intelligence_control_system_device/devices/dynamixel/PH42-020-S300-R.device b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/PH42-020-S300-R.device new file mode 100644 index 0000000..92e9df6 --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/PH42-020-S300-R.device @@ -0,0 +1,92 @@ +[device info] +model_name = PH42-020-S300-R +device_type = dynamixel + +[type info] +torque_to_current_value_ratio = 109.3747778 +velocity_to_value_ratio = 954.93 +value_of_0_radian_position = 0 +value_of_min_radian_position = -303750 +value_of_max_radian_position = 303750 +min_radian = -3.14159265 +max_radian = 3.14159265 + +torque_enable_item_name = torque_enable +present_position_item_name = present_position +present_velocity_item_name = present_velocity +present_current_item_name = present_current +goal_position_item_name = goal_position +goal_velocity_item_name = goal_velocity +goal_current_item_name = goal_current +position_d_gain_item_name = position_d_gain +position_i_gain_item_name = position_i_gain +position_p_gain_item_name = position_p_gain +velocity_d_gain_item_name = +velocity_i_gain_item_name = velocity_i_gain +velocity_p_gain_item_name = velocity_p_gain + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 6 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 7 | ID | 1 | RW | EEPROM | 0 | 252 | N + 8 | baudrate | 1 | RW | EEPROM | 0 | 8 | N + 9 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 10 | drive_mode | 1 | RW | EEPROM | 0 | 3 | N + 11 | operating_mode | 1 | RW | EEPROM | 0 | 4 | N + 12 | secondary_id | 1 | RW | EEPROM | 0 | 255 | N + 13 | protocol_version | 1 | RW | EEPROM | 1 | 2 | N + 20 | homing_offset | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 24 | moving_threshold | 4 | RW | EEPROM | 0 | 2147483647 | N + 31 | max_temperature_limit | 1 | RW | EEPROM | 0 | 100 | N + 32 | max_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 34 | min_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 36 | pwm_limit | 2 | RW | EEPROM | 0 | 885 | N + 38 | current_limit | 2 | RW | EEPROM | 0 | 32767 | N + 40 | acceleration_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 44 | velocity_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 48 | max_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 52 | min_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 56 | external_port_mod_1 | 1 | RW | EEPROM | 0 | 3 | N + 57 | external_port_mod_2 | 1 | RW | EEPROM | 0 | 3 | N + 58 | external_port_mod_3 | 1 | RW | EEPROM | 0 | 3 | N + 59 | external_port_mod_4 | 1 | RW | EEPROM | 0 | 3 | N + 63 | shutdown | 1 | RW | EEPROM | 0 | 255 | N + 168 | indirect_address_1 | 2 | RW | EEPROM | 0 | 65535 | N + 512 | torque_enable | 1 | RW | RAM | 0 | 1 | N + 513 | LED_RED | 1 | RW | RAM | 0 | 255 | N + 514 | LED_GREEN | 1 | RW | RAM | 0 | 255 | N + 515 | LED_BLUE | 1 | RW | RAM | 0 | 255 | N + 516 | status_return_level | 1 | RW | RAM | 0 | 2 | N + 517 | registerd_instruction | 1 | R | RAM | 0 | 1 | N + 518 | hardware_error_status | 1 | R | RAM | 0 | 31 | N + 524 | velocity_i_gain | 2 | RW | RAM | 0 | 2047 | N + 526 | velocity_p_gain | 2 | RW | RAM | 0 | 2047 | N + 528 | position_d_gain | 2 | RW | RAM | 0 | 2047 | N + 530 | position_i_gain | 2 | RW | RAM | 0 | 2047 | N + 532 | position_p_gain | 2 | RW | RAM | 0 | 2047 | N + 536 | feedforward_2nd_gain | 2 | RW | RAM | 0 | 32767 | N + 538 | feedforward_1st_gain | 2 | RW | RAM | 0 | 32767 | N + 546 | bus_watchdog | 1 | RW | RAM | -1 | 127 | Y + 548 | goal_pwm | 2 | RW | RAM | -2100 | 2100 | Y + 550 | goal_current | 2 | RW | RAM | -32768 | 32767 | Y + 552 | goal_velocity | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 556 | profile_acceleration | 4 | RW | RAM | 0 | 32767 | N + 560 | profile_velocity | 4 | RW | RAM | 0 | 1023 | N + 564 | goal_position | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 568 | realtime_tick | 2 | R | RAM | 0 | 32767 | N + 570 | moving | 1 | R | RAM | 0 | 1 | N + 571 | moving_status | 1 | R | RAM | 0 | 255 | N + 572 | present_pwm | 2 | R | RAM | -2100 | 2100 | Y + 574 | present_current | 2 | R | RAM | -32768 | 32767 | Y + 576 | present_velocity | 4 | R | RAM | -2147483648 | 2147483647 | Y + 580 | present_position | 4 | R | RAM | -2147483648 | 2147483647 | Y + 584 | velocity_trajectory | 4 | R | RAM | 0 | 1023 | N + 588 | position_trajectory | 4 | R | RAM | 0 | 4095 | N + 592 | present_voltage | 2 | R | RAM | 0 | 500 | N + 594 | present_temperature | 1 | R | RAM | 0 | 200 | N + 600 | external_port_data_1 | 2 | RW | RAM | 0 | 4095 | N + 602 | external_port_data_2 | 2 | RW | RAM | 0 | 4095 | N + 604 | external_port_data_3 | 2 | RW | RAM | 0 | 4095 | N + 606 | external_port_data_4 | 2 | RW | RAM | 0 | 4095 | N + 634 | indirect_data_1 | 1 | RW | RAM | 0 | 255 | N diff --git a/humanoid_robot_intelligence_control_system_device/devices/dynamixel/PH54-100-S500-R.device b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/PH54-100-S500-R.device new file mode 100644 index 0000000..6dd1ece --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/PH54-100-S500-R.device @@ -0,0 +1,92 @@ +[device info] +model_name = PH54-100-S500-R +device_type = dynamixel + +[type info] +torque_to_current_value_ratio = 155.658486 +velocity_to_value_ratio = 954.93 +value_of_0_radian_position = 0 +value_of_min_radian_position = -501923 +value_of_max_radian_position = 501923 +min_radian = -3.14159265 +max_radian = 3.14159265 + +torque_enable_item_name = torque_enable +present_position_item_name = present_position +present_velocity_item_name = present_velocity +present_current_item_name = present_current +goal_position_item_name = goal_position +goal_velocity_item_name = goal_velocity +goal_current_item_name = goal_current +position_d_gain_item_name = position_d_gain +position_i_gain_item_name = position_i_gain +position_p_gain_item_name = position_p_gain +velocity_d_gain_item_name = +velocity_i_gain_item_name = velocity_i_gain +velocity_p_gain_item_name = velocity_p_gain + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 6 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 7 | ID | 1 | RW | EEPROM | 0 | 252 | N + 8 | baudrate | 1 | RW | EEPROM | 0 | 8 | N + 9 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 10 | drive_mode | 1 | RW | EEPROM | 0 | 3 | N + 11 | operating_mode | 1 | RW | EEPROM | 0 | 4 | N + 12 | secondary_id | 1 | RW | EEPROM | 0 | 255 | N + 13 | protocol_version | 1 | RW | EEPROM | 1 | 2 | N + 20 | homing_offset | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 24 | moving_threshold | 4 | RW | EEPROM | 0 | 2147483647 | N + 31 | max_temperature_limit | 1 | RW | EEPROM | 0 | 100 | N + 32 | max_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 34 | min_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 36 | pwm_limit | 2 | RW | EEPROM | 0 | 885 | N + 38 | current_limit | 2 | RW | EEPROM | 0 | 32767 | N + 40 | acceleration_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 44 | velocity_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 48 | max_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 52 | min_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 56 | external_port_mod_1 | 1 | RW | EEPROM | 0 | 3 | N + 57 | external_port_mod_2 | 1 | RW | EEPROM | 0 | 3 | N + 58 | external_port_mod_3 | 1 | RW | EEPROM | 0 | 3 | N + 59 | external_port_mod_4 | 1 | RW | EEPROM | 0 | 3 | N + 63 | shutdown | 1 | RW | EEPROM | 0 | 255 | N + 168 | indirect_address_1 | 2 | RW | EEPROM | 0 | 65535 | N + 512 | torque_enable | 1 | RW | RAM | 0 | 1 | N + 513 | LED_RED | 1 | RW | RAM | 0 | 255 | N + 514 | LED_GREEN | 1 | RW | RAM | 0 | 255 | N + 515 | LED_BLUE | 1 | RW | RAM | 0 | 255 | N + 516 | status_return_level | 1 | RW | RAM | 0 | 2 | N + 517 | registerd_instruction | 1 | R | RAM | 0 | 1 | N + 518 | hardware_error_status | 1 | R | RAM | 0 | 31 | N + 524 | velocity_i_gain | 2 | RW | RAM | 0 | 2047 | N + 526 | velocity_p_gain | 2 | RW | RAM | 0 | 2047 | N + 528 | position_d_gain | 2 | RW | RAM | 0 | 2047 | N + 530 | position_i_gain | 2 | RW | RAM | 0 | 2047 | N + 532 | position_p_gain | 2 | RW | RAM | 0 | 2047 | N + 536 | feedforward_2nd_gain | 2 | RW | RAM | 0 | 32767 | N + 538 | feedforward_1st_gain | 2 | RW | RAM | 0 | 32767 | N + 546 | bus_watchdog | 1 | RW | RAM | -1 | 127 | Y + 548 | goal_pwm | 2 | RW | RAM | -2100 | 2100 | Y + 550 | goal_current | 2 | RW | RAM | -32768 | 32767 | Y + 552 | goal_velocity | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 556 | profile_acceleration | 4 | RW | RAM | 0 | 32767 | N + 560 | profile_velocity | 4 | RW | RAM | 0 | 1023 | N + 564 | goal_position | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 568 | realtime_tick | 2 | R | RAM | 0 | 32767 | N + 570 | moving | 1 | R | RAM | 0 | 1 | N + 571 | moving_status | 1 | R | RAM | 0 | 255 | N + 572 | present_pwm | 2 | R | RAM | -2100 | 2100 | Y + 574 | present_current | 2 | R | RAM | -32768 | 32767 | Y + 576 | present_velocity | 4 | R | RAM | -2147483648 | 2147483647 | Y + 580 | present_position | 4 | R | RAM | -2147483648 | 2147483647 | Y + 584 | velocity_trajectory | 4 | R | RAM | 0 | 1023 | N + 588 | position_trajectory | 4 | R | RAM | 0 | 4095 | N + 592 | present_voltage | 2 | R | RAM | 0 | 500 | N + 594 | present_temperature | 1 | R | RAM | 0 | 200 | N + 600 | external_port_data_1 | 2 | RW | RAM | 0 | 4095 | N + 602 | external_port_data_2 | 2 | RW | RAM | 0 | 4095 | N + 604 | external_port_data_3 | 2 | RW | RAM | 0 | 4095 | N + 606 | external_port_data_4 | 2 | RW | RAM | 0 | 4095 | N + 634 | indirect_data_1 | 1 | RW | RAM | 0 | 255 | N diff --git a/humanoid_robot_intelligence_control_system_device/devices/dynamixel/PH54-200-S500-R.device b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/PH54-200-S500-R.device new file mode 100644 index 0000000..b758315 --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/PH54-200-S500-R.device @@ -0,0 +1,92 @@ +[device info] +model_name = PH54-200-S500-R +device_type = dynamixel + +[type info] +torque_to_current_value_ratio = 146.502114 +velocity_to_value_ratio = 954.93 +value_of_0_radian_position = 0 +value_of_min_radian_position = -501923 +value_of_max_radian_position = 501923 +min_radian = -3.14159265 +max_radian = 3.14159265 + +torque_enable_item_name = torque_enable +present_position_item_name = present_position +present_velocity_item_name = present_velocity +present_current_item_name = present_current +goal_position_item_name = goal_position +goal_velocity_item_name = goal_velocity +goal_current_item_name = goal_current +position_d_gain_item_name = position_d_gain +position_i_gain_item_name = position_i_gain +position_p_gain_item_name = position_p_gain +velocity_d_gain_item_name = +velocity_i_gain_item_name = velocity_i_gain +velocity_p_gain_item_name = velocity_p_gain + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 6 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 7 | ID | 1 | RW | EEPROM | 0 | 252 | N + 8 | baudrate | 1 | RW | EEPROM | 0 | 8 | N + 9 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 10 | drive_mode | 1 | RW | EEPROM | 0 | 3 | N + 11 | operating_mode | 1 | RW | EEPROM | 0 | 4 | N + 12 | secondary_id | 1 | RW | EEPROM | 0 | 255 | N + 13 | protocol_version | 1 | RW | EEPROM | 1 | 2 | N + 20 | homing_offset | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 24 | moving_threshold | 4 | RW | EEPROM | 0 | 2147483647 | N + 31 | max_temperature_limit | 1 | RW | EEPROM | 0 | 100 | N + 32 | max_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 34 | min_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 36 | pwm_limit | 2 | RW | EEPROM | 0 | 885 | N + 38 | current_limit | 2 | RW | EEPROM | 0 | 32767 | N + 40 | acceleration_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 44 | velocity_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 48 | max_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 52 | min_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 56 | external_port_mod_1 | 1 | RW | EEPROM | 0 | 3 | N + 57 | external_port_mod_2 | 1 | RW | EEPROM | 0 | 3 | N + 58 | external_port_mod_3 | 1 | RW | EEPROM | 0 | 3 | N + 59 | external_port_mod_4 | 1 | RW | EEPROM | 0 | 3 | N + 63 | shutdown | 1 | RW | EEPROM | 0 | 255 | N + 168 | indirect_address_1 | 2 | RW | EEPROM | 0 | 65535 | N + 512 | torque_enable | 1 | RW | RAM | 0 | 1 | N + 513 | LED_RED | 1 | RW | RAM | 0 | 255 | N + 514 | LED_GREEN | 1 | RW | RAM | 0 | 255 | N + 515 | LED_BLUE | 1 | RW | RAM | 0 | 255 | N + 516 | status_return_level | 1 | RW | RAM | 0 | 2 | N + 517 | registerd_instruction | 1 | R | RAM | 0 | 1 | N + 518 | hardware_error_status | 1 | R | RAM | 0 | 31 | N + 524 | velocity_i_gain | 2 | RW | RAM | 0 | 2047 | N + 526 | velocity_p_gain | 2 | RW | RAM | 0 | 2047 | N + 528 | position_d_gain | 2 | RW | RAM | 0 | 2047 | N + 530 | position_i_gain | 2 | RW | RAM | 0 | 2047 | N + 532 | position_p_gain | 2 | RW | RAM | 0 | 2047 | N + 536 | feedforward_2nd_gain | 2 | RW | RAM | 0 | 32767 | N + 538 | feedforward_1st_gain | 2 | RW | RAM | 0 | 32767 | N + 546 | bus_watchdog | 1 | RW | RAM | -1 | 127 | Y + 548 | goal_pwm | 2 | RW | RAM | -2100 | 2100 | Y + 550 | goal_current | 2 | RW | RAM | -32768 | 32767 | Y + 552 | goal_velocity | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 556 | profile_acceleration | 4 | RW | RAM | 0 | 32767 | N + 560 | profile_velocity | 4 | RW | RAM | 0 | 1023 | N + 564 | goal_position | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 568 | realtime_tick | 2 | R | RAM | 0 | 32767 | N + 570 | moving | 1 | R | RAM | 0 | 1 | N + 571 | moving_status | 1 | R | RAM | 0 | 255 | N + 572 | present_pwm | 2 | R | RAM | -2100 | 2100 | Y + 574 | present_current | 2 | R | RAM | -32768 | 32767 | Y + 576 | present_velocity | 4 | R | RAM | -2147483648 | 2147483647 | Y + 580 | present_position | 4 | R | RAM | -2147483648 | 2147483647 | Y + 584 | velocity_trajectory | 4 | R | RAM | 0 | 1023 | N + 588 | position_trajectory | 4 | R | RAM | 0 | 4095 | N + 592 | present_voltage | 2 | R | RAM | 0 | 500 | N + 594 | present_temperature | 1 | R | RAM | 0 | 200 | N + 600 | external_port_data_1 | 2 | RW | RAM | 0 | 4095 | N + 602 | external_port_data_2 | 2 | RW | RAM | 0 | 4095 | N + 604 | external_port_data_3 | 2 | RW | RAM | 0 | 4095 | N + 606 | external_port_data_4 | 2 | RW | RAM | 0 | 4095 | N + 634 | indirect_data_1 | 1 | RW | RAM | 0 | 255 | N diff --git a/humanoid_robot_intelligence_control_system_device/devices/dynamixel/RH-P12-RN(A).device b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/RH-P12-RN(A).device new file mode 100644 index 0000000..31d253b --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/RH-P12-RN(A).device @@ -0,0 +1,90 @@ +[device info] +model_name = RH-P12-RN(A) +device_type = dynamixel + +[type info] +value_of_0_radian_position = 0 +value_of_min_radian_position = 0 +value_of_max_radian_position = 740 +min_radian = 0 +max_radian = 1.150767 + +torque_enable_item_name = torque_enable +present_position_item_name = present_position +present_velocity_item_name = present_velocity +present_current_item_name = present_current +goal_position_item_name = goal_position +goal_velocity_item_name = goal_velocity +goal_current_item_name = goal_current +position_d_gain_item_name = position_d_gain +position_i_gain_item_name = position_i_gain +position_p_gain_item_name = position_p_gain +velocity_d_gain_item_name = +velocity_i_gain_item_name = velocity_i_gain +velocity_p_gain_item_name = velocity_p_gain + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 6 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 7 | ID | 1 | RW | EEPROM | 0 | 252 | N + 8 | baudrate | 1 | RW | EEPROM | 0 | 9 | N + 9 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 10 | drive_mode | 1 | RW | EEPROM | 0 | 1 | N + 11 | operating_mode | 1 | RW | EEPROM | 0 | 4 | N + 12 | secondary_ID | 1 | RW | EEPROM | 0 | 255 | N + 20 | homing_offset | 4 | RW | EEPROM | -1150 | 1150 | Y + 24 | moving_threshold | 4 | RW | EEPROM | 0 | 2970 | N + 31 | max_temperature_limit | 1 | RW | EEPROM | 0 | 100 | N + 32 | max_voltage_limit | 2 | RW | EEPROM | 0 | 350 | N + 34 | min_voltage_limit | 2 | RW | EEPROM | 0 | 350 | N + 36 | pwm_limit | 2 | RW | EEPROM | 0 | 2009 | N + 38 | current_limit | 2 | RW | EEPROM | 0 | 1984 | N + 40 | acceleration_limit | 4 | RW | EEPROM | 0 | 1378788 | N + 44 | velocity_limit | 4 | RW | EEPROM | 0 | 2970 | N + 48 | max_position_limit | 4 | RW | EEPROM | 0 | 1150 | N + 52 | min_position_limit | 4 | RW | EEPROM | 0 | 1150 | N + 56 | external_port_mod_1 | 1 | RW | EEPROM | 0 | 3 | N + 57 | external_port_mod_2 | 1 | RW | EEPROM | 0 | 3 | N + 58 | external_port_mod_3 | 1 | RW | EEPROM | 0 | 3 | N + 59 | external_port_mod_4 | 1 | RW | EEPROM | 0 | 3 | N + 63 | shutdown | 1 | RW | EEPROM | 0 | 255 | N + 168 | indirect_address_1 | 2 | RW | EEPROM | 512 | 1023 | N + 512 | torque_enable | 1 | RW | RAM | 0 | 1 | N + 513 | LED_RED | 1 | RW | RAM | 0 | 255 | N + 514 | LED_GREEN | 1 | RW | RAM | 0 | 255 | N + 515 | LED_BLUE | 1 | RW | RAM | 0 | 255 | N + 516 | status_return_level | 1 | RW | RAM | 0 | 2 | N + 517 | registerd_instruction | 1 | R | RAM | 0 | 1 | N + 518 | hardware_error_status | 2 | R | RAM | 0 | 63 | N + 524 | velocity_i_gain | 2 | RW | RAM | 0 | 32767 | N + 526 | velocity_p_gain | 2 | RW | RAM | 0 | 32767 | N + 528 | position_d_gain | 2 | RW | RAM | 0 | 32767 | N + 530 | position_i_gain | 2 | RW | RAM | 0 | 32767 | N + 532 | position_p_gain | 2 | RW | RAM | 0 | 32767 | N + 536 | feedforward_2nd_gain | 2 | RW | RAM | 0 | 32767 | N + 538 | feedforward_1st_gain | 2 | RW | RAM | 0 | 32767 | N + 546 | bus_watchdog | 1 | RW | RAM | -1 | 127 | Y + 548 | goal_pwm | 2 | RW | RAM | -2009 | 2009 | Y + 550 | goal_current | 2 | RW | RAM | -1984 | 1984 | Y + 552 | goal_velocity | 4 | RW | RAM | -2970 | 2970 | Y + 556 | profile_acceleration | 4 | RW | RAM | 0 | 1378788 | N + 560 | profile_velocity | 4 | RW | RAM | 0 | 2970 | N + 564 | goal_position | 4 | RW | RAM | 0 | 1150 | N + 568 | realtime_tick | 2 | R | RAM | 0 | 32767 | N + 570 | is_moving | 1 | R | RAM | 0 | 1 | N + 571 | moving_status | 1 | R | RAM | 0 | 255 | N + 572 | present_pwm | 2 | R | RAM | -2009 | 2009 | Y + 574 | present_current | 2 | R | RAM | -1984 | 1984 | Y + 576 | present_velocity | 4 | R | RAM | -2970 | 2970 | Y + 580 | present_position | 4 | R | RAM | -1150 | 1150 | Y + 584 | velocity_trajectory | 4 | R | RAM | -2147483648 | 2147483648 | Y + 588 | position_trajectory | 4 | R | RAM | -2147483648 | 2147483648 | Y + 592 | present_voltage | 2 | R | RAM | 0 | 350 | N + 594 | present_temperature | 1 | R | RAM | 0 | 100 | N + 595 | grip_detection | 1 | R | RAM | 0 | 1 | N + 600 | external_port_data_1 | 2 | RW | RAM | 0 | 4095 | N + 602 | external_port_data_2 | 2 | RW | RAM | 0 | 4095 | N + 604 | external_port_data_3 | 2 | RW | RAM | 0 | 4095 | N + 606 | external_port_data_4 | 2 | RW | RAM | 0 | 4095 | N + 634 | indirect_data_1 | 1 | RW | RAM | 0 | 255 | N diff --git a/humanoid_robot_intelligence_control_system_device/devices/dynamixel/RH-P12-RN.device b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/RH-P12-RN.device new file mode 100755 index 0000000..14ed73b --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/RH-P12-RN.device @@ -0,0 +1,73 @@ +[device info] +model_name = RH-P12-RN +device_type = dynamixel + +[type info] +value_of_0_radian_position = 0 +value_of_min_radian_position = 0 +value_of_max_radian_position = 740 +min_radian = 0 +max_radian = 1.150767 + +torque_enable_item_name = torque_enable +present_position_item_name = present_position +present_velocity_item_name = present_velocity +present_current_item_name = present_current +goal_position_item_name = goal_position +goal_velocity_item_name = goal_velocity +goal_current_item_name = goal_current +position_d_gain_item_name = position_d_gain +position_i_gain_item_name = position_i_gain +position_p_gain_item_name = position_p_gain +velocity_d_gain_item_name = +velocity_i_gain_item_name = +velocity_p_gain_item_name = + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 6 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 7 | ID | 1 | RW | EEPROM | 0 | 252 | N + 8 | baudrate | 1 | RW | EEPROM | 0 | 8 | N + 9 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 11 | operating_mode | 1 | RW | EEPROM | 0 | 5 | N + 17 | moving_threshold | 4 | RW | EEPROM | 0 | 2147483647 | N + 21 | max_temperature_limit | 1 | RW | EEPROM | 0 | 100 | N + 22 | max_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 24 | min_voltage_limit | 2 | RW | EEPROM | 0 | 400 | N + 26 | acceleration_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 30 | current_limit | 2 | RW | EEPROM | 0 | 32767 | N + 32 | velocity_limit | 4 | RW | EEPROM | 0 | 2147483647 | N + 36 | max_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 40 | min_position_limit | 4 | RW | EEPROM | -2147483648 | 2147483647 | Y + 44 | external_port_mod_1 | 1 | RW | EEPROM | 0 | 3 | N + 45 | external_port_mod_2 | 1 | RW | EEPROM | 0 | 3 | N + 46 | external_port_mod_3 | 1 | RW | EEPROM | 0 | 3 | N + 47 | external_port_mod_4 | 1 | RW | EEPROM | 0 | 3 | N + 48 | shutdown | 1 | RW | EEPROM | 0 | 255 | N + 49 | indirect_address_1 | 2 | RW | EEPROM | 0 | 65535 | N + 562 | torque_enable | 1 | RW | RAM | 0 | 1 | N + 563 | LED_RED | 1 | RW | RAM | 0 | 255 | N + 564 | LED_GREEN | 1 | RW | RAM | 0 | 255 | N + 565 | LED_BLUE | 1 | RW | RAM | 0 | 255 | N + 590 | position_d_gain | 2 | RW | RAM | 0 | 2047 | N + 592 | position_i_gain | 2 | RW | RAM | 0 | 2047 | N + 594 | position_p_gain | 2 | RW | RAM | 0 | 2047 | N + 596 | goal_position | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 600 | goal_velocity | 4 | RW | RAM | -2147483648 | 2147483647 | Y + 604 | goal_current | 2 | RW | RAM | -32768 | 32767 | Y + 606 | goal_acceleration | 4 | RW | RAM | 0 | 2147483647 | N + 610 | is_moving | 1 | R | RAM | 0 | 1 | N + 611 | present_position | 4 | R | RAM | -2147483648 | 2147483647 | Y + 615 | present_velocity | 4 | R | RAM | -2147483648 | 2147483647 | Y + 621 | present_current | 2 | R | RAM | -32768 | 32767 | Y + 623 | present_voltage | 2 | R | RAM | 0 | 500 | N + 625 | present_temperature | 1 | R | RAM | 0 | 200 | N + 626 | external_port_data_1 | 2 | RW | RAM | 0 | 4095 | N + 628 | external_port_data_2 | 2 | RW | RAM | 0 | 4095 | N + 630 | external_port_data_3 | 2 | RW | RAM | 0 | 4095 | N + 632 | external_port_data_4 | 2 | RW | RAM | 0 | 4095 | N + 634 | indirect_data_1 | 1 | RW | RAM | 0 | 255 | N + 890 | registerd_instruction | 1 | R | RAM | 0 | 1 | N + 891 | status_return_level | 1 | RW | RAM | 0 | 2 | N + 892 | hardware_error_status | 2 | R | RAM | 0 | 31 | N diff --git a/humanoid_robot_intelligence_control_system_device/devices/dynamixel/XM-430.device b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/XM-430.device new file mode 100755 index 0000000..7dfe91d --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/XM-430.device @@ -0,0 +1,82 @@ +[device info] +model_name = XM-430 +device_type = dynamixel + +[type info] +torque_to_current_value_ratio = 149.795386991 + +value_of_0_radian_position = 2048 +value_of_min_radian_position = 0 +value_of_max_radian_position = 4095 +min_radian = -3.14159265 +max_radian = 3.14159265 + +torque_enable_item_name = torque_enable +present_position_item_name = present_position +present_velocity_item_name = present_velocity +present_current_item_name = present_current +goal_position_item_name = goal_position +goal_velocity_item_name = goal_velocity +goal_current_item_name = goal_current +position_d_gain_item_name = position_d_gain +position_i_gain_item_name = position_i_gain +position_p_gain_item_name = position_p_gain +velocity_d_gain_item_name = +velocity_i_gain_item_name = velocity_i_gain +velocity_p_gain_item_name = velocity_p_gain + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 6 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 7 | ID | 1 | RW | EEPROM | 0 | 252 | N + 8 | baudrate | 1 | RW | EEPROM | 0 | 7 | N + 9 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 10 | drive_mode | 1 | RW | EEPROM | 0 | 1 | N + 11 | operating_mode | 1 | RW | EEPROM | 0 | 16 | N + 12 | secondary_id | 1 | RW | EEPROM | 0 | 255 | N + 20 | homing_offset | 4 | RW | EEPROM | -1044479 | 1044479 | Y + 24 | moving_threshold | 4 | RW | EEPROM | 0 | 1023 | N + 31 | max_temperature_limit | 1 | RW | EEPROM | 0 | 100 | N + 32 | max_voltage_limit | 2 | RW | EEPROM | 95 | 160 | N + 34 | min_voltage_limit | 2 | RW | EEPROM | 95 | 160 | N + 36 | pwm_limit | 2 | RW | EEPROM | 0 | 885 | N + 38 | current_limit | 2 | RW | EEPROM | 0 | 1193 | N + 44 | velocity_limit | 4 | RW | EEPROM | 0 | 1023 | N + 48 | max_position_limit | 4 | RW | EEPROM | 0 | 4095 | N + 52 | min_position_limit | 4 | RW | EEPROM | 0 | 4095 | N + 63 | shutdown | 1 | RW | EEPROM | 0 | 255 | N + 64 | torque_enable | 1 | RW | RAM | 0 | 1 | N + 65 | LED | 1 | RW | RAM | 0 | 1 | N + 68 | status_return_level | 1 | RW | RAM | 0 | 2 | N + 69 | registered_instruction | 1 | R | RAM | 0 | 1 | N + 70 | hardware_error_status | 1 | R | RAM | 0 | 255 | N + 76 | velocity_i_gain | 2 | RW | RAM | 0 | 32767 | N + 78 | velocity_p_gain | 2 | RW | RAM | 0 | 32767 | N + 80 | position_d_gain | 2 | RW | RAM | 0 | 32767 | N + 82 | position_i_gain | 2 | RW | RAM | 0 | 32767 | N + 84 | position_p_gain | 2 | RW | RAM | 0 | 32767 | N + 88 | feedforward_2nd_gain | 2 | RW | RAM | 0 | 32767 | N + 90 | feedforward_1st_gain | 2 | RW | RAM | 0 | 32767 | N + 98 | bus_watchdog | 1 | RW | RAM | -1 | 127 | Y + 100 | goal_pwm | 2 | RW | RAM | 0 | 885 | N + 102 | goal_current | 2 | RW | RAM | 0 | 1193 | N + 104 | goal_velocity | 4 | RW | RAM | 0 | 1023 | N + 108 | profile_acceleration | 4 | RW | RAM | 0 | 32767 | N + 112 | profile_velocity | 4 | RW | RAM | 0 | 1023 | N + 116 | goal_position | 4 | RW | RAM | -1048575 | 1048575 | Y + 120 | realtime_tick | 2 | R | RAM | 0 | 32767 | N + 122 | moving | 1 | R | RAM | 0 | 1 | N + 123 | moving_status | 1 | R | RAM | 0 | 255 | N + 124 | present_pwm | 2 | R | RAM | 0 | 885 | N + 126 | present_current | 2 | R | RAM | 0 | 1193 | N + 128 | present_velocity | 4 | R | RAM | 0 | 1023 | N + 132 | present_position | 4 | R | RAM | -2147483648 | 2147483647 | Y + 136 | velocity_trajectory | 4 | R | RAM | 0 | 1023 | N + 140 | position_trajectory | 4 | R | RAM | 0 | 4095 | N + 144 | present_input_voltage | 2 | R | RAM | 95 | 160 | N + 146 | present_temperature | 1 | R | RAM | 0 | 100 | N + 168 | indirect_address_1 | 2 | RW | RAM | 0 | 65535 | N + 224 | indirect_data_1 | 1 | RW | RAM | 0 | 255 | N + 578 | indirect_address_29 | 2 | RW | RAM | 0 | 65535 | N + 634 | indirect_data_29 | 1 | RW | RAM | 0 | 255 | N diff --git a/humanoid_robot_intelligence_control_system_device/devices/dynamixel/XM430-W210.device b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/XM430-W210.device new file mode 100644 index 0000000..6113e04 --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/XM430-W210.device @@ -0,0 +1,83 @@ +[device info] +model_name = XM430-W210 +device_type = dynamixel + +[type info] +torque_to_current_value_ratio = 235.53647082 +velocity_to_value_ratio = 41.707853 + +value_of_0_radian_position = 2048 +value_of_min_radian_position = 0 +value_of_max_radian_position = 4095 +min_radian = -3.14159265 +max_radian = 3.14159265 + +torque_enable_item_name = torque_enable +present_position_item_name = present_position +present_velocity_item_name = present_velocity +present_current_item_name = present_current +goal_position_item_name = goal_position +goal_velocity_item_name = goal_velocity +goal_current_item_name = goal_current +position_d_gain_item_name = position_d_gain +position_i_gain_item_name = position_i_gain +position_p_gain_item_name = position_p_gain +velocity_d_gain_item_name = +velocity_i_gain_item_name = velocity_i_gain +velocity_p_gain_item_name = velocity_p_gain + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 6 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 7 | ID | 1 | RW | EEPROM | 0 | 252 | N + 8 | baudrate | 1 | RW | EEPROM | 0 | 7 | N + 9 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 10 | drive_mode | 1 | RW | EEPROM | 0 | 1 | N + 11 | operating_mode | 1 | RW | EEPROM | 0 | 16 | N + 12 | secondary_id | 1 | RW | EEPROM | 0 | 255 | N + 20 | homing_offset | 4 | RW | EEPROM | -1044479 | 1044479 | Y + 24 | moving_threshold | 4 | RW | EEPROM | 0 | 1023 | N + 31 | max_temperature_limit | 1 | RW | EEPROM | 0 | 100 | N + 32 | max_voltage_limit | 2 | RW | EEPROM | 95 | 160 | N + 34 | min_voltage_limit | 2 | RW | EEPROM | 95 | 160 | N + 36 | pwm_limit | 2 | RW | EEPROM | 0 | 885 | N + 38 | current_limit | 2 | RW | EEPROM | 0 | 1193 | N + 44 | velocity_limit | 4 | RW | EEPROM | 0 | 1023 | N + 48 | max_position_limit | 4 | RW | EEPROM | 0 | 4095 | N + 52 | min_position_limit | 4 | RW | EEPROM | 0 | 4095 | N + 63 | shutdown | 1 | RW | EEPROM | 0 | 255 | N + 64 | torque_enable | 1 | RW | RAM | 0 | 1 | N + 65 | LED | 1 | RW | RAM | 0 | 1 | N + 68 | status_return_level | 1 | RW | RAM | 0 | 2 | N + 69 | registered_instruction | 1 | R | RAM | 0 | 1 | N + 70 | hardware_error_status | 1 | R | RAM | 0 | 255 | N + 76 | velocity_i_gain | 2 | RW | RAM | 0 | 32767 | N + 78 | velocity_p_gain | 2 | RW | RAM | 0 | 32767 | N + 80 | position_d_gain | 2 | RW | RAM | 0 | 32767 | N + 82 | position_i_gain | 2 | RW | RAM | 0 | 32767 | N + 84 | position_p_gain | 2 | RW | RAM | 0 | 32767 | N + 88 | feedforward_2nd_gain | 2 | RW | RAM | 0 | 32767 | N + 90 | feedforward_1st_gain | 2 | RW | RAM | 0 | 32767 | N + 98 | bus_watchdog | 1 | RW | RAM | -1 | 127 | Y + 100 | goal_pwm | 2 | RW | RAM | 0 | 885 | N + 102 | goal_current | 2 | RW | RAM | 0 | 1193 | N + 104 | goal_velocity | 4 | RW | RAM | 0 | 1023 | N + 108 | profile_acceleration | 4 | RW | RAM | 0 | 32767 | N + 112 | profile_velocity | 4 | RW | RAM | 0 | 1023 | N + 116 | goal_position | 4 | RW | RAM | -1048575 | 1048575 | Y + 120 | realtime_tick | 2 | R | RAM | 0 | 32767 | N + 122 | moving | 1 | R | RAM | 0 | 1 | N + 123 | moving_status | 1 | R | RAM | 0 | 255 | N + 124 | present_pwm | 2 | R | RAM | 0 | 885 | N + 126 | present_current | 2 | R | RAM | 0 | 1193 | N + 128 | present_velocity | 4 | R | RAM | 0 | 1023 | N + 132 | present_position | 4 | R | RAM | -2147483648 | 2147483647 | Y + 136 | velocity_trajectory | 4 | R | RAM | 0 | 1023 | N + 140 | position_trajectory | 4 | R | RAM | 0 | 4095 | N + 144 | present_input_voltage | 2 | R | RAM | 95 | 160 | N + 146 | present_temperature | 1 | R | RAM | 0 | 100 | N + 168 | indirect_address_1 | 2 | RW | RAM | 0 | 65535 | N + 224 | indirect_data_1 | 1 | RW | RAM | 0 | 255 | N + 578 | indirect_address_29 | 2 | RW | RAM | 0 | 65535 | N + 634 | indirect_data_29 | 1 | RW | RAM | 0 | 255 | N diff --git a/humanoid_robot_intelligence_control_system_device/devices/dynamixel/XM430-W350.device b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/XM430-W350.device new file mode 100644 index 0000000..e1be362 --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/XM430-W350.device @@ -0,0 +1,83 @@ +[device info] +model_name = XM430-W350 +device_type = dynamixel + +[type info] +torque_to_current_value_ratio = 149.795386991 +velocity_to_value_ratio = 41.707853 + +value_of_0_radian_position = 2048 +value_of_min_radian_position = 0 +value_of_max_radian_position = 4095 +min_radian = -3.14159265 +max_radian = 3.14159265 + +torque_enable_item_name = torque_enable +present_position_item_name = present_position +present_velocity_item_name = present_velocity +present_current_item_name = present_current +goal_position_item_name = goal_position +goal_velocity_item_name = goal_velocity +goal_current_item_name = goal_current +position_d_gain_item_name = position_d_gain +position_i_gain_item_name = position_i_gain +position_p_gain_item_name = position_p_gain +velocity_d_gain_item_name = +velocity_i_gain_item_name = velocity_i_gain +velocity_p_gain_item_name = velocity_p_gain + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 6 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 7 | ID | 1 | RW | EEPROM | 0 | 252 | N + 8 | baudrate | 1 | RW | EEPROM | 0 | 7 | N + 9 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 10 | drive_mode | 1 | RW | EEPROM | 0 | 1 | N + 11 | operating_mode | 1 | RW | EEPROM | 0 | 16 | N + 12 | secondary_id | 1 | RW | EEPROM | 0 | 255 | N + 20 | homing_offset | 4 | RW | EEPROM | -1044479 | 1044479 | Y + 24 | moving_threshold | 4 | RW | EEPROM | 0 | 1023 | N + 31 | max_temperature_limit | 1 | RW | EEPROM | 0 | 100 | N + 32 | max_voltage_limit | 2 | RW | EEPROM | 95 | 160 | N + 34 | min_voltage_limit | 2 | RW | EEPROM | 95 | 160 | N + 36 | pwm_limit | 2 | RW | EEPROM | 0 | 885 | N + 38 | current_limit | 2 | RW | EEPROM | 0 | 1193 | N + 44 | velocity_limit | 4 | RW | EEPROM | 0 | 1023 | N + 48 | max_position_limit | 4 | RW | EEPROM | 0 | 4095 | N + 52 | min_position_limit | 4 | RW | EEPROM | 0 | 4095 | N + 63 | shutdown | 1 | RW | EEPROM | 0 | 255 | N + 64 | torque_enable | 1 | RW | RAM | 0 | 1 | N + 65 | LED | 1 | RW | RAM | 0 | 1 | N + 68 | status_return_level | 1 | RW | RAM | 0 | 2 | N + 69 | registered_instruction | 1 | R | RAM | 0 | 1 | N + 70 | hardware_error_status | 1 | R | RAM | 0 | 255 | N + 76 | velocity_i_gain | 2 | RW | RAM | 0 | 32767 | N + 78 | velocity_p_gain | 2 | RW | RAM | 0 | 32767 | N + 80 | position_d_gain | 2 | RW | RAM | 0 | 32767 | N + 82 | position_i_gain | 2 | RW | RAM | 0 | 32767 | N + 84 | position_p_gain | 2 | RW | RAM | 0 | 32767 | N + 88 | feedforward_2nd_gain | 2 | RW | RAM | 0 | 32767 | N + 90 | feedforward_1st_gain | 2 | RW | RAM | 0 | 32767 | N + 98 | bus_watchdog | 1 | RW | RAM | -1 | 127 | Y + 100 | goal_pwm | 2 | RW | RAM | 0 | 885 | N + 102 | goal_current | 2 | RW | RAM | 0 | 1193 | N + 104 | goal_velocity | 4 | RW | RAM | 0 | 1023 | N + 108 | profile_acceleration | 4 | RW | RAM | 0 | 32767 | N + 112 | profile_velocity | 4 | RW | RAM | 0 | 1023 | N + 116 | goal_position | 4 | RW | RAM | -1048575 | 1048575 | Y + 120 | realtime_tick | 2 | R | RAM | 0 | 32767 | N + 122 | moving | 1 | R | RAM | 0 | 1 | N + 123 | moving_status | 1 | R | RAM | 0 | 255 | N + 124 | present_pwm | 2 | R | RAM | 0 | 885 | N + 126 | present_current | 2 | R | RAM | 0 | 1193 | N + 128 | present_velocity | 4 | R | RAM | 0 | 1023 | N + 132 | present_position | 4 | R | RAM | -2147483648 | 2147483647 | Y + 136 | velocity_trajectory | 4 | R | RAM | 0 | 1023 | N + 140 | position_trajectory | 4 | R | RAM | 0 | 4095 | N + 144 | present_input_voltage | 2 | R | RAM | 95 | 160 | N + 146 | present_temperature | 1 | R | RAM | 0 | 100 | N + 168 | indirect_address_1 | 2 | RW | RAM | 0 | 65535 | N + 224 | indirect_data_1 | 1 | RW | RAM | 0 | 255 | N + 578 | indirect_address_29 | 2 | RW | RAM | 0 | 65535 | N + 634 | indirect_data_29 | 1 | RW | RAM | 0 | 255 | N diff --git a/humanoid_robot_intelligence_control_system_device/devices/dynamixel/XM540-W150.device b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/XM540-W150.device new file mode 100755 index 0000000..64fcf3b --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/XM540-W150.device @@ -0,0 +1,89 @@ +[device info] +model_name = XM540-W150 +device_type = dynamixel + +[type info] +torque_to_current_value_ratio = 289.13672036 +velocity_to_value_ratio = 41.707853 + +value_of_0_radian_position = 2048 +value_of_min_radian_position = 0 +value_of_max_radian_position = 4095 +min_radian = -3.14159265 +max_radian = 3.14159265 + +torque_enable_item_name = torque_enable +present_position_item_name = present_position +present_velocity_item_name = present_velocity +present_current_item_name = present_current +goal_position_item_name = goal_position +goal_velocity_item_name = goal_velocity +goal_current_item_name = goal_current +position_d_gain_item_name = position_d_gain +position_i_gain_item_name = position_i_gain +position_p_gain_item_name = position_p_gain +velocity_d_gain_item_name = +velocity_i_gain_item_name = velocity_i_gain +velocity_p_gain_item_name = velocity_p_gain + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 6 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 7 | ID | 1 | RW | EEPROM | 0 | 252 | N + 8 | baudrate | 1 | RW | EEPROM | 0 | 7 | N + 9 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 10 | drive_mode | 1 | RW | EEPROM | 0 | 1 | N + 11 | operating_mode | 1 | RW | EEPROM | 0 | 16 | N + 12 | secondary_id | 1 | RW | EEPROM | 0 | 255 | N + 20 | homing_offset | 4 | RW | EEPROM | -1044479 | 1044479 | Y + 24 | moving_threshold | 4 | RW | EEPROM | 0 | 1023 | N + 31 | max_temperature_limit | 1 | RW | EEPROM | 0 | 100 | N + 32 | max_voltage_limit | 2 | RW | EEPROM | 95 | 160 | N + 34 | min_voltage_limit | 2 | RW | EEPROM | 95 | 160 | N + 36 | pwm_limit | 2 | RW | EEPROM | 0 | 885 | N + 38 | current_limit | 2 | RW | EEPROM | 0 | 1193 | N + 44 | velocity_limit | 4 | RW | EEPROM | 0 | 1023 | N + 48 | max_position_limit | 4 | RW | EEPROM | 0 | 4095 | N + 52 | min_position_limit | 4 | RW | EEPROM | 0 | 4095 | N + 56 | external_port_mod_1 | 1 | RW | EEPROM | 0 | 3 | N + 57 | external_port_mod_2 | 1 | RW | EEPROM | 0 | 3 | N + 58 | external_port_mod_3 | 1 | RW | EEPROM | 0 | 3 | N + 63 | shutdown | 1 | RW | EEPROM | 0 | 255 | N + 64 | torque_enable | 1 | RW | RAM | 0 | 1 | N + 65 | LED | 1 | RW | RAM | 0 | 1 | N + 68 | status_return_level | 1 | RW | RAM | 0 | 2 | N + 69 | registered_instruction | 1 | R | RAM | 0 | 1 | N + 70 | hardware_error_status | 1 | R | RAM | 0 | 255 | N + 76 | velocity_i_gain | 2 | RW | RAM | 0 | 32767 | N + 78 | velocity_p_gain | 2 | RW | RAM | 0 | 32767 | N + 80 | position_d_gain | 2 | RW | RAM | 0 | 32767 | N + 82 | position_i_gain | 2 | RW | RAM | 0 | 32767 | N + 84 | position_p_gain | 2 | RW | RAM | 0 | 32767 | N + 88 | feedforward_2nd_gain | 2 | RW | RAM | 0 | 32767 | N + 90 | feedforward_1st_gain | 2 | RW | RAM | 0 | 32767 | N + 98 | bus_watchdog | 1 | RW | RAM | -1 | 127 | Y + 100 | goal_pwm | 2 | RW | RAM | 0 | 885 | N + 102 | goal_current | 2 | RW | RAM | 0 | 1193 | N + 104 | goal_velocity | 4 | RW | RAM | 0 | 1023 | N + 108 | profile_acceleration | 4 | RW | RAM | 0 | 32767 | N + 112 | profile_velocity | 4 | RW | RAM | 0 | 1023 | N + 116 | goal_position | 4 | RW | RAM | -1048575 | 1048575 | Y + 120 | realtime_tick | 2 | R | RAM | 0 | 32767 | N + 122 | moving | 1 | R | RAM | 0 | 1 | N + 123 | moving_status | 1 | R | RAM | 0 | 255 | N + 124 | present_pwm | 2 | R | RAM | 0 | 885 | N + 126 | present_current | 2 | R | RAM | 0 | 1193 | N + 128 | present_velocity | 4 | R | RAM | 0 | 1023 | N + 132 | present_position | 4 | R | RAM | -2147483648 | 2147483647 | Y + 136 | velocity_trajectory | 4 | R | RAM | 0 | 1023 | N + 140 | position_trajectory | 4 | R | RAM | 0 | 4095 | N + 144 | present_input_voltage | 2 | R | RAM | 95 | 160 | N + 146 | present_temperature | 1 | R | RAM | 0 | 100 | N + 152 | external_port_data_1 | 2 | RW | RAM | 0 | 4095 | N + 154 | external_port_data_2 | 2 | RW | RAM | 0 | 4095 | N + 156 | external_port_data_3 | 2 | RW | RAM | 0 | 4095 | N + 168 | indirect_address_1 | 2 | RW | RAM | 0 | 65535 | N + 224 | indirect_data_1 | 1 | RW | RAM | 0 | 255 | N + 578 | indirect_address_29 | 2 | RW | RAM | 0 | 65535 | N + 634 | indirect_data_29 | 1 | RW | RAM | 0 | 255 | N diff --git a/humanoid_robot_intelligence_control_system_device/devices/dynamixel/XM540-W270.device b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/XM540-W270.device new file mode 100755 index 0000000..c787cba --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/dynamixel/XM540-W270.device @@ -0,0 +1,89 @@ +[device info] +model_name = XM540-W270 +device_type = dynamixel + +[type info] +torque_to_current_value_ratio = 156.133829 +velocity_to_value_ratio = 41.707853 + +value_of_0_radian_position = 2048 +value_of_min_radian_position = 0 +value_of_max_radian_position = 4095 +min_radian = -3.14159265 +max_radian = 3.14159265 + +torque_enable_item_name = torque_enable +present_position_item_name = present_position +present_velocity_item_name = present_velocity +present_current_item_name = present_current +goal_position_item_name = goal_position +goal_velocity_item_name = goal_velocity +goal_current_item_name = goal_current +position_d_gain_item_name = position_d_gain +position_i_gain_item_name = position_i_gain +position_p_gain_item_name = position_p_gain +velocity_d_gain_item_name = +velocity_i_gain_item_name = velocity_i_gain +velocity_p_gain_item_name = velocity_p_gain + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 6 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 7 | ID | 1 | RW | EEPROM | 0 | 252 | N + 8 | baudrate | 1 | RW | EEPROM | 0 | 7 | N + 9 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 10 | drive_mode | 1 | RW | EEPROM | 0 | 1 | N + 11 | operating_mode | 1 | RW | EEPROM | 0 | 16 | N + 12 | secondary_id | 1 | RW | EEPROM | 0 | 255 | N + 20 | homing_offset | 4 | RW | EEPROM | -1044479 | 1044479 | Y + 24 | moving_threshold | 4 | RW | EEPROM | 0 | 1023 | N + 31 | max_temperature_limit | 1 | RW | EEPROM | 0 | 100 | N + 32 | max_voltage_limit | 2 | RW | EEPROM | 95 | 160 | N + 34 | min_voltage_limit | 2 | RW | EEPROM | 95 | 160 | N + 36 | pwm_limit | 2 | RW | EEPROM | 0 | 885 | N + 38 | current_limit | 2 | RW | EEPROM | 0 | 1193 | N + 44 | velocity_limit | 4 | RW | EEPROM | 0 | 1023 | N + 48 | max_position_limit | 4 | RW | EEPROM | 0 | 4095 | N + 52 | min_position_limit | 4 | RW | EEPROM | 0 | 4095 | N + 56 | external_port_mod_1 | 1 | RW | EEPROM | 0 | 3 | N + 57 | external_port_mod_2 | 1 | RW | EEPROM | 0 | 3 | N + 58 | external_port_mod_3 | 1 | RW | EEPROM | 0 | 3 | N + 63 | shutdown | 1 | RW | EEPROM | 0 | 255 | N + 64 | torque_enable | 1 | RW | RAM | 0 | 1 | N + 65 | LED | 1 | RW | RAM | 0 | 1 | N + 68 | status_return_level | 1 | RW | RAM | 0 | 2 | N + 69 | registered_instruction | 1 | R | RAM | 0 | 1 | N + 70 | hardware_error_status | 1 | R | RAM | 0 | 255 | N + 76 | velocity_i_gain | 2 | RW | RAM | 0 | 32767 | N + 78 | velocity_p_gain | 2 | RW | RAM | 0 | 32767 | N + 80 | position_d_gain | 2 | RW | RAM | 0 | 32767 | N + 82 | position_i_gain | 2 | RW | RAM | 0 | 32767 | N + 84 | position_p_gain | 2 | RW | RAM | 0 | 32767 | N + 88 | feedforward_2nd_gain | 2 | RW | RAM | 0 | 32767 | N + 90 | feedforward_1st_gain | 2 | RW | RAM | 0 | 32767 | N + 98 | bus_watchdog | 1 | RW | RAM | -1 | 127 | Y + 100 | goal_pwm | 2 | RW | RAM | 0 | 885 | N + 102 | goal_current | 2 | RW | RAM | 0 | 1193 | N + 104 | goal_velocity | 4 | RW | RAM | 0 | 1023 | N + 108 | profile_acceleration | 4 | RW | RAM | 0 | 32767 | N + 112 | profile_velocity | 4 | RW | RAM | 0 | 1023 | N + 116 | goal_position | 4 | RW | RAM | -1048575 | 1048575 | Y + 120 | realtime_tick | 2 | R | RAM | 0 | 32767 | N + 122 | moving | 1 | R | RAM | 0 | 1 | N + 123 | moving_status | 1 | R | RAM | 0 | 255 | N + 124 | present_pwm | 2 | R | RAM | 0 | 885 | N + 126 | present_current | 2 | R | RAM | 0 | 1193 | N + 128 | present_velocity | 4 | R | RAM | 0 | 1023 | N + 132 | present_position | 4 | R | RAM | -2147483648 | 2147483647 | Y + 136 | velocity_trajectory | 4 | R | RAM | 0 | 1023 | N + 140 | position_trajectory | 4 | R | RAM | 0 | 4095 | N + 144 | present_input_voltage | 2 | R | RAM | 95 | 160 | N + 146 | present_temperature | 1 | R | RAM | 0 | 100 | N + 152 | external_port_data_1 | 2 | RW | RAM | 0 | 4095 | N + 154 | external_port_data_2 | 2 | RW | RAM | 0 | 4095 | N + 156 | external_port_data_3 | 2 | RW | RAM | 0 | 4095 | N + 168 | indirect_address_1 | 2 | RW | RAM | 0 | 65535 | N + 224 | indirect_data_1 | 1 | RW | RAM | 0 | 255 | N + 578 | indirect_address_29 | 2 | RW | RAM | 0 | 65535 | N + 634 | indirect_data_29 | 1 | RW | RAM | 0 | 255 | N diff --git a/humanoid_robot_intelligence_control_system_device/devices/sensor/CM-740.device b/humanoid_robot_intelligence_control_system_device/devices/sensor/CM-740.device new file mode 100755 index 0000000..5cdf45f --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/sensor/CM-740.device @@ -0,0 +1,25 @@ +[device info] +model_name = CM-740 +device_type = sensor + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 2 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 3 | ID | 1 | RW | EEPROM | 0 | 252 | N + 4 | baudrate | 1 | RW | EEPROM | 0 | 252 | N + 5 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 16 | status_return_level | 1 | RW | EEPROM | 0 | 2 | N + 24 | torque_enable | 1 | RW | RAM | 0 | 1 | N + 25 | LED | 1 | RW | RAM | 0 | 7 | N + 26 | LED_5 | 2 | RW | RAM | 0 | 32767 | N + 28 | LED_6 | 2 | RW | RAM | 0 | 32767 | N + 30 | button | 1 | RW | RAM | 0 | 3 | N + 38 | gyro_z | 2 | R | RAM | 0 | 1023 | N + 40 | gyro_y | 2 | R | RAM | 0 | 1023 | N + 42 | gyro_x | 2 | R | RAM | 0 | 1023 | N + 44 | acc_x | 2 | R | RAM | 0 | 1023 | N + 46 | acc_y | 2 | R | RAM | 0 | 1023 | N + 48 | acc_z | 2 | R | RAM | 0 | 1023 | N + 50 | present_voltage | 1 | R | RAM | 50 | 250 | N + \ No newline at end of file diff --git a/humanoid_robot_intelligence_control_system_device/devices/sensor/OPEN-CR.device b/humanoid_robot_intelligence_control_system_device/devices/sensor/OPEN-CR.device new file mode 100755 index 0000000..71cee8e --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/devices/sensor/OPEN-CR.device @@ -0,0 +1,30 @@ +[device info] +model_name = OPEN-CR +device_type = sensor + +[control table] +# addr | item name | length | access | memory | min value | max value | signed + 0 | model_number | 2 | R | EEPROM | 0 | 65535 | N + 2 | version_of_firmware | 1 | R | EEPROM | 0 | 254 | N + 3 | ID | 1 | RW | EEPROM | 0 | 252 | N + 4 | baudrate | 1 | RW | EEPROM | 0 | 252 | N + 5 | return_delay_time | 1 | RW | EEPROM | 0 | 254 | N + 16 | status_return_level | 1 | RW | EEPROM | 0 | 2 | N + 24 | dynamixel_power | 1 | RW | RAM | 0 | 1 | N + 25 | LED | 1 | RW | RAM | 0 | 7 | N + 26 | LED_RGB | 2 | RW | RAM | 0 | 32767 | N + 28 | buzzer | 2 | RW | RAM | 0 | 65535 | N + 30 | button | 1 | R | RAM | 0 | 15 | N + 31 | present_voltage | 1 | R | RAM | 50 | 250 | N + 32 | gyro_x | 2 | R | RAM | -32800 | 32800 | Y + 34 | gyro_y | 2 | R | RAM | -32800 | 32800 | Y + 36 | gyro_z | 2 | R | RAM | -32800 | 32800 | Y + 38 | acc_x | 2 | R | RAM | -32768 | 32768 | Y + 40 | acc_y | 2 | R | RAM | -32768 | 32768 | Y + 42 | acc_z | 2 | R | RAM | -32768 | 32768 | Y + 44 | roll | 2 | R | RAM | 0 | 4096 | N + 46 | pitch | 2 | R | RAM | 0 | 4096 | N + 48 | yaw | 2 | R | RAM | 0 | 4096 | N + 50 | imu_control | 1 | RW | RAM | 0 | 255 | N + + \ No newline at end of file diff --git a/humanoid_robot_intelligence_control_system_device/include/humanoid_robot_intelligence_control_system_device/control_table_item.h b/humanoid_robot_intelligence_control_system_device/include/humanoid_robot_intelligence_control_system_device/control_table_item.h new file mode 100755 index 0000000..9b0a878 --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/include/humanoid_robot_intelligence_control_system_device/control_table_item.h @@ -0,0 +1,54 @@ +/******************************************************************************* + * Copyright 2018 ROBOTIS CO., LTD. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *******************************************************************************/ + +/* + * control_table_item.h + * + * Created on: 2015. 12. 16. + * Author: zerom + */ + +#ifndef ROBOTIS_DEVICE_CONTROL_TABLE_ITEM_H_ +#define ROBOTIS_DEVICE_CONTROL_TABLE_ITEM_H_ + +#include + +namespace humanoid_robot_intelligence_control_system_framework { + +enum AccessType { Read, ReadWrite }; + +enum MemoryType { EEPROM, RAM }; + +class ControlTableItem { +public: + std::string item_name_; + uint16_t address_; + AccessType access_type_; + MemoryType memory_type_; + uint8_t data_length_; + int32_t data_min_value_; + int32_t data_max_value_; + bool is_signed_; + + ControlTableItem() + : item_name_(""), address_(0), access_type_(Read), memory_type_(RAM), + data_length_(0), data_min_value_(0), data_max_value_(0), + is_signed_(false) {} +}; + +} // namespace humanoid_robot_intelligence_control_system_framework + +#endif /* ROBOTIS_DEVICE_CONTROL_TABLE_ITEM_H_ */ diff --git a/humanoid_robot_intelligence_control_system_device/include/humanoid_robot_intelligence_control_system_device/device.h b/humanoid_robot_intelligence_control_system_device/include/humanoid_robot_intelligence_control_system_device/device.h new file mode 100755 index 0000000..c14deb0 --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/include/humanoid_robot_intelligence_control_system_device/device.h @@ -0,0 +1,54 @@ +/******************************************************************************* +* Copyright 2018 ROBOTIS CO., LTD. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*******************************************************************************/ + +/* + * device.h + * + * Created on: 2016. 5. 12. + * Author: zerom + */ + +#ifndef ROBOTIS_DEVICE_DEVICE_H_ +#define ROBOTIS_DEVICE_DEVICE_H_ + + +#include +#include +#include + +#include "control_table_item.h" + +namespace humanoid_robot_intelligence_control_system_framework +{ + +class Device +{ +public: + uint8_t id_; + float protocol_version_; + std::string model_name_; + std::string port_name_; + + std::map ctrl_table_; + std::vector bulk_read_items_; + + virtual ~Device() { } +}; + +} + + +#endif /* ROBOTIS_DEVICE_DEVICE_H_ */ diff --git a/humanoid_robot_intelligence_control_system_device/include/humanoid_robot_intelligence_control_system_device/dynamixel.h b/humanoid_robot_intelligence_control_system_device/include/humanoid_robot_intelligence_control_system_device/dynamixel.h new file mode 100755 index 0000000..329b626 --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/include/humanoid_robot_intelligence_control_system_device/dynamixel.h @@ -0,0 +1,83 @@ +/******************************************************************************* +* Copyright 2018 ROBOTIS CO., LTD. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*******************************************************************************/ + +/* + * dynamixel.h + * + * Created on: 2015. 12. 8. + * Author: zerom + */ + +#ifndef ROBOTIS_DEVICE_DYNAMIXEL_H_ +#define ROBOTIS_DEVICE_DYNAMIXEL_H_ + + +#include +#include +#include + +#include "control_table_item.h" +#include "device.h" +#include "dynamixel_state.h" + +namespace humanoid_robot_intelligence_control_system_framework +{ + +class Dynamixel : public Device +{ +public: + std::string ctrl_module_name_; + DynamixelState *dxl_state_; + + double velocity_to_value_ratio_; + double torque_to_current_value_ratio_; + + int32_t value_of_0_radian_position_; + int32_t value_of_min_radian_position_; + int32_t value_of_max_radian_position_; + double min_radian_; + double max_radian_; + + ControlTableItem *torque_enable_item_; + ControlTableItem *present_position_item_; + ControlTableItem *present_velocity_item_; + ControlTableItem *present_current_item_; + ControlTableItem *goal_position_item_; + ControlTableItem *goal_velocity_item_; + ControlTableItem *goal_current_item_; + ControlTableItem *position_p_gain_item_; + ControlTableItem *position_i_gain_item_; + ControlTableItem *position_d_gain_item_; + ControlTableItem *velocity_p_gain_item_; + ControlTableItem *velocity_i_gain_item_; + ControlTableItem *velocity_d_gain_item_; + + Dynamixel(int id, std::string model_name, float protocol_version); + + double convertValue2Radian(int32_t value); + int32_t convertRadian2Value(double radian); + + double convertValue2Velocity(int32_t value); + int32_t convertVelocity2Value(double velocity); + + double convertValue2Torque(int16_t value); + int16_t convertTorque2Value(double torque); +}; + +} + + +#endif /* ROBOTIS_DEVICE_DYNAMIXEL_H_ */ diff --git a/humanoid_robot_intelligence_control_system_device/include/humanoid_robot_intelligence_control_system_device/dynamixel_state.h b/humanoid_robot_intelligence_control_system_device/include/humanoid_robot_intelligence_control_system_device/dynamixel_state.h new file mode 100755 index 0000000..b915824 --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/include/humanoid_robot_intelligence_control_system_device/dynamixel_state.h @@ -0,0 +1,82 @@ +/******************************************************************************* +* Copyright 2018 ROBOTIS CO., LTD. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*******************************************************************************/ + +/* + * dynamixel_state.h + * + * Created on: 2015. 12. 8. + * Author: zerom + */ + +#ifndef ROBOTIS_DEVICE_DYNAMIXEL_STATE_H_ +#define ROBOTIS_DEVICE_DYNAMIXEL_STATE_H_ + +#include + +#include "time_stamp.h" + +#define INDIRECT_DATA_1 "indirect_data_1" +#define INDIRECT_ADDRESS_1 "indirect_address_1" + +namespace humanoid_robot_intelligence_control_system_framework +{ + +class DynamixelState +{ +public: + TimeStamp update_time_stamp_; + + double present_position_; + double present_velocity_; + double present_torque_; + double goal_position_; + double goal_velocity_; + double goal_torque_; + int position_p_gain_; + int position_i_gain_; + int position_d_gain_; + int velocity_p_gain_; + int velocity_i_gain_; + int velocity_d_gain_; + + std::map bulk_read_table_; + + double position_offset_; + + DynamixelState() + : update_time_stamp_(0, 0), + present_position_(0.0), + present_velocity_(0.0), + present_torque_(0.0), + goal_position_(0.0), + goal_velocity_(0.0), + goal_torque_(0.0), + position_p_gain_(65535), + position_i_gain_(65535), + position_d_gain_(65535), + velocity_p_gain_(65535), + velocity_i_gain_(65535), + velocity_d_gain_(65535), + position_offset_(0) + { + bulk_read_table_.clear(); + } +}; + +} + + +#endif /* ROBOTIS_DEVICE_DYNAMIXEL_STATE_H_ */ diff --git a/humanoid_robot_intelligence_control_system_device/include/humanoid_robot_intelligence_control_system_device/robot.h b/humanoid_robot_intelligence_control_system_device/include/humanoid_robot_intelligence_control_system_device/robot.h new file mode 100755 index 0000000..15350bd --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/include/humanoid_robot_intelligence_control_system_device/robot.h @@ -0,0 +1,72 @@ +/******************************************************************************* +* Copyright 2018 ROBOTIS CO., LTD. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*******************************************************************************/ + +/* + * robot.h + * + * Created on: 2015. 12. 11. + * Author: zerom + */ + +#ifndef ROBOTIS_DEVICE_ROBOT_H_ +#define ROBOTIS_DEVICE_ROBOT_H_ + + +#include + +#include "sensor.h" +#include "dynamixel.h" +#include "dynamixel_sdk/port_handler.h" + +#define DYNAMIXEL "dynamixel" +#define SENSOR "sensor" + +#define SESSION_CONTROL_INFO "control info" +#define SESSION_PORT_INFO "port info" +#define SESSION_DEVICE_INFO "device info" + +#define SESSION_TYPE_INFO "type info" +#define SESSION_CONTROL_TABLE "control table" + +#define DEFAULT_CONTROL_CYCLE 8 // milliseconds + +namespace humanoid_robot_intelligence_control_system_framework +{ + +class Robot +{ +private: + int control_cycle_msec_; + +public: + std::map ports_; // string: port name + std::map port_default_device_; // port name, default device name + + std::map dxls_; // string: joint name + std::map sensors_; // string: sensor name + + Robot(std::string robot_file_path, std::string dev_desc_dir_path); + + Sensor *getSensor(std::string path, int id, std::string port, float protocol_version); + Dynamixel *getDynamixel(std::string path, int id, std::string port, float protocol_version); + + int getControlCycle(); +}; + +} + + +#endif /* ROBOTIS_DEVICE_ROBOT_H_ */ diff --git a/humanoid_robot_intelligence_control_system_device/include/humanoid_robot_intelligence_control_system_device/sensor.h b/humanoid_robot_intelligence_control_system_device/include/humanoid_robot_intelligence_control_system_device/sensor.h new file mode 100755 index 0000000..32abe6c --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/include/humanoid_robot_intelligence_control_system_device/sensor.h @@ -0,0 +1,49 @@ +/******************************************************************************* +* Copyright 2018 ROBOTIS CO., LTD. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*******************************************************************************/ + +/* + * sensor.h + * + * Created on: 2015. 12. 16. + * Author: zerom + */ + +#ifndef ROBOTIS_DEVICE_SENSOR_H_ +#define ROBOTIS_DEVICE_SENSOR_H_ + +#include +#include +#include + +#include "device.h" +#include "sensor_state.h" +#include "control_table_item.h" + +namespace humanoid_robot_intelligence_control_system_framework +{ + +class Sensor : public Device +{ +public: + SensorState *sensor_state_; + + Sensor(int id, std::string model_name, float protocol_version); +}; + +} + + +#endif /* ROBOTIS_DEVICE_SENSOR_H_ */ diff --git a/humanoid_robot_intelligence_control_system_device/include/humanoid_robot_intelligence_control_system_device/sensor_state.h b/humanoid_robot_intelligence_control_system_device/include/humanoid_robot_intelligence_control_system_device/sensor_state.h new file mode 100755 index 0000000..08f61ba --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/include/humanoid_robot_intelligence_control_system_device/sensor_state.h @@ -0,0 +1,50 @@ +/******************************************************************************* +* Copyright 2018 ROBOTIS CO., LTD. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*******************************************************************************/ + +/* + * sensor_state.h + * + * Created on: 2016. 5. 16. + * Author: zerom + */ + +#ifndef ROBOTIS_DEVICE_SENSOR_STATE_H_ +#define ROBOTIS_DEVICE_SENSOR_STATE_H_ + + +#include "time_stamp.h" + +namespace humanoid_robot_intelligence_control_system_framework +{ + +class SensorState +{ +public: + TimeStamp update_time_stamp_; + + std::map bulk_read_table_; + + SensorState() + : update_time_stamp_(0, 0) + { + bulk_read_table_.clear(); + } +}; + +} + + +#endif /* ROBOTIS_DEVICE_SENSOR_STATE_H_ */ diff --git a/humanoid_robot_intelligence_control_system_device/include/humanoid_robot_intelligence_control_system_device/time_stamp.h b/humanoid_robot_intelligence_control_system_device/include/humanoid_robot_intelligence_control_system_device/time_stamp.h new file mode 100755 index 0000000..87f59f4 --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/include/humanoid_robot_intelligence_control_system_device/time_stamp.h @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright 2018 ROBOTIS CO., LTD. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *******************************************************************************/ + +/* + * time_stamp.h + * + * Created on: 2016. 5. 16. + * Author: zerom + */ + +#ifndef ROBOTIS_DEVICE_TIME_STAMP_H_ +#define ROBOTIS_DEVICE_TIME_STAMP_H_ + +namespace humanoid_robot_intelligence_control_system_framework { + +class TimeStamp { +public: + long sec_; + long nsec_; + + TimeStamp(long sec, long nsec) : sec_(sec), nsec_(nsec) {} +}; + +} // namespace humanoid_robot_intelligence_control_system_framework + +#endif /* ROBOTIS_DEVICE_TIME_STAMP_H_ */ diff --git a/humanoid_robot_intelligence_control_system_device/package.xml b/humanoid_robot_intelligence_control_system_device/package.xml new file mode 100755 index 0000000..b21c17d --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/package.xml @@ -0,0 +1,38 @@ + + + humanoid_robot_intelligence_control_system_device + 0.3.2 + + The package that manages device information of ROBOTIS robots. + This package is used when reading device information with the robot information file + from the humanoid_robot_intelligence_control_system_controller package. + + Apache 2.0 + + Ronaldson Bellande + + + catkin + + roscpp + dynamixel_sdk + + roscpp + dynamixel_sdk + + roscpp + dynamixel_sdk + + + ament_cmake + + roscpp + dynamixel_sdk + + roscpp + dynamixel_sdk + + roscpp + dynamixel_sdk + + diff --git a/humanoid_robot_intelligence_control_system_device/src/humanoid_robot_intelligence_control_system_device/dynamixel.cpp b/humanoid_robot_intelligence_control_system_device/src/humanoid_robot_intelligence_control_system_device/dynamixel.cpp new file mode 100755 index 0000000..95a01ca --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/src/humanoid_robot_intelligence_control_system_device/dynamixel.cpp @@ -0,0 +1,119 @@ +/******************************************************************************* + * Copyright 2018 ROBOTIS CO., LTD. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *******************************************************************************/ + +/* + * dynamixel.cpp + * + * Created on: 2015. 12. 8. + * Author: zerom + */ + +#include "humanoid_robot_intelligence_control_system_device/dynamixel.h" + +using namespace humanoid_robot_intelligence_control_system_framework; + +Dynamixel::Dynamixel(int id, std::string model_name, float protocol_version) + : ctrl_module_name_("none"), torque_to_current_value_ratio_(1.0), + velocity_to_value_ratio_(1.0), value_of_0_radian_position_(0), + value_of_min_radian_position_(0), value_of_max_radian_position_(0), + min_radian_(-3.14159265), max_radian_(3.14159265), torque_enable_item_(0), + present_position_item_(0), present_velocity_item_(0), + present_current_item_(0), goal_position_item_(0), goal_velocity_item_(0), + goal_current_item_(0), position_p_gain_item_(0), position_i_gain_item_(0), + position_d_gain_item_(0), velocity_p_gain_item_(0), + velocity_i_gain_item_(0), velocity_d_gain_item_(0) { + this->id_ = id; + this->model_name_ = model_name; + this->port_name_ = ""; + this->protocol_version_ = protocol_version; + + ctrl_table_.clear(); + dxl_state_ = new DynamixelState(); + + bulk_read_items_.clear(); +} + +double Dynamixel::convertValue2Radian(int32_t value) { + double radian = 0.0; + if (value > value_of_0_radian_position_) { + if (max_radian_ <= 0) + return max_radian_; + + radian = + (double)(value - value_of_0_radian_position_) * max_radian_ / + (double)(value_of_max_radian_position_ - value_of_0_radian_position_); + } else if (value < value_of_0_radian_position_) { + if (min_radian_ >= 0) + return min_radian_; + + radian = + (double)(value - value_of_0_radian_position_) * min_radian_ / + (double)(value_of_min_radian_position_ - value_of_0_radian_position_); + } + + // if (radian > max_radian_) + // return max_radian_; + // else if (radian < min_radian_) + // return min_radian_; + + return radian; +} + +int32_t Dynamixel::convertRadian2Value(double radian) { + int32_t value = 0; + if (radian > 0) { + if (value_of_max_radian_position_ <= value_of_0_radian_position_) + return value_of_max_radian_position_; + + value = (radian * + (value_of_max_radian_position_ - value_of_0_radian_position_) / + max_radian_) + + value_of_0_radian_position_; + } else if (radian < 0) { + if (value_of_min_radian_position_ >= value_of_0_radian_position_) + return value_of_min_radian_position_; + + value = (radian * + (value_of_min_radian_position_ - value_of_0_radian_position_) / + min_radian_) + + value_of_0_radian_position_; + } else + value = value_of_0_radian_position_; + + // if (value > value_of_max_radian_position_) + // return value_of_max_radian_position_; + // else if (value < value_of_min_radian_position_) + // return value_of_min_radian_position_; + + return value; +} + +double Dynamixel::convertValue2Velocity(int32_t value) { + return (double)value / velocity_to_value_ratio_; +} + +int32_t Dynamixel::convertVelocity2Value(double velocity) { + return (int32_t)(velocity * velocity_to_value_ratio_); + ; +} + +double Dynamixel::convertValue2Torque(int16_t value) { + return (double)value / torque_to_current_value_ratio_; +} + +int16_t Dynamixel::convertTorque2Value(double torque) { + return (int16_t)(torque * torque_to_current_value_ratio_); +} diff --git a/humanoid_robot_intelligence_control_system_device/src/humanoid_robot_intelligence_control_system_device/robot.cpp b/humanoid_robot_intelligence_control_system_device/src/humanoid_robot_intelligence_control_system_device/robot.cpp new file mode 100755 index 0000000..c930e86 --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/src/humanoid_robot_intelligence_control_system_device/robot.cpp @@ -0,0 +1,480 @@ +/******************************************************************************* + * Copyright 2018 ROBOTIS CO., LTD. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *******************************************************************************/ + +/* + * robot.cpp + * + * Created on: 2015. 12. 11. + * Author: zerom + */ + +#include +#include +#include + +#include "humanoid_robot_intelligence_control_system_device/robot.h" + +using namespace humanoid_robot_intelligence_control_system_framework; + +static inline std::string <rim(std::string &s) { + s.erase(s.begin(), + std::find_if(s.begin(), s.end(), + std::not1(std::ptr_fun(std::isspace)))); + return s; +} +static inline std::string &rtrim(std::string &s) { + s.erase(std::find_if(s.rbegin(), s.rend(), + std::not1(std::ptr_fun(std::isspace))) + .base(), + s.end()); + return s; +} +static inline std::string &trim(std::string &s) { return ltrim(rtrim(s)); } + +static inline std::vector split(const std::string &text, + char sep) { + std::vector tokens; + std::size_t start = 0, end = 0; + + while ((end = text.find(sep, start)) != (std::string::npos)) { + tokens.push_back(text.substr(start, end - start)); + trim(tokens.back()); + start = end + 1; + } + tokens.push_back(text.substr(start)); + trim(tokens.back()); + + return tokens; +} + +Robot::Robot(std::string robot_file_path, std::string dev_desc_dir_path) + : control_cycle_msec_(DEFAULT_CONTROL_CYCLE) { + if (dev_desc_dir_path.compare(dev_desc_dir_path.size() - 1, 1, "/") != 0) + dev_desc_dir_path += "/"; + + std::ifstream file(robot_file_path.c_str()); + if (file.is_open()) { + std::string session = ""; + std::string input_str; + while (!file.eof()) { + std::getline(file, input_str); + + // remove comment ( # ) + std::size_t pos = input_str.find("#"); + if (pos != std::string::npos) + input_str = input_str.substr(0, pos); + + // trim + input_str = trim(input_str); + + // find session + if (!input_str.compare(0, 1, "[") && + !input_str.compare(input_str.size() - 1, 1, "]")) { + input_str = input_str.substr(1, input_str.size() - 2); + std::transform(input_str.begin(), input_str.end(), input_str.begin(), + ::tolower); + session = trim(input_str); + continue; + } + + if (session == SESSION_CONTROL_INFO) { + std::vector tokens = split(input_str, '='); + if (tokens.size() != 2) + continue; + + if (tokens[0] == "control_cycle") + control_cycle_msec_ = std::atoi(tokens[1].c_str()); + } else if (session == SESSION_PORT_INFO) { + std::vector tokens = split(input_str, '|'); + if (tokens.size() != 3) + continue; + + std::cout << tokens[0] << " added. (baudrate: " << tokens[1] << ")" + << std::endl; + + ports_[tokens[0]] = + dynamixel::PortHandler::getPortHandler(tokens[0].c_str()); + ports_[tokens[0]]->setBaudRate(std::atoi(tokens[1].c_str())); + port_default_device_[tokens[0]] = tokens[2]; + } else if (session == SESSION_DEVICE_INFO) { + std::vector tokens = split(input_str, '|'); + if (tokens.size() != 7) + continue; + + if (tokens[0] == DYNAMIXEL) { + std::string file_path = + dev_desc_dir_path + tokens[0] + "/" + tokens[3] + ".device"; + int id = std::atoi(tokens[2].c_str()); + std::string port = tokens[1]; + float protocol = std::atof(tokens[4].c_str()); + std::string dev_name = tokens[5]; + + dxls_[dev_name] = getDynamixel(file_path, id, port, protocol); + + Dynamixel *dxl = dxls_[dev_name]; + std::vector sub_tokens = split(tokens[6], ','); + if (sub_tokens.size() > 0 && sub_tokens[0] != "") { + std::map::iterator indirect_it = + dxl->ctrl_table_.find(INDIRECT_ADDRESS_1); + if (indirect_it != + dxl->ctrl_table_.end()) // INDIRECT_ADDRESS_1 exist + { + uint16_t indirect_data_addr = + dxl->ctrl_table_[INDIRECT_DATA_1]->address_; + for (int _i = 0; _i < sub_tokens.size(); _i++) { + std::map::iterator + bulkread_it = dxl->ctrl_table_.find(sub_tokens[_i]); + if (bulkread_it == dxl->ctrl_table_.end()) { + fprintf( + stderr, + "\n ##### BULK READ ITEM [ %s ] NOT FOUND!! #####\n\n", + sub_tokens[_i].c_str()); + continue; + } + + dxl->bulk_read_items_.push_back(new ControlTableItem()); + ControlTableItem *dest_item = dxl->bulk_read_items_[_i]; + ControlTableItem *src_item = dxl->ctrl_table_[sub_tokens[_i]]; + + dest_item->item_name_ = src_item->item_name_; + dest_item->address_ = indirect_data_addr; + dest_item->access_type_ = src_item->access_type_; + dest_item->memory_type_ = src_item->memory_type_; + dest_item->data_length_ = src_item->data_length_; + dest_item->data_min_value_ = src_item->data_min_value_; + dest_item->data_max_value_ = src_item->data_max_value_; + dest_item->is_signed_ = src_item->is_signed_; + + indirect_data_addr += dest_item->data_length_; + } + } else // INDIRECT_ADDRESS_1 not exist + { + for (int i = 0; i < sub_tokens.size(); i++) { + if (dxl->ctrl_table_[sub_tokens[i]] != NULL) + dxl->bulk_read_items_.push_back( + dxl->ctrl_table_[sub_tokens[i]]); + } + } + } + } else if (tokens[0] == SENSOR) { + std::string file_path = + dev_desc_dir_path + tokens[0] + "/" + tokens[3] + ".device"; + int id = std::atoi(tokens[2].c_str()); + std::string port = tokens[1]; + float protocol = std::atof(tokens[4].c_str()); + std::string dev_name = tokens[5]; + + sensors_[dev_name] = getSensor(file_path, id, port, protocol); + + Sensor *sensor = sensors_[dev_name]; + std::vector sub_tokens = split(tokens[6], ','); + if (sub_tokens.size() > 0 && sub_tokens[0] != "") { + std::map::iterator indirect_it = + sensor->ctrl_table_.find(INDIRECT_ADDRESS_1); + if (indirect_it != + sensor->ctrl_table_.end()) // INDIRECT_ADDRESS_1 exist + { + uint16_t indirect_data_addr = + sensor->ctrl_table_[INDIRECT_DATA_1]->address_; + for (int i = 0; i < sub_tokens.size(); i++) { + sensor->bulk_read_items_.push_back(new ControlTableItem()); + ControlTableItem *dest_item = sensor->bulk_read_items_[i]; + ControlTableItem *src_item = sensor->ctrl_table_[sub_tokens[i]]; + + dest_item->item_name_ = src_item->item_name_; + dest_item->address_ = indirect_data_addr; + dest_item->access_type_ = src_item->access_type_; + dest_item->memory_type_ = src_item->memory_type_; + dest_item->data_length_ = src_item->data_length_; + dest_item->data_min_value_ = src_item->data_min_value_; + dest_item->data_max_value_ = src_item->data_max_value_; + dest_item->is_signed_ = src_item->is_signed_; + + indirect_data_addr += dest_item->data_length_; + } + } else // INDIRECT_ADDRESS_1 exist + { + for (int i = 0; i < sub_tokens.size(); i++) + sensor->bulk_read_items_.push_back( + sensor->ctrl_table_[sub_tokens[i]]); + } + } + } + } + } + file.close(); + } else { + std::cout << "Unable to open file : " + robot_file_path << std::endl; + } +} + +Sensor *Robot::getSensor(std::string path, int id, std::string port, + float protocol_version) { + Sensor *sensor; + + // load file model_name.device + std::ifstream file(path.c_str()); + if (file.is_open()) { + std::string session = ""; + std::string input_str; + + while (!file.eof()) { + std::getline(file, input_str); + + // remove comment ( # ) + std::size_t pos = input_str.find("#"); + if (pos != std::string::npos) + input_str = input_str.substr(0, pos); + + // trim + input_str = trim(input_str); + if (input_str == "") + continue; + + // find _session + if (!input_str.compare(0, 1, "[") && + !input_str.compare(input_str.size() - 1, 1, "]")) { + input_str = input_str.substr(1, input_str.size() - 2); + std::transform(input_str.begin(), input_str.end(), input_str.begin(), + ::tolower); + session = trim(input_str); + continue; + } + + if (session == SESSION_DEVICE_INFO) { + std::vector tokens = split(input_str, '='); + if (tokens.size() != 2) + continue; + + if (tokens[0] == "model_name") + sensor = new Sensor(id, tokens[1], protocol_version); + } else if (session == SESSION_CONTROL_TABLE) { + std::vector tokens = split(input_str, '|'); + if (tokens.size() != 8) + continue; + + ControlTableItem *item = new ControlTableItem(); + item->item_name_ = tokens[1]; + item->address_ = std::atoi(tokens[0].c_str()); + item->data_length_ = std::atoi(tokens[2].c_str()); + + if (tokens[3] == "R") + item->access_type_ = Read; + else if (tokens[3] == "RW") + item->access_type_ = ReadWrite; + + if (tokens[4] == "EEPROM") + item->memory_type_ = EEPROM; + else if (tokens[4] == "RAM") + item->memory_type_ = RAM; + + item->data_min_value_ = std::atol(tokens[5].c_str()); + item->data_max_value_ = std::atol(tokens[6].c_str()); + + if (tokens[7] == "Y") + item->is_signed_ = true; + else if (tokens[7] == "N") + item->is_signed_ = false; + sensor->ctrl_table_[tokens[1]] = item; + } + } + sensor->port_name_ = port; + + fprintf(stderr, "(%s) [ID:%3d] %14s added. \n", port.c_str(), sensor->id_, + sensor->model_name_.c_str()); + // std::cout << "[ID:" << (int)(_sensor->id) << "] " << _sensor->model_name + // << " added. (" << port << ")" << std::endl; + file.close(); + } else + std::cout << "Unable to open file : " + path << std::endl; + + return sensor; +} + +Dynamixel *Robot::getDynamixel(std::string path, int id, std::string port, + float protocol_version) { + Dynamixel *dxl; + + // load file model_name.device + std::ifstream file(path.c_str()); + if (file.is_open()) { + std::string session = ""; + std::string input_str; + + std::string torque_enable_item_name = ""; + std::string present_position_item_name = ""; + std::string present_velocity_item_name = ""; + std::string present_current_item_name = ""; + std::string goal_position_item_name = ""; + std::string goal_velocity_item_name = ""; + std::string goal_current_item_name = ""; + std::string position_d_gain_item_name = ""; + std::string position_i_gain_item_name = ""; + std::string position_p_gain_item_name = ""; + std::string velocity_d_gain_item_name = ""; + std::string velocity_i_gain_item_name = ""; + std::string velocity_p_gain_item_name = ""; + + while (!file.eof()) { + std::getline(file, input_str); + + // remove comment ( # ) + std::size_t pos = input_str.find("#"); + if (pos != std::string::npos) + input_str = input_str.substr(0, pos); + + // trim + input_str = trim(input_str); + if (input_str == "") + continue; + + // find session + if (!input_str.compare(0, 1, "[") && + !input_str.compare(input_str.size() - 1, 1, "]")) { + input_str = input_str.substr(1, input_str.size() - 2); + std::transform(input_str.begin(), input_str.end(), input_str.begin(), + ::tolower); + session = trim(input_str); + continue; + } + + if (session == SESSION_DEVICE_INFO) { + std::vector tokens = split(input_str, '='); + if (tokens.size() != 2) + continue; + + if (tokens[0] == "model_name") + dxl = new Dynamixel(id, tokens[1], protocol_version); + } else if (session == SESSION_TYPE_INFO) { + std::vector tokens = split(input_str, '='); + if (tokens.size() != 2) + continue; + + if (tokens[0] == "torque_to_current_value_ratio") + dxl->torque_to_current_value_ratio_ = std::atof(tokens[1].c_str()); + else if (tokens[0] == "velocity_to_value_ratio") + dxl->velocity_to_value_ratio_ = std::atof(tokens[1].c_str()); + + else if (tokens[0] == "value_of_0_radian_position") + dxl->value_of_0_radian_position_ = std::atoi(tokens[1].c_str()); + else if (tokens[0] == "value_of_min_radian_position") + dxl->value_of_min_radian_position_ = std::atoi(tokens[1].c_str()); + else if (tokens[0] == "value_of_max_radian_position") + dxl->value_of_max_radian_position_ = std::atoi(tokens[1].c_str()); + else if (tokens[0] == "min_radian") + dxl->min_radian_ = std::atof(tokens[1].c_str()); + else if (tokens[0] == "max_radian") + dxl->max_radian_ = std::atof(tokens[1].c_str()); + + else if (tokens[0] == "torque_enable_item_name") + torque_enable_item_name = tokens[1]; + else if (tokens[0] == "present_position_item_name") + present_position_item_name = tokens[1]; + else if (tokens[0] == "present_velocity_item_name") + present_velocity_item_name = tokens[1]; + else if (tokens[0] == "present_current_item_name") + present_current_item_name = tokens[1]; + else if (tokens[0] == "goal_position_item_name") + goal_position_item_name = tokens[1]; + else if (tokens[0] == "goal_velocity_item_name") + goal_velocity_item_name = tokens[1]; + else if (tokens[0] == "goal_current_item_name") + goal_current_item_name = tokens[1]; + else if (tokens[0] == "position_d_gain_item_name") + position_d_gain_item_name = tokens[1]; + else if (tokens[0] == "position_i_gain_item_name") + position_i_gain_item_name = tokens[1]; + else if (tokens[0] == "position_p_gain_item_name") + position_p_gain_item_name = tokens[1]; + else if (tokens[0] == "velocity_d_gain_item_name") + velocity_d_gain_item_name = tokens[1]; + else if (tokens[0] == "velocity_i_gain_item_name") + velocity_i_gain_item_name = tokens[1]; + else if (tokens[0] == "velocity_p_gain_item_name") + velocity_p_gain_item_name = tokens[1]; + } else if (session == SESSION_CONTROL_TABLE) { + std::vector tokens = split(input_str, '|'); + if (tokens.size() != 8) + continue; + + ControlTableItem *item = new ControlTableItem(); + item->item_name_ = tokens[1]; + item->address_ = std::atoi(tokens[0].c_str()); + item->data_length_ = std::atoi(tokens[2].c_str()); + + if (tokens[3] == "R") + item->access_type_ = Read; + else if (tokens[3] == "RW") + item->access_type_ = ReadWrite; + + if (tokens[4] == "EEPROM") + item->memory_type_ = EEPROM; + else if (tokens[4] == "RAM") + item->memory_type_ = RAM; + + item->data_min_value_ = std::atol(tokens[5].c_str()); + item->data_max_value_ = std::atol(tokens[6].c_str()); + + if (tokens[7] == "Y") + item->is_signed_ = true; + else if (tokens[7] == "N") + item->is_signed_ = false; + dxl->ctrl_table_[tokens[1]] = item; + } + } + dxl->port_name_ = port; + + if (dxl->ctrl_table_[torque_enable_item_name] != NULL) + dxl->torque_enable_item_ = dxl->ctrl_table_[torque_enable_item_name]; + if (dxl->ctrl_table_[present_position_item_name] != NULL) + dxl->present_position_item_ = + dxl->ctrl_table_[present_position_item_name]; + if (dxl->ctrl_table_[present_velocity_item_name] != NULL) + dxl->present_velocity_item_ = + dxl->ctrl_table_[present_velocity_item_name]; + if (dxl->ctrl_table_[present_current_item_name] != NULL) + dxl->present_current_item_ = dxl->ctrl_table_[present_current_item_name]; + if (dxl->ctrl_table_[goal_position_item_name] != NULL) + dxl->goal_position_item_ = dxl->ctrl_table_[goal_position_item_name]; + if (dxl->ctrl_table_[goal_velocity_item_name] != NULL) + dxl->goal_velocity_item_ = dxl->ctrl_table_[goal_velocity_item_name]; + if (dxl->ctrl_table_[goal_current_item_name] != NULL) + dxl->goal_current_item_ = dxl->ctrl_table_[goal_current_item_name]; + if (dxl->ctrl_table_[position_d_gain_item_name] != NULL) + dxl->position_d_gain_item_ = dxl->ctrl_table_[position_d_gain_item_name]; + if (dxl->ctrl_table_[position_i_gain_item_name] != NULL) + dxl->position_i_gain_item_ = dxl->ctrl_table_[position_i_gain_item_name]; + if (dxl->ctrl_table_[position_p_gain_item_name] != NULL) + dxl->position_p_gain_item_ = dxl->ctrl_table_[position_p_gain_item_name]; + if (dxl->ctrl_table_[velocity_d_gain_item_name] != NULL) + dxl->velocity_d_gain_item_ = dxl->ctrl_table_[velocity_d_gain_item_name]; + if (dxl->ctrl_table_[velocity_i_gain_item_name] != NULL) + dxl->velocity_i_gain_item_ = dxl->ctrl_table_[velocity_i_gain_item_name]; + if (dxl->ctrl_table_[velocity_p_gain_item_name] != NULL) + dxl->velocity_p_gain_item_ = dxl->ctrl_table_[velocity_p_gain_item_name]; + + fprintf(stderr, "(%s) [ID:%3d] %14s added. \n", port.c_str(), dxl->id_, + dxl->model_name_.c_str()); + // std::cout << "[ID:" << (int)(_dxl->id) << "] " << _dxl->model_name << " + // added. (" << port << ")" << std::endl; + file.close(); + } else + std::cout << "Unable to open file : " + path << std::endl; + + return dxl; +} + +int Robot::getControlCycle() { return control_cycle_msec_; } diff --git a/humanoid_robot_intelligence_control_system_device/src/humanoid_robot_intelligence_control_system_device/sensor.cpp b/humanoid_robot_intelligence_control_system_device/src/humanoid_robot_intelligence_control_system_device/sensor.cpp new file mode 100755 index 0000000..6d5e619 --- /dev/null +++ b/humanoid_robot_intelligence_control_system_device/src/humanoid_robot_intelligence_control_system_device/sensor.cpp @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright 2018 ROBOTIS CO., LTD. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *******************************************************************************/ + +/* + * sensor.cpp + * + * Created on: 2016. 5. 11. + * Author: zerom + */ + +#include "humanoid_robot_intelligence_control_system_device/sensor.h" + +using namespace humanoid_robot_intelligence_control_system_framework; + +Sensor::Sensor(int id, std::string model_name, float protocol_version) { + + this->id_ = id; + this->model_name_ = model_name; + this->port_name_ = ""; + this->protocol_version_ = protocol_version; + ctrl_table_.clear(); + + sensor_state_ = new SensorState(); + + bulk_read_items_.clear(); +} diff --git a/humanoid_robot_intelligence_control_system_framework/CHANGELOG.rst b/humanoid_robot_intelligence_control_system_framework/CHANGELOG.rst new file mode 100755 index 0000000..5376392 --- /dev/null +++ b/humanoid_robot_intelligence_control_system_framework/CHANGELOG.rst @@ -0,0 +1,89 @@ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Changelog for package humanoid_robot_intelligence_control_system_framework +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +0.3.2 (2023-10-03) +------------------ +* Make it compatible for ROS1/ROS2 +* Fix bugs +* Update package.xml and CMakeList.txt for to the latest versions +* Contributors & Maintainer: Ronaldson Bellande + +0.3.1 (2023-09-27) +------------------ +* Starting from this point it under a new license +* Fix errors and Issues +* Rename Repository for a completely different purpose +* Make it compatible with ROS/ROS2 +* Upgrade version of all builds and make it more compatible +* Update package.xml and CMakeList.txt for to the latest versions +* Contributors & Maintainer: Ronaldson Bellande + +0.2.9 (2018-03-22) +------------------ +* added serivce for setting module +* deleted comment for debug +* modified to prevent duplicate indirect address write +* added boost system dependencies +* fixed a bug that occure when handling bulk read item that does not exist +* Contributors: Kayman, Zerom, Pyo + +0.2.8 (2018-03-20) +------------------ +* added RH-P12-RN.device file +* modified CMakeLists.txt for system dependencies (yaml-cpp) +* Contributors: Zerom, Pyo + +0.2.7 (2018-03-15) +------------------ +* changed all values read by bulk read are saved to dxl_state\_->bulk_read_table\_. +* Modified to prevent duplicate indirect address write +* fixed a bug that occur when handling bulk read item that does not exist +* changed the License and package format to version 2 +* Contributors: SCH, Zerom, Pyo + +0.2.6 (2017-08-09) +------------------ +* multi thread bug fixed. +* unnecessary debug print removed. +* OpenCR control table item name changed. (torque_enable -> dynamixel_power) +* fixed to not update update_time_stamp\_ if bulk read fails. +* Contributors: Zerom + +0.2.5 (2017-06-09) +------------------ +* updated for yaml-cpp dependencies (humanoid_robot_intelligence_control_system_controller) +* Contributors: SCH + +0.2.4 (2017-06-07) +------------------ +* added cmake_modules in package.xml +* Contributors: SCH + +0.2.3 (2017-05-23) +------------------ +* updated the cmake file for ros install +* Contributors: SCH + +0.2.2 (2017-04-24) +------------------ +* added a deivce: OpenCR +* updated humanoid_robot_intelligence_control_system_controller.cpp +* changed to read control cycle from .robot file +* Contributors: Zerom, Kayman + +0.2.1 (2016-11-23) +------------------ +* Merge the changes and update + +0.2.0 (2016-08-31) +------------------ +* updated CHANGLOG.rst for minor release + +0.1.1 (2016-08-18) +------------------ +* updated the package information + +0.1.0 (2016-08-12) +------------------ +* make a meta-package diff --git a/humanoid_robot_intelligence_control_system_framework/CMakeLists.txt b/humanoid_robot_intelligence_control_system_framework/CMakeLists.txt new file mode 100644 index 0000000..dda922c --- /dev/null +++ b/humanoid_robot_intelligence_control_system_framework/CMakeLists.txt @@ -0,0 +1,12 @@ +cmake_minimum_required(VERSION 3.8) +project(humanoid_robot_intelligence_control_system_framework) + +if($ENV{ROS_VERSION} EQUAL 1) + find_package(catkin REQUIRED) +else() + find_package(ament_cmake REQUIRED) +endif() + +if($ENV{ROS_VERSION} EQUAL 1) + catkin_package() +endif() diff --git a/humanoid_robot_intelligence_control_system_framework/package.xml b/humanoid_robot_intelligence_control_system_framework/package.xml new file mode 100755 index 0000000..39be137 --- /dev/null +++ b/humanoid_robot_intelligence_control_system_framework/package.xml @@ -0,0 +1,40 @@ + + + humanoid_robot_intelligence_control_system_framework + 0.3.2 + ROS packages for the humanoid_robot_intelligence_control_system_framework (meta package) + Apache 2.0 + Ronaldson Bellande + + + catkin + + humanoid_robot_intelligence_control_system_controller + humanoid_robot_intelligence_control_system_device + humanoid_robot_intelligence_control_system_framework_common + + humanoid_robot_intelligence_control_system_controller + humanoid_robot_intelligence_control_system_device + humanoid_robot_intelligence_control_system_framework_common + + humanoid_robot_intelligence_control_system_controller + humanoid_robot_intelligence_control_system_device + humanoid_robot_intelligence_control_system_framework_common + + + ament_cmake + + humanoid_robot_intelligence_control_system_controller + humanoid_robot_intelligence_control_system_device + humanoid_robot_intelligence_control_system_framework_common + + humanoid_robot_intelligence_control_system_controller + humanoid_robot_intelligence_control_system_device + humanoid_robot_intelligence_control_system_framework_common + + humanoid_robot_intelligence_control_system_controller + humanoid_robot_intelligence_control_system_device + humanoid_robot_intelligence_control_system_framework_common + + + diff --git a/humanoid_robot_intelligence_control_system_framework_common/CHANGELOG.rst b/humanoid_robot_intelligence_control_system_framework_common/CHANGELOG.rst new file mode 100755 index 0000000..0af7c89 --- /dev/null +++ b/humanoid_robot_intelligence_control_system_framework_common/CHANGELOG.rst @@ -0,0 +1,82 @@ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Changelog for package humanoid_robot_intelligence_control_system_framework_common +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +0.3.2 (2023-10-03) +------------------ +* Make it compatible for ROS1/ROS2 +* Fix bugs +* Update package.xml and CMakeList.txt for to the latest versions +* Contributors & Maintainer: Ronaldson Bellande + +0.3.1 (2023-09-27) +------------------ +* Starting from this point it under a new license +* Fix errors and Issues +* Rename Repository for a completely different purpose +* Make it compatible with ROS/ROS2 +* Upgrade version of all builds and make it more compatible +* Update package.xml and CMakeList.txt for to the latest versions +* Contributors & Maintainer: Ronaldson Bellande + +0.2.9 (2018-03-22) +------------------ +* none + +0.2.8 (2018-03-20) +------------------ +* tested for system dependencies +* Contributors: Pyo + +0.2.7 (2018-03-15) +------------------ +* change the License and package format to version 2 +* Contributors: Pyo + +0.2.6 (2017-08-09) +------------------ +* none + +0.2.5 (2017-06-09) +------------------ +* none + +0.2.4 (2017-06-07) +------------------ +* none + +0.2.3 (2017-05-23) +------------------ +* updated the cmake file for ros install +* Contributors: SCH + +0.2.2 (2017-04-24) +------------------ +* updated for other packages +* Contributors: Zerom, Kayman + +0.2.1 (2016-11-23) +------------------ +* Merge the changes and update +* - dependencies fixed. (Pull requests `#26 `_) +* - modified dependency problem. +* Contributors: Jay Song, Pyo, Zerom + +0.2.0 (2016-08-31) +------------------ +* updated CHANGLOG.rst for minor release +* rename ControlMode(CurrentControl -> TorqueControl) +* rename (port_to_sync_write_torque\_ -> port_to_sync_write_current\_) +* Contributors: Zerom, Pyo + +0.1.1 (2016-08-18) +------------------ +* updated the package information + +0.1.0 (2016-08-12) +------------------ +* modified the package information for release +* Setting the license to BSD. +* add SensorState + add Singleton template +* Contributors: Jay Song, Zerom, Pyo diff --git a/humanoid_robot_intelligence_control_system_framework_common/CMakeLists.txt b/humanoid_robot_intelligence_control_system_framework_common/CMakeLists.txt new file mode 100755 index 0000000..d90d27c --- /dev/null +++ b/humanoid_robot_intelligence_control_system_framework_common/CMakeLists.txt @@ -0,0 +1,46 @@ +cmake_minimum_required(VERSION 3.8) +project(humanoid_robot_intelligence_control_system_framework_common) + + +if($ENV{ROS_VERSION} EQUAL 1) + find_package(catkin REQUIRED COMPONENTS + roscpp + humanoid_robot_intelligence_control_system_device + ) +else() + find_package(ament_cmake REQUIRED) +endif() + + +if($ENV{ROS_VERSION} EQUAL 1) + catkin_package( + INCLUDE_DIRS include + LIBRARIES ${PROJECT_NAME} + CATKIN_DEPENDS + roscpp + humanoid_robot_intelligence_control_system_device + ) +endif() + + +include_directories( + include + ${catkin_INCLUDE_DIRS} +) + +add_library(${PROJECT_NAME} + include/${PROJECT_NAME}/motion_module.h + include/${PROJECT_NAME}/sensor_module.h + include/${PROJECT_NAME}/singleton.h +) +set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX) + +install(TARGETS humanoid_robot_intelligence_control_system_framework_common + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} +) + +install(DIRECTORY include/${PROJECT_NAME}/ + DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} +) diff --git a/humanoid_robot_intelligence_control_system_framework_common/include/humanoid_robot_intelligence_control_system_framework_common/motion_module.h b/humanoid_robot_intelligence_control_system_framework_common/include/humanoid_robot_intelligence_control_system_framework_common/motion_module.h new file mode 100755 index 0000000..9df7326 --- /dev/null +++ b/humanoid_robot_intelligence_control_system_framework_common/include/humanoid_robot_intelligence_control_system_framework_common/motion_module.h @@ -0,0 +1,87 @@ +/******************************************************************************* +* Copyright 2018 ROBOTIS CO., LTD. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*******************************************************************************/ + +/* + * motion_module.h + * + * Created on: 2016. 1. 15. + * Author: zerom + */ + +#ifndef ROBOTIS_FRAMEWORK_COMMON_MOTION_MODULE_H_ +#define ROBOTIS_FRAMEWORK_COMMON_MOTION_MODULE_H_ + + +#include +#include + +#include "singleton.h" +#include "humanoid_robot_intelligence_control_system_device/robot.h" +#include "humanoid_robot_intelligence_control_system_device/dynamixel.h" + +namespace humanoid_robot_intelligence_control_system_framework +{ + +enum ControlMode +{ + PositionControl, + VelocityControl, + TorqueControl +}; + +class MotionModule +{ +protected: + bool enable_; + std::string module_name_; + ControlMode control_mode_; + +public: + std::map result_; + + virtual ~MotionModule() { } + + std::string getModuleName() { return module_name_; } + ControlMode getControlMode() { return control_mode_; } + + void setModuleEnable(bool enable) + { + if(this->enable_ == enable) + return; + + this->enable_ = enable; + if(enable) + onModuleEnable(); + else + onModuleDisable(); + } + bool getModuleEnable() { return enable_; } + + virtual void onModuleEnable() { } + virtual void onModuleDisable() { } + + virtual void initialize(const int control_cycle_msec, Robot *robot) = 0; + virtual void process(std::map dxls, std::map sensors) = 0; + + virtual void stop() = 0; + virtual bool isRunning() = 0; +}; + + +} + + +#endif /* ROBOTIS_FRAMEWORK_COMMON_MOTION_MODULE_H_ */ diff --git a/humanoid_robot_intelligence_control_system_framework_common/include/humanoid_robot_intelligence_control_system_framework_common/sensor_module.h b/humanoid_robot_intelligence_control_system_framework_common/include/humanoid_robot_intelligence_control_system_framework_common/sensor_module.h new file mode 100755 index 0000000..23e6292 --- /dev/null +++ b/humanoid_robot_intelligence_control_system_framework_common/include/humanoid_robot_intelligence_control_system_framework_common/sensor_module.h @@ -0,0 +1,57 @@ +/******************************************************************************* +* Copyright 2018 ROBOTIS CO., LTD. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*******************************************************************************/ + +/* + * sensor_module.h + * + * Created on: 2016. 3. 30. + * Author: zerom + */ + +#ifndef ROBOTIS_FRAMEWORK_COMMON_SENSOR_MODULE_H_ +#define ROBOTIS_FRAMEWORK_COMMON_SENSOR_MODULE_H_ + + +#include +#include + +#include "singleton.h" +#include "humanoid_robot_intelligence_control_system_device/robot.h" +#include "humanoid_robot_intelligence_control_system_device/dynamixel.h" + +namespace humanoid_robot_intelligence_control_system_framework +{ + +class SensorModule +{ +protected: + std::string module_name_; + +public: + std::map result_; + + virtual ~SensorModule() { } + + std::string getModuleName() { return module_name_; } + + virtual void initialize(const int control_cycle_msec, Robot *robot) = 0; + virtual void process(std::map dxls, std::map sensors) = 0; +}; + +} + + +#endif /* ROBOTIS_FRAMEWORK_COMMON_SENSOR_MODULE_H_ */ diff --git a/humanoid_robot_intelligence_control_system_framework_common/include/humanoid_robot_intelligence_control_system_framework_common/singleton.h b/humanoid_robot_intelligence_control_system_framework_common/include/humanoid_robot_intelligence_control_system_framework_common/singleton.h new file mode 100755 index 0000000..5f1c4ab --- /dev/null +++ b/humanoid_robot_intelligence_control_system_framework_common/include/humanoid_robot_intelligence_control_system_framework_common/singleton.h @@ -0,0 +1,65 @@ +/******************************************************************************* +* Copyright 2018 ROBOTIS CO., LTD. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*******************************************************************************/ + +/* + * singleton.h + * + * Created on: 2016. 5. 17. + * Author: zerom + */ + +#ifndef ROBOTIS_FRAMEWORK_COMMON_SINGLETON_H_ +#define ROBOTIS_FRAMEWORK_COMMON_SINGLETON_H_ + + +namespace humanoid_robot_intelligence_control_system_framework +{ + +template +class Singleton +{ +private: + static T *unique_instance_; + +protected: + Singleton() { } + Singleton(Singleton const&) { } + Singleton& operator=(Singleton const&) { return *this; } + +public: + static T* getInstance() + { + if(unique_instance_ == NULL) + unique_instance_ = new T; + return unique_instance_; + } + + static void destroyInstance() + { + if(unique_instance_) + { + delete unique_instance_; + unique_instance_ = NULL; + } + } +}; + +template T* Singleton::unique_instance_ = NULL; + +} + + +#endif /* ROBOTIS_FRAMEWORK_COMMON_SINGLETON_H_ */ diff --git a/humanoid_robot_intelligence_control_system_framework_common/package.xml b/humanoid_robot_intelligence_control_system_framework_common/package.xml new file mode 100755 index 0000000..c12c3b2 --- /dev/null +++ b/humanoid_robot_intelligence_control_system_framework_common/package.xml @@ -0,0 +1,33 @@ + + + humanoid_robot_intelligence_control_system_framework_common + 0.3.2 + The package contains commonly used headers for the humanoid_robot_intelligence_control_system_framework + Apache 2.0 + Ronaldson Bellande + + + catkin + + roscpp + humanoid_robot_intelligence_control_system_device + + roscpp + humanoid_robot_intelligence_control_system_device + + roscpp + humanoid_robot_intelligence_control_system_device + + + ament_cmake + + roscpp + humanoid_robot_intelligence_control_system_device + + roscpp + humanoid_robot_intelligence_control_system_device + + roscpp + humanoid_robot_intelligence_control_system_device + +