Change the Yahboom Demo Code naming to Eutobot
and Check correct Run Cartographer SLAM.master
parent
c7604fcfa6
commit
935ac7f9dc
|
@ -0,0 +1,76 @@
|
|||
SHELL=/bin/bash
|
||||
SESSION_MANAGER=local/hjmatt-linux:@/tmp/.ICE-unix/2197,unix/hjmatt-linux:/tmp/.ICE-unix/2197
|
||||
QT_ACCESSIBILITY=1
|
||||
COLORTERM=truecolor
|
||||
XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg
|
||||
XDG_MENU_PREFIX=gnome-
|
||||
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
|
||||
TERMINATOR_DBUS_PATH=/net/tenshu/Terminator2
|
||||
LC_ADDRESS=ko_KR.UTF-8
|
||||
GNOME_SHELL_SESSION_MODE=ubuntu
|
||||
LC_NAME=ko_KR.UTF-8
|
||||
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
|
||||
ELECTRON_RUN_AS_NODE=1
|
||||
TERMINATOR_UUID=urn:uuid:277bb516-a061-4c0a-86e5-886608b59917
|
||||
XMODIFIERS=@im=ibus
|
||||
DESKTOP_SESSION=ubuntu
|
||||
LC_MONETARY=ko_KR.UTF-8
|
||||
SSH_AGENT_PID=2159
|
||||
NO_AT_BRIDGE=1
|
||||
VSCODE_AMD_ENTRYPOINT=vs/workbench/api/node/extensionHostProcess
|
||||
GTK_MODULES=gail:atk-bridge
|
||||
PWD=/home/hjmatt/task8/13.ros/4.TaskSpace/eutobot_intergration
|
||||
XDG_SESSION_DESKTOP=ubuntu
|
||||
LOGNAME=hjmatt
|
||||
XDG_SESSION_TYPE=x11
|
||||
GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1
|
||||
VSCODE_CODE_CACHE_PATH=/home/hjmatt/.config/Code/CachedData/0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2
|
||||
XAUTHORITY=/run/user/1000/gdm/Xauthority
|
||||
GJS_DEBUG_TOPICS=JS ERROR;JS LOG
|
||||
WINDOWPATH=2
|
||||
HOME=/home/hjmatt
|
||||
USERNAME=hjmatt
|
||||
IM_CONFIG_PHASE=1
|
||||
LC_PAPER=ko_KR.UTF-8
|
||||
LANG=en_US.UTF-8
|
||||
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
|
||||
XDG_CURRENT_DESKTOP=Unity
|
||||
VSCODE_IPC_HOOK=/run/user/1000/vscode-7e50df75-1.85-main.sock
|
||||
VTE_VERSION=6003
|
||||
VSCODE_CLI=1
|
||||
INVOCATION_ID=804838178d254e2993b3a443970b7363
|
||||
TERMINATOR_DBUS_NAME=net.tenshu.Terminator21a9d5db22c73a993ff0b42f64b396873
|
||||
MANAGERPID=1983
|
||||
CHROME_DESKTOP=code-url-handler.desktop
|
||||
GJS_DEBUG_OUTPUT=stderr
|
||||
LESSCLOSE=/usr/bin/lesspipe %s %s
|
||||
XDG_SESSION_CLASS=user
|
||||
TERM=xterm-256color
|
||||
LC_IDENTIFICATION=ko_KR.UTF-8
|
||||
LESSOPEN=| /usr/bin/lesspipe %s
|
||||
USER=hjmatt
|
||||
DISPLAY=:0
|
||||
VSCODE_PID=3999
|
||||
SHLVL=1
|
||||
LC_TELEPHONE=ko_KR.UTF-8
|
||||
QT_IM_MODULE=ibus
|
||||
LC_MEASUREMENT=ko_KR.UTF-8
|
||||
VSCODE_CWD=/home/hjmatt/task8/13.ros/4.TaskSpace/eutobot_intergration
|
||||
VSCODE_CRASH_REPORTER_PROCESS_TYPE=extensionHost
|
||||
XDG_RUNTIME_DIR=/run/user/1000
|
||||
LC_TIME=ko_KR.UTF-8
|
||||
ELECTRON_NO_ATTACH_CONSOLE=1
|
||||
JOURNAL_STREAM=8:58733
|
||||
XDG_DATA_DIRS=/usr/share/ubuntu:/usr/local/share/:/usr/share/
|
||||
GDK_BACKEND=x11
|
||||
PATH=/home/hjmatt/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
|
||||
GDMSESSION=ubuntu
|
||||
ORIGINAL_XDG_CURRENT_DESKTOP=ubuntu:GNOME
|
||||
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
|
||||
VSCODE_NLS_CONFIG={"locale":"en-us","osLocale":"en-us","availableLanguages":{},"_languagePackSupport":true}
|
||||
GIO_LAUNCHED_DESKTOP_FILE_PID=2719
|
||||
GIO_LAUNCHED_DESKTOP_FILE=/usr/share/applications/terminator.desktop
|
||||
VSCODE_HANDLES_UNCAUGHT_ERRORS=true
|
||||
LC_NUMERIC=ko_KR.UTF-8
|
||||
OLDPWD=/home/hjmatt/task8/13.ros/4.TaskSpace
|
||||
_=/usr/bin/env
|
19
README.md
19
README.md
|
@ -0,0 +1,19 @@
|
|||
## Run Eutobot
|
||||
|
||||
1. Open Terminal in target board and Insert below command
|
||||
```
|
||||
$ ros2 launch eutobot_nav laser_bringup_launch.py
|
||||
```
|
||||
2. Open Terminal in Host PC and Insert below command
|
||||
```
|
||||
$ ros2 launch eutobot_nav cartographer_launch.py
|
||||
```
|
||||
3. Open second Terminal in Host PC and Insert below command
|
||||
```
|
||||
$ ros2 launch eutobot_nav display_map_launch.py
|
||||
```
|
||||
|
||||
|
||||
<br>
|
||||
check the grid map through rviz.
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
SHELL=/bin/bash
|
||||
SESSION_MANAGER=local/hjmatt-linux:@/tmp/.ICE-unix/2257,unix/hjmatt-linux:/tmp/.ICE-unix/2257
|
||||
SESSION_MANAGER=local/hjmatt-linux:@/tmp/.ICE-unix/2197,unix/hjmatt-linux:/tmp/.ICE-unix/2197
|
||||
QT_ACCESSIBILITY=1
|
||||
COLORTERM=truecolor
|
||||
XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg
|
||||
|
@ -11,11 +11,12 @@ GNOME_SHELL_SESSION_MODE=ubuntu
|
|||
LC_NAME=ko_KR.UTF-8
|
||||
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
|
||||
ELECTRON_RUN_AS_NODE=1
|
||||
TERMINATOR_UUID=urn:uuid:1b1c9186-aec3-4494-ab5a-f51a9555abf6
|
||||
TERMINATOR_UUID=urn:uuid:277bb516-a061-4c0a-86e5-886608b59917
|
||||
XMODIFIERS=@im=ibus
|
||||
DESKTOP_SESSION=ubuntu
|
||||
LC_MONETARY=ko_KR.UTF-8
|
||||
SSH_AGENT_PID=2219
|
||||
SSH_AGENT_PID=2159
|
||||
NO_AT_BRIDGE=1
|
||||
VSCODE_AMD_ENTRYPOINT=vs/workbench/api/node/extensionHostProcess
|
||||
GTK_MODULES=gail:atk-bridge
|
||||
PWD=/home/hjmatt/task8/13.ros/SRDK/mnt_target/workspace/src
|
||||
|
@ -23,7 +24,7 @@ XDG_SESSION_DESKTOP=ubuntu
|
|||
LOGNAME=hjmatt
|
||||
XDG_SESSION_TYPE=x11
|
||||
GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1
|
||||
VSCODE_CODE_CACHE_PATH=/home/hjmatt/.config/Code/CachedData/1a5daa3a0231a0fbba4f14db7ec463cf99d7768e
|
||||
VSCODE_CODE_CACHE_PATH=/home/hjmatt/.config/Code/CachedData/0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2
|
||||
_=/usr/bin/env
|
||||
XAUTHORITY=/run/user/1000/gdm/Xauthority
|
||||
GJS_DEBUG_TOPICS=JS ERROR;JS LOG
|
||||
|
@ -35,12 +36,12 @@ LC_PAPER=ko_KR.UTF-8
|
|||
LANG=en_US.UTF-8
|
||||
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
|
||||
XDG_CURRENT_DESKTOP=Unity
|
||||
VSCODE_IPC_HOOK=/run/user/1000/vscode-7e50df75-1.84-main.sock
|
||||
VSCODE_IPC_HOOK=/run/user/1000/vscode-7e50df75-1.85-main.sock
|
||||
VTE_VERSION=6003
|
||||
VSCODE_CLI=1
|
||||
INVOCATION_ID=67cab6c134a244dba56513793b4cab58
|
||||
INVOCATION_ID=804838178d254e2993b3a443970b7363
|
||||
TERMINATOR_DBUS_NAME=net.tenshu.Terminator21a9d5db22c73a993ff0b42f64b396873
|
||||
MANAGERPID=2041
|
||||
MANAGERPID=1983
|
||||
CHROME_DESKTOP=code-url-handler.desktop
|
||||
GJS_DEBUG_OUTPUT=stderr
|
||||
LESSCLOSE=/usr/bin/lesspipe %s %s
|
||||
|
@ -50,7 +51,7 @@ LC_IDENTIFICATION=ko_KR.UTF-8
|
|||
LESSOPEN=| /usr/bin/lesspipe %s
|
||||
USER=hjmatt
|
||||
DISPLAY=:0
|
||||
VSCODE_PID=609928
|
||||
VSCODE_PID=3999
|
||||
SHLVL=1
|
||||
LC_TELEPHONE=ko_KR.UTF-8
|
||||
QT_IM_MODULE=ibus
|
||||
|
@ -60,7 +61,7 @@ VSCODE_CRASH_REPORTER_PROCESS_TYPE=extensionHost
|
|||
XDG_RUNTIME_DIR=/run/user/1000
|
||||
LC_TIME=ko_KR.UTF-8
|
||||
ELECTRON_NO_ATTACH_CONSOLE=1
|
||||
JOURNAL_STREAM=8:55273
|
||||
JOURNAL_STREAM=8:58733
|
||||
XDG_DATA_DIRS=/usr/share/ubuntu:/usr/local/share/:/usr/share/
|
||||
GDK_BACKEND=x11
|
||||
PATH=/home/hjmatt/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
|
||||
|
@ -68,7 +69,7 @@ GDMSESSION=ubuntu
|
|||
ORIGINAL_XDG_CURRENT_DESKTOP=ubuntu:GNOME
|
||||
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
|
||||
VSCODE_NLS_CONFIG={"locale":"en-us","osLocale":"en-us","availableLanguages":{},"_languagePackSupport":true}
|
||||
GIO_LAUNCHED_DESKTOP_FILE_PID=2710
|
||||
GIO_LAUNCHED_DESKTOP_FILE_PID=2719
|
||||
GIO_LAUNCHED_DESKTOP_FILE=/usr/share/applications/terminator.desktop
|
||||
VSCODE_HANDLES_UNCAUGHT_ERRORS=true
|
||||
LC_NUMERIC=ko_KR.UTF-8
|
||||
|
|
|
@ -1,61 +0,0 @@
|
|||
# Compiled Object files
|
||||
*.slo
|
||||
*.lo
|
||||
*.o
|
||||
*.obj
|
||||
|
||||
# Precompiled Headers
|
||||
*.gch
|
||||
*.pch
|
||||
|
||||
# Compiled Dynamic libraries
|
||||
*.so
|
||||
*.dylib
|
||||
*.dll
|
||||
|
||||
# Fortran module files
|
||||
*.mod
|
||||
|
||||
# Compiled Static libraries
|
||||
*.lai
|
||||
*.la
|
||||
*.a
|
||||
*.lib
|
||||
|
||||
# Executables
|
||||
*.exe
|
||||
*.out
|
||||
*.app
|
||||
|
||||
# user setting
|
||||
*.*~
|
||||
*.bak
|
||||
.svn
|
||||
.tags
|
||||
.tags_sorted_by_file
|
||||
*.cfgc
|
||||
*.txt.user*
|
||||
*-build/
|
||||
cpp/
|
||||
bin/
|
||||
build/
|
||||
msg_gen/
|
||||
srv_gen/
|
||||
docs/
|
||||
lib/
|
||||
cmake_install.cmake
|
||||
Makefile
|
||||
CMakeFiles/
|
||||
assets/
|
||||
gen/
|
||||
build.xml
|
||||
lint.xml
|
||||
local.properties
|
||||
proguard-project.txt
|
||||
build-*/
|
||||
*.autosave
|
||||
*.pyc
|
||||
*.dat
|
||||
*.txt.user
|
||||
*.gch
|
||||
/.project
|
|
@ -1,202 +0,0 @@
|
|||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"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.
|
|
@ -1,7 +0,0 @@
|
|||
================================================================================
|
||||
Changelog for package eutobot
|
||||
================================================================================
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
0.1.0 (2023-11-06)
|
||||
- First Draft
|
|
@ -1,9 +0,0 @@
|
|||
cmake_minimum_required(VERSION 3.5)
|
||||
project(eutobot)
|
||||
|
||||
if(NOT CMAKE_CXX_STANDARD)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
endif()
|
||||
|
||||
find_package(ament_cmake REQUIRED)
|
||||
ament_package()
|
|
@ -1,27 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||
<package format="3">
|
||||
<name>eutobot</name>
|
||||
<version>0.1.0</version>
|
||||
<description>
|
||||
ROS 2 packages for EutoBot
|
||||
</description>
|
||||
<maintainer email="ray@coasia.com">Ray Park</maintainer>
|
||||
<license>Apache 2.0</license>
|
||||
<url type="website">http://www.coasianexell.com/</url>
|
||||
<url type="repository">http://cnst.coasianexell.com:53000/robotics/eutobot</url>
|
||||
<url type="bugtracker">http://cnst.coasianexell.com:53000/issues</url>
|
||||
<author email="sw.jo@coasia.com">Biela Jo</author>
|
||||
<author email="emergency@coasia.com">Matt Lim</author>
|
||||
<buildtool_depend>ament_cmake</buildtool_depend>
|
||||
<exec_depend>eutobot_bringup</exec_depend>
|
||||
<exec_depend>eutobot_cartographer</exec_depend>
|
||||
<exec_depend>eutobot_description</exec_depend>
|
||||
<exec_depend>eutobot_example</exec_depend>
|
||||
<exec_depend>eutobot_navigation2</exec_depend>
|
||||
<exec_depend>eutobot_node</exec_depend>
|
||||
<exec_depend>eutobot_teleop</exec_depend>
|
||||
<export>
|
||||
<build_type>ament_cmake</build_type>
|
||||
</export>
|
||||
</package>
|
|
@ -1,7 +0,0 @@
|
|||
================================================================================
|
||||
Changelog for package eutobot_bringup
|
||||
================================================================================
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
0.1.0 (2023-11-06)
|
||||
- First Draft
|
|
@ -1,31 +0,0 @@
|
|||
################################################################################
|
||||
# Set minimum required version of cmake, project name and compile options
|
||||
################################################################################
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
project(eutobot_bringup)
|
||||
|
||||
if(NOT CMAKE_CXX_STANDARD)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
add_compile_options(-Wall -Wextra -Wpedantic)
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# Find ament packages and libraries for ament and system dependencies
|
||||
################################################################################
|
||||
find_package(ament_cmake REQUIRED)
|
||||
|
||||
################################################################################
|
||||
# Install
|
||||
################################################################################
|
||||
install(
|
||||
DIRECTORY launch param script
|
||||
DESTINATION share/${PROJECT_NAME}
|
||||
)
|
||||
|
||||
################################################################################
|
||||
# Macro for ament package
|
||||
################################################################################
|
||||
ament_package()
|
|
@ -1,58 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
#
|
||||
# Copyright 2023 CoasiaNexell 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.
|
||||
#
|
||||
# Authors: Biela Jo
|
||||
|
||||
import os
|
||||
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import Node
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
use_sim_time = LaunchConfiguration('use_sim_time', default='false')
|
||||
urdf_file_name = 'eutobot.urdf'
|
||||
|
||||
print("urdf_file_name : {}".format(urdf_file_name))
|
||||
|
||||
urdf = os.path.join(
|
||||
get_package_share_directory('eutobot_description'),
|
||||
'urdf',
|
||||
urdf_file_name)
|
||||
|
||||
# Major refactor of the robot_state_publisher
|
||||
# Reference page: https://github.com/ros2/demos/pull/426
|
||||
with open(urdf, 'r') as infp:
|
||||
robot_desc = infp.read()
|
||||
|
||||
rsp_params = {'robot_description': robot_desc}
|
||||
|
||||
# print (robot_desc) # Printing urdf information.
|
||||
|
||||
return LaunchDescription([
|
||||
DeclareLaunchArgument(
|
||||
'use_sim_time',
|
||||
default_value='false',
|
||||
description='Use simulation (Gazebo) clock if true'),
|
||||
Node(
|
||||
package='robot_state_publisher',
|
||||
executable='robot_state_publisher',
|
||||
output='screen',
|
||||
parameters=[rsp_params, {'use_sim_time': use_sim_time}])
|
||||
])
|
|
@ -1,90 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
#
|
||||
# Copyright 2023 CoAsia Nexell 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.
|
||||
#
|
||||
# Authors: Biela Jo
|
||||
|
||||
import os
|
||||
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.actions import IncludeLaunchDescription
|
||||
from launch.conditions import IfCondition, UnlessCondition
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch.substitutions import ThisLaunchFileDir
|
||||
from launch.substitutions import Command
|
||||
from launch_ros.actions import Node
|
||||
from launch_ros.parameter_descriptions import ParameterValue
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
# Dynamixel USB Port
|
||||
dynamixel_usb_port = LaunchConfiguration('dynamixel_usb_port', default='/dev/ttyUSB1')
|
||||
|
||||
# eutobot_param_dir = LaunchConfiguration(
|
||||
# 'eutobot_param_dir',
|
||||
# default=os.path.join(
|
||||
# get_package_share_directory('eutobot_bringup'),
|
||||
# 'param',
|
||||
# 'eutobot.yaml'))
|
||||
|
||||
lidar_pkg_dir = LaunchConfiguration(
|
||||
'lidar_pkg_dir',
|
||||
default=os.path.join(get_package_share_directory('ydlidar_ros2_driver'), 'launch'))
|
||||
# LDS_LAUNCH_FILE = '/ydlidar_launch.py'
|
||||
|
||||
use_sim_time = LaunchConfiguration('use_sim_time', default='false')
|
||||
|
||||
# YAHBOOM
|
||||
yahboom_pkg_dir = LaunchConfiguration(
|
||||
'yahboom_pkg_dir',
|
||||
default=os.path.join(get_package_share_directory('yahboomcar_bringup'), 'launch'))
|
||||
|
||||
|
||||
return LaunchDescription([
|
||||
DeclareLaunchArgument(
|
||||
'use_sim_time',
|
||||
default_value=use_sim_time,
|
||||
description='Use simulation (Gazebo) clock if true'),
|
||||
|
||||
# DeclareLaunchArgument(
|
||||
# 'eutobot_param_dir',
|
||||
# default_value=eutobot_param_dir,
|
||||
# description='Full path to eutobot parameter file to load'),
|
||||
|
||||
# IncludeLaunchDescription(
|
||||
# PythonLaunchDescriptionSource(
|
||||
# [ThisLaunchFileDir(), '/eutobot_state_publisher.launch.py']),
|
||||
# launch_arguments={'use_sim_time': use_sim_time}.items(),
|
||||
# ),
|
||||
|
||||
IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource([lidar_pkg_dir, '/ydlidar_launch.py']),
|
||||
launch_arguments={'port': '/dev/ttySAC6', 'frame_id': 'base_scan'}.items(),
|
||||
),
|
||||
|
||||
IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource([yahboom_pkg_dir, "/yahboomcar_bringup_X3_launch.py"]),
|
||||
),
|
||||
|
||||
# Node(
|
||||
# package='eutobot_node',
|
||||
# executable='eutobot_ros',
|
||||
# parameters=[eutobot_param_dir],
|
||||
# arguments=['-i', dynamixel_usb_port],
|
||||
# output='screen'),
|
||||
])
|
|
@ -1,39 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
#
|
||||
# Copyright 2023 CoAsia Nexell 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.
|
||||
#
|
||||
# Authors: Biela Jo
|
||||
|
||||
import os
|
||||
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch_ros.actions import Node
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
rviz_config_dir = os.path.join(
|
||||
get_package_share_directory('eutobot_description'),
|
||||
'rviz',
|
||||
'model.rviz')
|
||||
|
||||
return LaunchDescription([
|
||||
Node(
|
||||
package='rviz2',
|
||||
executable='rviz2',
|
||||
name='rviz2',
|
||||
arguments=['-d', rviz_config_dir],
|
||||
output='screen'),
|
||||
])
|
|
@ -1,24 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||
<package format="3">
|
||||
<name>eutobot_bringup</name>
|
||||
<version>0.1.0</version>
|
||||
<description>
|
||||
ExynosAuto ROS2 launch scripts for string the eutobot
|
||||
</description>
|
||||
<maintainer email="ray@coasia.com">Ray Park</maintainer>
|
||||
<license>Apache 2.0</license>
|
||||
<url type="website">http://www.coasianexell.com/</url>
|
||||
<url type="repository">http://cnst.coasianexell.com:53000/robotics/eutobot</url>
|
||||
<url type="bugtracker">http://cnst.coasianexell.com:53000/issues</url>
|
||||
<author email="sw.jo@coasia.com">Biela Jo</author>
|
||||
<author email="emergency@coasia.com">Matt Lim</author>
|
||||
<buildtool_depend>ament_cmake</buildtool_depend>
|
||||
<exec_depend>robot_state_publisher</exec_depend>
|
||||
<exec_depend>rviz2</exec_depend>
|
||||
<exec_depend>eutobot_description</exec_depend>
|
||||
<exec_depend>eutobot_node</exec_depend>
|
||||
<export>
|
||||
<build_type>ament_cmake</build_type>
|
||||
</export>
|
||||
</package>
|
|
@ -1,34 +0,0 @@
|
|||
eutobot_node:
|
||||
ros__parameters:
|
||||
|
||||
opencr:
|
||||
id: 200
|
||||
baud_rate: 1000000
|
||||
protocol_version: 2.0
|
||||
|
||||
wheels:
|
||||
separation: 0.160
|
||||
radius: 0.033
|
||||
|
||||
motors:
|
||||
profile_acceleration_constant: 214.577
|
||||
|
||||
# [rev/min2]
|
||||
# ref) http://emanual.robotis.com/docs/en/dxl/x/xl430-w250/#profile-acceleration
|
||||
profile_acceleration: 0.0
|
||||
|
||||
sensors:
|
||||
bumper_1: 0
|
||||
bumper_2: 0
|
||||
illumination: 0
|
||||
ir: 0
|
||||
sonar: 0
|
||||
|
||||
diff_drive_controller:
|
||||
ros__parameters:
|
||||
|
||||
odometry:
|
||||
publish_tf: true
|
||||
use_imu: true
|
||||
frame_id: "odom"
|
||||
child_frame_id: "base_footprint"
|
|
@ -1,10 +0,0 @@
|
|||
#http://linux-tips.org/t/prevent-modem-manager-to-capture-usb-serial-devices/284/2.
|
||||
|
||||
#cp rules /etc/udev/rules.d/
|
||||
#sudo udevadm control --reload-rules
|
||||
#sudo udevadm trigger
|
||||
|
||||
ATTRS{idVendor}=="0483" ATTRS{idProduct}=="5740", ENV{ID_MM_DEVICE_IGNORE}="1", MODE:="0666"
|
||||
ATTRS{idVendor}=="0483" ATTRS{idProduct}=="df11", MODE:="0666"
|
||||
ATTRS{idVendor}=="fff1" ATTRS{idProduct}=="ff48", ENV{ID_MM_DEVICE_IGNORE}="1", MODE:="0666"
|
||||
ATTRS{idVendor}=="10c4" ATTRS{idProduct}=="ea60", ENV{ID_MM_DEVICE_IGNORE}="1", MODE:="0666"
|
|
@ -1,14 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo ""
|
||||
echo "This script copies a udev rule to /etc to facilitate bringing"
|
||||
echo "up the eutobot usb connection."
|
||||
echo ""
|
||||
|
||||
sudo cp `sudo cp `ros2 pkg prefix eutobot_bringup`/share/eutobot_bringup/script/99-eutobot-cdc.rules /etc/udev/rules.d/
|
||||
|
||||
echo ""
|
||||
echo "Reload rules"
|
||||
echo ""
|
||||
sudo udevadm control --reload-rules
|
||||
sudo udevadm trigger
|
|
@ -1,8 +0,0 @@
|
|||
================================================================================
|
||||
Changelog for package eutobot_cartographer
|
||||
================================================================================
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
0.1.0 (2023-11-06)
|
||||
- First Draft
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
################################################################################
|
||||
# Set minimum required version of cmake, project name and compile options
|
||||
################################################################################
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
project(eutobot_cartographer)
|
||||
|
||||
if(NOT CMAKE_CXX_STANDARD)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# Find ament packages and libraries for ament and system dependencies
|
||||
################################################################################
|
||||
find_package(ament_cmake REQUIRED)
|
||||
|
||||
################################################################################
|
||||
# Install
|
||||
################################################################################
|
||||
install(
|
||||
DIRECTORY config launch rviz
|
||||
DESTINATION share/${PROJECT_NAME}
|
||||
)
|
||||
|
||||
################################################################################
|
||||
# Macro for ament package
|
||||
################################################################################
|
||||
ament_package()
|
|
@ -1,21 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||
<package format="3">
|
||||
<name>eutobot_cartographer</name>
|
||||
<version>0.1.0</version>
|
||||
<description>
|
||||
ROS 2 launch scripts for cartographer
|
||||
</description>
|
||||
<maintainer email="ray@coasia.com">Ray Park</maintainer>
|
||||
<license>Apache 2.0</license>
|
||||
<url type="website">http://www.coasianexell.com/</url>
|
||||
<url type="repository">http://cnst.coasianexell.com:53000/robotics/eutobot</url>
|
||||
<url type="bugtracker">http://cnst.coasianexell.com:53000/issues</url>
|
||||
<author email="sw.jo@coasia.com">Biela Jo</author>
|
||||
<author email="emergency@coasia.com">Matt Lim</author>
|
||||
<buildtool_depend>ament_cmake</buildtool_depend>
|
||||
<exec_depend>cartographer_ros</exec_depend>
|
||||
<export>
|
||||
<build_type>ament_cmake</build_type>
|
||||
</export>
|
||||
</package>
|
|
@ -1,476 +0,0 @@
|
|||
Panels:
|
||||
- Class: rviz_common/Displays
|
||||
Help Height: 78
|
||||
Name: Displays
|
||||
Property Tree Widget:
|
||||
Expanded:
|
||||
- /Global Options1
|
||||
- /LaserScan1/Topic1
|
||||
Splitter Ratio: 0.3916349709033966
|
||||
Tree Height: 347
|
||||
- Class: rviz_common/Selection
|
||||
Name: Selection
|
||||
- Class: rviz_common/Tool Properties
|
||||
Expanded:
|
||||
- /Publish Point1
|
||||
- /2D Pose Estimate1
|
||||
Name: Tool Properties
|
||||
Splitter Ratio: 0.5886790156364441
|
||||
- Class: rviz_common/Views
|
||||
Expanded:
|
||||
- /Current View1
|
||||
Name: Views
|
||||
Splitter Ratio: 0.5
|
||||
Visualization Manager:
|
||||
Class: ""
|
||||
Displays:
|
||||
- Alpha: 0.5
|
||||
Cell Size: 1
|
||||
Class: rviz_default_plugins/Grid
|
||||
Color: 160; 160; 164
|
||||
Enabled: true
|
||||
Line Style:
|
||||
Line Width: 0.029999999329447746
|
||||
Value: Lines
|
||||
Name: Grid
|
||||
Normal Cell Count: 0
|
||||
Offset:
|
||||
X: 0
|
||||
Y: 0
|
||||
Z: 0
|
||||
Plane: XY
|
||||
Plane Cell Count: 10
|
||||
Reference Frame: <Fixed Frame>
|
||||
Value: true
|
||||
- Class: rviz_default_plugins/TF
|
||||
Enabled: true
|
||||
Frame Timeout: 15
|
||||
Frames:
|
||||
All Enabled: true
|
||||
base_footprint:
|
||||
Value: true
|
||||
base_link:
|
||||
Value: true
|
||||
base_scan:
|
||||
Value: true
|
||||
caster_back_link:
|
||||
Value: true
|
||||
imu_link:
|
||||
Value: true
|
||||
map:
|
||||
Value: true
|
||||
odom:
|
||||
Value: true
|
||||
wheel_left_link:
|
||||
Value: true
|
||||
wheel_right_link:
|
||||
Value: true
|
||||
Marker Scale: 1
|
||||
Name: TF
|
||||
Show Arrows: true
|
||||
Show Axes: true
|
||||
Show Names: true
|
||||
Tree:
|
||||
map:
|
||||
odom:
|
||||
base_footprint:
|
||||
base_link:
|
||||
base_scan:
|
||||
{}
|
||||
caster_back_link:
|
||||
{}
|
||||
imu_link:
|
||||
{}
|
||||
wheel_left_link:
|
||||
{}
|
||||
wheel_right_link:
|
||||
{}
|
||||
Update Interval: 0
|
||||
Value: true
|
||||
- Alpha: 1
|
||||
Autocompute Intensity Bounds: true
|
||||
Autocompute Value Bounds:
|
||||
Max Value: 10
|
||||
Min Value: -10
|
||||
Value: true
|
||||
Axis: Z
|
||||
Channel Name: intensity
|
||||
Class: rviz_default_plugins/LaserScan
|
||||
Color: 255; 255; 255
|
||||
Color Transformer: Intensity
|
||||
Decay Time: 0
|
||||
Enabled: true
|
||||
Invert Rainbow: false
|
||||
Max Color: 255; 255; 255
|
||||
Max Intensity: 4439
|
||||
Min Color: 0; 0; 0
|
||||
Min Intensity: 105
|
||||
Name: LaserScan
|
||||
Position Transformer: XYZ
|
||||
Selectable: true
|
||||
Size (Pixels): 3
|
||||
Size (m): 0.019999999552965164
|
||||
Style: Boxes
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
Filter size: 10
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /scan
|
||||
Use Fixed Frame: true
|
||||
Use rainbow: true
|
||||
Value: true
|
||||
- Angle Tolerance: 0.10000000149011612
|
||||
Class: rviz_default_plugins/Odometry
|
||||
Covariance:
|
||||
Orientation:
|
||||
Alpha: 0.5
|
||||
Color: 255; 255; 127
|
||||
Color Style: Unique
|
||||
Frame: Local
|
||||
Offset: 1
|
||||
Scale: 1
|
||||
Value: true
|
||||
Position:
|
||||
Alpha: 0.30000001192092896
|
||||
Color: 204; 51; 204
|
||||
Scale: 1
|
||||
Value: true
|
||||
Value: false
|
||||
Enabled: false
|
||||
Keep: 100
|
||||
Name: Odometry
|
||||
Position Tolerance: 0.10000000149011612
|
||||
Shape:
|
||||
Alpha: 1
|
||||
Axes Length: 1
|
||||
Axes Radius: 0.10000000149011612
|
||||
Color: 255; 25; 0
|
||||
Head Length: 0.30000001192092896
|
||||
Head Radius: 0.10000000149011612
|
||||
Shaft Length: 1
|
||||
Shaft Radius: 0.05000000074505806
|
||||
Value: Arrow
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
Filter size: 10
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /odom
|
||||
Value: false
|
||||
- Alpha: 0.699999988079071
|
||||
Class: rviz_default_plugins/Map
|
||||
Color Scheme: map
|
||||
Draw Behind: false
|
||||
Enabled: true
|
||||
Name: Map
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
Filter size: 10
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /map
|
||||
Update Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /map_updates
|
||||
Use Timestamp: false
|
||||
Value: true
|
||||
- Class: rviz_common/Group
|
||||
Displays:
|
||||
- Class: rviz_common/Group
|
||||
Displays:
|
||||
- Alpha: 0.699999988079071
|
||||
Class: rviz_default_plugins/Map
|
||||
Color Scheme: costmap
|
||||
Draw Behind: true
|
||||
Enabled: true
|
||||
Name: Map
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
Filter size: 10
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /global_costmap/costmap
|
||||
Update Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /global_costmap/costmap_updates
|
||||
Use Timestamp: false
|
||||
Value: true
|
||||
- Alpha: 1
|
||||
Buffer Length: 1
|
||||
Class: rviz_default_plugins/Path
|
||||
Color: 255; 0; 0
|
||||
Enabled: true
|
||||
Head Diameter: 0.30000001192092896
|
||||
Head Length: 0.20000000298023224
|
||||
Length: 0.30000001192092896
|
||||
Line Style: Lines
|
||||
Line Width: 0.029999999329447746
|
||||
Name: Path
|
||||
Offset:
|
||||
X: 0
|
||||
Y: 0
|
||||
Z: 0
|
||||
Pose Color: 255; 85; 255
|
||||
Pose Style: None
|
||||
Radius: 0.029999999329447746
|
||||
Shaft Diameter: 0.10000000149011612
|
||||
Shaft Length: 0.10000000149011612
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
Filter size: 10
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /global_plan
|
||||
Value: true
|
||||
Enabled: true
|
||||
Name: Global Map
|
||||
- Class: rviz_common/Group
|
||||
Displays:
|
||||
- Alpha: 1
|
||||
Class: rviz_default_plugins/Polygon
|
||||
Color: 25; 255; 0
|
||||
Enabled: true
|
||||
Name: Polygon
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
Filter size: 10
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /local_costmap/footprint
|
||||
Value: true
|
||||
- Alpha: 0.699999988079071
|
||||
Class: rviz_default_plugins/Map
|
||||
Color Scheme: costmap
|
||||
Draw Behind: false
|
||||
Enabled: true
|
||||
Name: Map
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
Filter size: 10
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /local_costmap/costmap
|
||||
Update Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /local_costmap/costmap_updates
|
||||
Use Timestamp: false
|
||||
Value: true
|
||||
- Alpha: 1
|
||||
Buffer Length: 1
|
||||
Class: rviz_default_plugins/Path
|
||||
Color: 255; 255; 0
|
||||
Enabled: true
|
||||
Head Diameter: 0.30000001192092896
|
||||
Head Length: 0.20000000298023224
|
||||
Length: 0.30000001192092896
|
||||
Line Style: Lines
|
||||
Line Width: 0.029999999329447746
|
||||
Name: Path
|
||||
Offset:
|
||||
X: 0
|
||||
Y: 0
|
||||
Z: 0
|
||||
Pose Color: 255; 85; 255
|
||||
Pose Style: None
|
||||
Radius: 0.029999999329447746
|
||||
Shaft Diameter: 0.10000000149011612
|
||||
Shaft Length: 0.10000000149011612
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
Filter size: 10
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /local_plan
|
||||
Value: true
|
||||
Enabled: true
|
||||
Name: Local Map
|
||||
- Alpha: 1
|
||||
Arrow Length: 0.05000000074505806
|
||||
Axes Length: 0.30000001192092896
|
||||
Axes Radius: 0.009999999776482582
|
||||
Class: rviz_default_plugins/PoseArray
|
||||
Color: 0; 192; 0
|
||||
Enabled: true
|
||||
Head Length: 0.07000000029802322
|
||||
Head Radius: 0.029999999329447746
|
||||
Name: PoseArray
|
||||
Shaft Length: 0.23000000417232513
|
||||
Shaft Radius: 0.009999999776482582
|
||||
Shape: Arrow (Flat)
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
Filter size: 10
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /particlecloud
|
||||
Value: true
|
||||
Enabled: false
|
||||
Name: Navigation
|
||||
- Class: rviz_common/Group
|
||||
Displays:
|
||||
- Alpha: 1
|
||||
Autocompute Intensity Bounds: true
|
||||
Autocompute Value Bounds:
|
||||
Max Value: 0.18203988671302795
|
||||
Min Value: 0.18195410072803497
|
||||
Value: true
|
||||
Axis: Z
|
||||
Channel Name: intensity
|
||||
Class: rviz_default_plugins/PointCloud2
|
||||
Color: 0; 255; 0
|
||||
Color Transformer: FlatColor
|
||||
Decay Time: 0
|
||||
Enabled: true
|
||||
Invert Rainbow: false
|
||||
Max Color: 255; 255; 255
|
||||
Max Intensity: 4096
|
||||
Min Color: 0; 0; 0
|
||||
Min Intensity: 0
|
||||
Name: scan_matched_points2
|
||||
Position Transformer: XYZ
|
||||
Selectable: true
|
||||
Size (Pixels): 3
|
||||
Size (m): 0.009999999776482582
|
||||
Style: Boxes
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
Filter size: 10
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /scan_matched_points2
|
||||
Use Fixed Frame: true
|
||||
Use rainbow: true
|
||||
Value: true
|
||||
- Class: rviz_default_plugins/MarkerArray
|
||||
Enabled: false
|
||||
Name: Trajectories
|
||||
Namespaces:
|
||||
{}
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /trajectory_node_list
|
||||
Value: false
|
||||
- Class: rviz_default_plugins/MarkerArray
|
||||
Enabled: false
|
||||
Name: Constraints
|
||||
Namespaces:
|
||||
{}
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /constraint_list
|
||||
Value: false
|
||||
- Class: rviz_default_plugins/MarkerArray
|
||||
Enabled: false
|
||||
Name: Landmark Poses
|
||||
Namespaces:
|
||||
{}
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /landmark_poses_list
|
||||
Value: false
|
||||
Enabled: true
|
||||
Name: Cartographer
|
||||
Enabled: true
|
||||
Global Options:
|
||||
Background Color: 48; 48; 48
|
||||
Fixed Frame: map
|
||||
Frame Rate: 30
|
||||
Name: root
|
||||
Tools:
|
||||
- Class: rviz_default_plugins/MoveCamera
|
||||
- Class: rviz_default_plugins/Select
|
||||
- Class: rviz_default_plugins/FocusCamera
|
||||
- Class: rviz_default_plugins/Measure
|
||||
Line color: 128; 128; 0
|
||||
- Class: rviz_default_plugins/SetGoal
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /move_base_simple/goal
|
||||
- Class: rviz_default_plugins/PublishPoint
|
||||
Single click: true
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /clicked_point
|
||||
- Class: rviz_default_plugins/SetInitialPose
|
||||
Covariance x: 0.25
|
||||
Covariance y: 0.25
|
||||
Covariance yaw: 0.06853891909122467
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: initialpose
|
||||
Transformation:
|
||||
Current:
|
||||
Class: rviz_default_plugins/TF
|
||||
Value: true
|
||||
Views:
|
||||
Current:
|
||||
Angle: 0
|
||||
Class: rviz_default_plugins/TopDownOrtho
|
||||
Enable Stereo Rendering:
|
||||
Stereo Eye Separation: 0.05999999865889549
|
||||
Stereo Focal Distance: 1
|
||||
Swap Stereo Eyes: false
|
||||
Value: false
|
||||
Invert Z Axis: false
|
||||
Name: Current View
|
||||
Near Clip Distance: 0.009999999776482582
|
||||
Scale: 119.26066589355469
|
||||
Target Frame: <Fixed Frame>
|
||||
Value: TopDownOrtho (rviz_default_plugins)
|
||||
X: 0.0023878198117017746
|
||||
Y: -0.17037495970726013
|
||||
Saved: ~
|
||||
Window Geometry:
|
||||
Displays:
|
||||
collapsed: false
|
||||
Height: 576
|
||||
Hide Left Dock: false
|
||||
Hide Right Dock: true
|
||||
QMainWindow State: 000000ff00000000fd00000004000000000000017a000001e6fc0200000008fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003d000001e6000000c900fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261000000010000010f00000236fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073000000003d00000236000000a400fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000004420000003efc0100000002fb0000000800540069006d00650100000000000004420000000000000000fb0000000800540069006d00650100000000000004500000000000000000000002db000001e600000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000
|
||||
Selection:
|
||||
collapsed: false
|
||||
Tool Properties:
|
||||
collapsed: false
|
||||
Views:
|
||||
collapsed: true
|
||||
Width: 1115
|
||||
X: 164
|
||||
Y: 106
|
|
@ -1,8 +0,0 @@
|
|||
================================================================================
|
||||
Changelog for package eutobot_description
|
||||
================================================================================
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
0.1.0 (2023-11-06)
|
||||
- First Draft
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
################################################################################
|
||||
# Set minimum required version of cmake, project name and compile options
|
||||
################################################################################
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
project(eutobot_description)
|
||||
|
||||
if(NOT CMAKE_CXX_STANDARD)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
add_compile_options(-Wall -Wextra -Wpedantic)
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# Find ament packages and libraries for ament and system dependencies
|
||||
################################################################################
|
||||
find_package(ament_cmake REQUIRED)
|
||||
find_package(urdf REQUIRED)
|
||||
|
||||
################################################################################
|
||||
# Install
|
||||
################################################################################
|
||||
install(DIRECTORY meshes rviz urdf
|
||||
DESTINATION share/${PROJECT_NAME}
|
||||
)
|
||||
|
||||
################################################################################
|
||||
# Macro for ament package
|
||||
################################################################################
|
||||
ament_package()
|
File diff suppressed because one or more lines are too long
Binary file not shown.
Before Width: | Height: | Size: 64 KiB |
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Before Width: | Height: | Size: 2.4 KiB |
Binary file not shown.
Binary file not shown.
|
@ -1,21 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||
<package format="3">
|
||||
<name>eutobot_description</name>
|
||||
<version>2.1.5</version>
|
||||
<description>
|
||||
3D models of the Eutobot for simulation and visualization
|
||||
</description>
|
||||
<maintainer email="ray@coasia.com">Ray Park</maintainer>
|
||||
<license>Apache 2.0</license>
|
||||
<url type="website">http://www.coasianexell.com/</url>
|
||||
<url type="repository">http://cnst.coasianexell.com:53000/robotics/eutobot</url>
|
||||
<url type="bugtracker">http://cnst.coasianexell.com:53000/issues</url>
|
||||
<author email="sw.jo@coasia.com">Biela Jo</author>
|
||||
<author email="emergency@coasia.com">Matt Lim</author>
|
||||
<buildtool_depend>ament_cmake</buildtool_depend>
|
||||
<depend>urdf</depend>
|
||||
<export>
|
||||
<build_type>ament_cmake</build_type>
|
||||
</export>
|
||||
</package>
|
|
@ -1,45 +0,0 @@
|
|||
<?xml version="1.0" ?>
|
||||
|
||||
<robot name="xacro_properties"
|
||||
xmlns:xacro="http://ros.org/wiki/xacro">
|
||||
|
||||
<!-- Init colour -->
|
||||
<material name="black">
|
||||
<color rgba="0.0 0.0 0.0 1.0"/>
|
||||
</material>
|
||||
|
||||
<material name="dark">
|
||||
<color rgba="0.3 0.3 0.3 1.0"/>
|
||||
</material>
|
||||
<material name="light_black">
|
||||
<color rgba="0.4 0.4 0.4 1.0"/>
|
||||
</material>
|
||||
|
||||
<material name="blue">
|
||||
<color rgba="0.0 0.0 0.8 1.0"/>
|
||||
</material>
|
||||
|
||||
<material name="green">
|
||||
<color rgba="0.0 0.8 0.0 1.0"/>
|
||||
</material>
|
||||
|
||||
<material name="grey">
|
||||
<color rgba="0.5 0.5 0.5 1.0"/>
|
||||
</material>
|
||||
|
||||
<material name="orange">
|
||||
<color rgba="${255/255} ${108/255} ${10/255} 1.0"/>
|
||||
</material>
|
||||
|
||||
<material name="brown">
|
||||
<color rgba="${222/255} ${207/255} ${195/255} 1.0"/>
|
||||
</material>
|
||||
|
||||
<material name="red">
|
||||
<color rgba="0.8 0.0 0.0 1.0"/>
|
||||
</material>
|
||||
|
||||
<material name="white">
|
||||
<color rgba="1.0 1.0 1.0 1.0"/>
|
||||
</material>
|
||||
</robot>
|
|
@ -1,196 +0,0 @@
|
|||
<?xml version="1.0" ?>
|
||||
<robot name="eutobot"
|
||||
xmlns:xacro="http://ros.org/wiki/xacro">
|
||||
<!-- <xacro:include filename="$(find eutobot_description)/urdf/common_properties.urdf"/> -->
|
||||
|
||||
<!-- Init colour -->
|
||||
<material name="black">
|
||||
<color rgba="0.0 0.0 0.0 1.0"/>
|
||||
</material>
|
||||
|
||||
<material name="dark">
|
||||
<color rgba="0.3 0.3 0.3 1.0"/>
|
||||
</material>
|
||||
|
||||
<material name="light_black">
|
||||
<color rgba="0.4 0.4 0.4 1.0"/>
|
||||
</material>
|
||||
|
||||
<material name="blue">
|
||||
<color rgba="0.0 0.0 0.8 1.0"/>
|
||||
</material>
|
||||
|
||||
<material name="green">
|
||||
<color rgba="0.0 0.8 0.0 1.0"/>
|
||||
</material>
|
||||
|
||||
<material name="grey">
|
||||
<color rgba="0.5 0.5 0.5 1.0"/>
|
||||
</material>
|
||||
|
||||
<material name="orange">
|
||||
<color rgba="1.0 0.4235 0.0392 1.0"/>
|
||||
</material>
|
||||
|
||||
<material name="brown">
|
||||
<color rgba="0.8706 0.8118 0.7647 1.0"/>
|
||||
</material>
|
||||
|
||||
<material name="red">
|
||||
<color rgba="0.8 0.0 0.0 1.0"/>
|
||||
</material>
|
||||
|
||||
<material name="white">
|
||||
<color rgba="1.0 1.0 1.0 1.0"/>
|
||||
</material>
|
||||
|
||||
<link name="base_footprint"/>
|
||||
|
||||
<joint name="base_joint" type="fixed">
|
||||
<parent link="base_footprint"/>
|
||||
<child link="base_link"/>
|
||||
<origin xyz="0.0 0.0 0.010" rpy="0 0 0"/>
|
||||
</joint>
|
||||
|
||||
<link name="base_link">
|
||||
<visual>
|
||||
<origin xyz="-0.032 0 0.0" rpy="0 0 0"/>
|
||||
<geometry>
|
||||
<mesh filename="package://eutobot_description/meshes/bases/burger_base.stl" scale="0.001 0.001 0.001"/>
|
||||
</geometry>
|
||||
<material name="light_black"/>
|
||||
</visual>
|
||||
|
||||
<collision>
|
||||
<origin xyz="-0.032 0 0.070" rpy="0 0 0"/>
|
||||
<geometry>
|
||||
<box size="0.140 0.140 0.143"/>
|
||||
</geometry>
|
||||
</collision>
|
||||
|
||||
<inertial>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
<mass value="8.2573504e-01"/>
|
||||
<inertia ixx="2.2124416e-03" ixy="-1.2294101e-05" ixz="3.4938785e-05" iyy="2.1193702e-03" iyz="-5.0120904e-06" izz="2.0064271e-03" />
|
||||
</inertial>
|
||||
</link>
|
||||
|
||||
<joint name="wheel_left_joint" type="continuous">
|
||||
<parent link="base_link"/>
|
||||
<child link="wheel_left_link"/>
|
||||
<origin xyz="0.0 0.08 0.023" rpy="-1.57 0 0"/>
|
||||
<axis xyz="0 0 1"/>
|
||||
</joint>
|
||||
|
||||
<link name="wheel_left_link">
|
||||
<visual>
|
||||
<origin xyz="0 0 0" rpy="1.57 0 0"/>
|
||||
<geometry>
|
||||
<mesh filename="package://eutobot_description/meshes/wheels/left_tire.stl" scale="0.001 0.001 0.001"/>
|
||||
</geometry>
|
||||
<material name="dark"/>
|
||||
</visual>
|
||||
|
||||
<collision>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
<geometry>
|
||||
<cylinder length="0.018" radius="0.033"/>
|
||||
</geometry>
|
||||
</collision>
|
||||
|
||||
<inertial>
|
||||
<origin xyz="0 0 0" />
|
||||
<mass value="2.8498940e-02" />
|
||||
<inertia ixx="1.1175580e-05" ixy="-4.2369783e-11" ixz="-5.9381719e-09" iyy="1.1192413e-05" iyz="-1.4400107e-11" izz="2.0712558e-05" />
|
||||
</inertial>
|
||||
</link>
|
||||
|
||||
<joint name="wheel_right_joint" type="continuous">
|
||||
<parent link="base_link"/>
|
||||
<child link="wheel_right_link"/>
|
||||
<origin xyz="0.0 -0.080 0.023" rpy="-1.57 0 0"/>
|
||||
<axis xyz="0 0 1"/>
|
||||
</joint>
|
||||
|
||||
<link name="wheel_right_link">
|
||||
<visual>
|
||||
<origin xyz="0 0 0" rpy="1.57 0 0"/>
|
||||
<geometry>
|
||||
<mesh filename="package://eutobot_description/meshes/wheels/right_tire.stl" scale="0.001 0.001 0.001"/>
|
||||
</geometry>
|
||||
<material name="dark"/>
|
||||
</visual>
|
||||
|
||||
<collision>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
<geometry>
|
||||
<cylinder length="0.018" radius="0.033"/>
|
||||
</geometry>
|
||||
</collision>
|
||||
|
||||
<inertial>
|
||||
<origin xyz="0 0 0" />
|
||||
<mass value="2.8498940e-02" />
|
||||
<inertia ixx="1.1175580e-05" ixy="-4.2369783e-11" ixz="-5.9381719e-09" iyy="1.1192413e-05" iyz="-1.4400107e-11" izz="2.0712558e-05" />
|
||||
</inertial>
|
||||
</link>
|
||||
|
||||
<joint name="caster_back_joint" type="fixed">
|
||||
<parent link="base_link"/>
|
||||
<child link="caster_back_link"/>
|
||||
<origin xyz="-0.081 0 -0.004" rpy="-1.57 0 0"/>
|
||||
</joint>
|
||||
|
||||
<link name="caster_back_link">
|
||||
<collision>
|
||||
<origin xyz="0 0.001 0" rpy="0 0 0"/>
|
||||
<geometry>
|
||||
<box size="0.030 0.009 0.020"/>
|
||||
</geometry>
|
||||
</collision>
|
||||
|
||||
<inertial>
|
||||
<origin xyz="0 0 0" />
|
||||
<mass value="0.005" />
|
||||
<inertia ixx="0.001" ixy="0.0" ixz="0.0" iyy="0.001" iyz="0.0" izz="0.001" />
|
||||
</inertial>
|
||||
</link>
|
||||
|
||||
<joint name="imu_joint" type="fixed">
|
||||
<parent link="base_link"/>
|
||||
<child link="imu_link"/>
|
||||
<origin xyz="-0.032 0 0.068" rpy="0 0 0"/>
|
||||
</joint>
|
||||
|
||||
<link name="imu_link"/>
|
||||
|
||||
<joint name="scan_joint" type="fixed">
|
||||
<parent link="base_link"/>
|
||||
<child link="base_scan"/>
|
||||
<origin xyz="-0.032 0 0.172" rpy="0 0 0"/>
|
||||
</joint>
|
||||
|
||||
<link name="base_scan">
|
||||
<visual>
|
||||
<origin xyz="0 0 0.0" rpy="0 0 0"/>
|
||||
<geometry>
|
||||
<mesh filename="package://eutobot_description/meshes/sensors/lds.stl" scale="0.001 0.001 0.001"/>
|
||||
</geometry>
|
||||
<material name="dark"/>
|
||||
</visual>
|
||||
|
||||
<collision>
|
||||
<origin xyz="0.015 0 -0.0065" rpy="0 0 0"/>
|
||||
<geometry>
|
||||
<cylinder length="0.0315" radius="0.055"/>
|
||||
</geometry>
|
||||
</collision>
|
||||
|
||||
<inertial>
|
||||
<mass value="0.114" />
|
||||
<origin xyz="0 0 0" />
|
||||
<inertia ixx="0.001" ixy="0.0" ixz="0.0" iyy="0.001" iyz="0.0" izz="0.001" />
|
||||
</inertial>
|
||||
</link>
|
||||
|
||||
</robot>
|
|
@ -1,8 +0,0 @@
|
|||
================================================================================
|
||||
Changelog for package eutobot_msgs
|
||||
================================================================================
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
0.1.0 (2023-11-06)
|
||||
- First Draft
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
################################################################################
|
||||
# Set minimum required version of cmake, project name and compile options
|
||||
################################################################################
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
project(eutobot_msgs)
|
||||
|
||||
if(NOT CMAKE_CXX_STANDARD)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
add_compile_options(-Wall -Wextra -Wpedantic)
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# Find ament packages and libraries for ament and system dependencies
|
||||
################################################################################
|
||||
find_package(action_msgs REQUIRED)
|
||||
find_package(ament_cmake REQUIRED)
|
||||
find_package(rosidl_default_generators REQUIRED)
|
||||
find_package(std_msgs REQUIRED)
|
||||
|
||||
################################################################################
|
||||
# Setup for python modules and scripts
|
||||
################################################################################
|
||||
|
||||
################################################################################
|
||||
# Declare ROS messages, services and actions
|
||||
################################################################################
|
||||
set(msg_files
|
||||
"msg/SensorState.msg"
|
||||
"msg/Sound.msg"
|
||||
"msg/VersionInfo.msg"
|
||||
)
|
||||
|
||||
set(srv_files
|
||||
"srv/Sound.srv"
|
||||
"srv/Dqn.srv"
|
||||
)
|
||||
|
||||
set(action_files
|
||||
"action/Patrol.action"
|
||||
)
|
||||
|
||||
rosidl_generate_interfaces(${PROJECT_NAME}
|
||||
${msg_files}
|
||||
${srv_files}
|
||||
${action_files}
|
||||
DEPENDENCIES action_msgs std_msgs
|
||||
ADD_LINTER_TESTS
|
||||
)
|
||||
ament_export_dependencies(rosidl_default_runtime)
|
||||
ament_package()
|
|
@ -1,8 +0,0 @@
|
|||
# Goal
|
||||
float32 radius
|
||||
---
|
||||
# Result
|
||||
bool success
|
||||
---
|
||||
# Feedback
|
||||
float32 left_time
|
|
@ -1,42 +0,0 @@
|
|||
########################################
|
||||
# CONSTANTS
|
||||
########################################
|
||||
# Bumper states (states are combined, when multiple bumpers are pressed)
|
||||
uint8 BUMPER_FORWARD = 1
|
||||
uint8 BUMPER_BACKWARD = 2
|
||||
|
||||
# Cliff sensor states (states are combined, when multiple cliff sensors are triggered)
|
||||
uint8 CLIFF = 1
|
||||
|
||||
# Sonar sensor states (states are combined, when multiple sonar sensors are triggered)
|
||||
uint8 SONAR = 1
|
||||
|
||||
# Illumination sensor (states are combined, when multiple illumination sensors are triggered)
|
||||
uint8 ILLUMINATION = 1
|
||||
|
||||
# Button states (states are combined, when multiple buttons are pressed)
|
||||
uint8 BUTTON0 = 1
|
||||
uint8 BUTTON1 = 2
|
||||
|
||||
# Motor errors
|
||||
uint8 ERROR_LEFT_MOTOR = 1
|
||||
uint8 ERROR_RIGHT_MOTOR = 2
|
||||
|
||||
# Motor torque
|
||||
uint8 TORQUE_ON = 1
|
||||
uint8 TORQUE_OFF = 2
|
||||
|
||||
########################################
|
||||
# Messages
|
||||
########################################
|
||||
std_msgs/Header header
|
||||
uint8 bumper
|
||||
float32 cliff
|
||||
float32 sonar
|
||||
float32 illumination
|
||||
uint8 led
|
||||
uint8 button
|
||||
bool torque
|
||||
int32 left_encoder # (-2,147,483,648 ~ 2,147,483,647)
|
||||
int32 right_encoder # (-2,147,483,648 ~ 2,147,483,647)
|
||||
float32 battery
|
|
@ -1,14 +0,0 @@
|
|||
########################################
|
||||
# CONSTANTS
|
||||
########################################
|
||||
uint8 OFF = 0
|
||||
uint8 ON = 1
|
||||
uint8 LOW_BATTERY = 2
|
||||
uint8 ERROR = 3
|
||||
uint8 BUTTON1 = 4
|
||||
uint8 BUTTON2 = 5
|
||||
|
||||
########################################
|
||||
# Messages
|
||||
########################################
|
||||
uint8 value
|
|
@ -1,6 +0,0 @@
|
|||
########################################
|
||||
# Messages
|
||||
########################################
|
||||
string hardware # <yyyy>.<mm>.<dd> : hardware version of EutoBot (ex. 2017.05.23)
|
||||
string firmware # <major>.<minor>.<patch> : firmware version of OpenCR
|
||||
string software # <major>.<minor>.<patch> : software version of EutoBot ROS packages
|
|
@ -1,32 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||
<package format="3">
|
||||
<name>eutobot_msgs</name>
|
||||
<version>2.2.3</version>
|
||||
<description>
|
||||
Message and service types: custom messages and services for EutoBot packages for ROS2
|
||||
</description>
|
||||
<maintainer email="ray@coasia.com">Ray Park</maintainer>
|
||||
<license>Apache 2.0</license>
|
||||
<url type="website">http://www.coasianexell.com/</url>
|
||||
<url type="repository">http://cnst.coasianexell.com:53000/robotics/eutobot</url>
|
||||
<url type="bugtracker">http://cnst.coasianexell.com:53000/issues</url>
|
||||
<author email="sw.jo@coasia.com">Biela Jo</author>
|
||||
<author email="emergency@coasia.com">Matt Lim</author>
|
||||
<buildtool_depend>ament_cmake</buildtool_depend>
|
||||
<buildtool_depend>rosidl_default_generators</buildtool_depend>
|
||||
<build_depend>action_msgs</build_depend>
|
||||
<build_depend>builtin_interfaces</build_depend>
|
||||
<build_depend>std_msgs</build_depend>
|
||||
<build_depend>rosidl_default_runtime</build_depend>
|
||||
|
||||
<exec_depend>action_msgs</exec_depend>
|
||||
<exec_depend>builtin_interfaces</exec_depend>
|
||||
<exec_depend>std_msgs</exec_depend>
|
||||
<exec_depend>rosidl_default_runtime</exec_depend>
|
||||
<test_depend>ament_lint_common</test_depend>
|
||||
<member_of_group>rosidl_interface_packages</member_of_group>
|
||||
<export>
|
||||
<build_type>ament_cmake</build_type>
|
||||
</export>
|
||||
</package>
|
|
@ -1,6 +0,0 @@
|
|||
uint8 action
|
||||
bool init
|
||||
---
|
||||
float32[] state
|
||||
float32 reward
|
||||
bool done
|
|
@ -1,14 +0,0 @@
|
|||
########################################
|
||||
# CONSTANTS
|
||||
########################################
|
||||
# uint8 OFF = 0
|
||||
# uint8 ON = 1
|
||||
# uint8 LOW_BATTERY = 2
|
||||
# uint8 ERROR = 3
|
||||
# uint8 BUTTON1 = 4
|
||||
# uint8 BUTTON2 = 5
|
||||
|
||||
uint8 value
|
||||
---
|
||||
bool success
|
||||
string message
|
|
@ -1,7 +0,0 @@
|
|||
================================================================================
|
||||
Changelog for package eutobot_navigation2
|
||||
================================================================================
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
0.1.0 (2023-11-06)
|
||||
- First Draft
|
|
@ -1,27 +0,0 @@
|
|||
################################################################################
|
||||
# Set minimum required version of cmake, project name and compile options
|
||||
################################################################################
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
project(eutobot_navigation2)
|
||||
|
||||
if(NOT CMAKE_CXX_STANDARD)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# Find ament packages and libraries for ament and system dependencies
|
||||
################################################################################
|
||||
find_package(ament_cmake REQUIRED)
|
||||
|
||||
################################################################################
|
||||
# Install
|
||||
################################################################################
|
||||
install(
|
||||
DIRECTORY launch map param rviz
|
||||
DESTINATION share/${PROJECT_NAME}
|
||||
)
|
||||
|
||||
################################################################################
|
||||
# Macro for ament package
|
||||
################################################################################
|
||||
ament_package()
|
|
@ -1,83 +0,0 @@
|
|||
# Copyright 2019 Open Source Robotics Foundation, Inc.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# Author: Darby Lim
|
||||
|
||||
import os
|
||||
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.actions import IncludeLaunchDescription
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import Node
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
use_sim_time = LaunchConfiguration('use_sim_time', default='false')
|
||||
map_dir = LaunchConfiguration(
|
||||
'map',
|
||||
default=os.path.join(
|
||||
get_package_share_directory('eutobot_navigation2'),
|
||||
'map',
|
||||
'map.yaml'))
|
||||
|
||||
param_file_name = 'eutobot.yaml'
|
||||
param_dir = LaunchConfiguration(
|
||||
'params_file',
|
||||
default=os.path.join(
|
||||
get_package_share_directory('eutobot_navigation2'),
|
||||
'param',
|
||||
param_file_name))
|
||||
|
||||
nav2_launch_file_dir = os.path.join(get_package_share_directory('nav2_bringup'), 'launch')
|
||||
|
||||
rviz_config_dir = os.path.join(
|
||||
get_package_share_directory('nav2_bringup'),
|
||||
'rviz',
|
||||
'nav2_default_view.rviz')
|
||||
|
||||
return LaunchDescription([
|
||||
DeclareLaunchArgument(
|
||||
'map',
|
||||
default_value=map_dir,
|
||||
description='Full path to map file to load'),
|
||||
|
||||
DeclareLaunchArgument(
|
||||
'params_file',
|
||||
default_value=param_dir,
|
||||
description='Full path to param file to load'),
|
||||
|
||||
DeclareLaunchArgument(
|
||||
'use_sim_time',
|
||||
default_value='false',
|
||||
description='Use simulation (Gazebo) clock if true'),
|
||||
|
||||
IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource([nav2_launch_file_dir, '/bringup_launch.py']),
|
||||
launch_arguments={
|
||||
'map': map_dir,
|
||||
'use_sim_time': use_sim_time,
|
||||
'params_file': param_dir}.items(),
|
||||
),
|
||||
|
||||
Node(
|
||||
package='rviz2',
|
||||
executable='rviz2',
|
||||
name='rviz2',
|
||||
arguments=['-d', rviz_config_dir],
|
||||
parameters=[{'use_sim_time': use_sim_time}],
|
||||
output='screen'),
|
||||
])
|
|
@ -1,7 +0,0 @@
|
|||
image: map.pgm
|
||||
resolution: 0.050000
|
||||
origin: [-10.000000, -10.000000, 0.000000]
|
||||
negate: 0
|
||||
occupied_thresh: 0.65
|
||||
free_thresh: 0.196
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||
<package format="3">
|
||||
<name>eutobot_navigation2</name>
|
||||
<version>2.1.5</version>
|
||||
<description>
|
||||
ROS 2 launch scripts for navigation2
|
||||
</description>
|
||||
<maintainer email="ray@coasia.com">Ray Park</maintainer>
|
||||
<license>Apache 2.0</license>
|
||||
<url type="website">http://www.coasianexell.com/</url>
|
||||
<url type="repository">http://cnst.coasianexell.com:53000/robotics/eutobot</url>
|
||||
<url type="bugtracker">http://cnst.coasianexell.com:53000/issues</url>
|
||||
<author email="sw.jo@coasia.com">Biela Jo</author>
|
||||
<author email="emergency@coasia.com">Matt Lim</author>
|
||||
<buildtool_depend>ament_cmake</buildtool_depend>
|
||||
<exec_depend>nav2_bringup</exec_depend>
|
||||
<export>
|
||||
<build_type>ament_cmake</build_type>
|
||||
</export>
|
||||
</package>
|
|
@ -1,569 +0,0 @@
|
|||
Panels:
|
||||
- Class: rviz_common/Displays
|
||||
Help Height: 0
|
||||
Name: Displays
|
||||
Property Tree Widget:
|
||||
Expanded:
|
||||
- /Global Options1
|
||||
- /TF1/Frames1
|
||||
- /TF1/Tree1
|
||||
Splitter Ratio: 0.5833333134651184
|
||||
Tree Height: 606
|
||||
- Class: rviz_common/Selection
|
||||
Name: Selection
|
||||
- Class: rviz_common/Tool Properties
|
||||
Expanded:
|
||||
- /Publish Point1
|
||||
Name: Tool Properties
|
||||
Splitter Ratio: 0.5886790156364441
|
||||
- Class: rviz_common/Views
|
||||
Expanded:
|
||||
- /Current View1
|
||||
Name: Views
|
||||
Splitter Ratio: 0.5
|
||||
- Class: nav2_rviz_plugins/Navigation 2
|
||||
Name: Navigation 2
|
||||
Visualization Manager:
|
||||
Class: ""
|
||||
Displays:
|
||||
- Alpha: 0.5
|
||||
Cell Size: 1
|
||||
Class: rviz_default_plugins/Grid
|
||||
Color: 160; 160; 164
|
||||
Enabled: true
|
||||
Line Style:
|
||||
Line Width: 0.029999999329447746
|
||||
Value: Lines
|
||||
Name: Grid
|
||||
Normal Cell Count: 0
|
||||
Offset:
|
||||
X: 0
|
||||
Y: 0
|
||||
Z: 0
|
||||
Plane: XY
|
||||
Plane Cell Count: 10
|
||||
Reference Frame: <Fixed Frame>
|
||||
Value: true
|
||||
- Alpha: 1
|
||||
Class: rviz_default_plugins/RobotModel
|
||||
Collision Enabled: false
|
||||
Description File: ""
|
||||
Description Source: Topic
|
||||
Description Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /robot_description
|
||||
Enabled: false
|
||||
Links:
|
||||
All Links Enabled: true
|
||||
Expand Joint Details: false
|
||||
Expand Link Details: false
|
||||
Expand Tree: false
|
||||
Link Tree Style: ""
|
||||
Name: RobotModel
|
||||
TF Prefix: ""
|
||||
Update Interval: 0
|
||||
Value: false
|
||||
Visual Enabled: true
|
||||
- Class: rviz_default_plugins/TF
|
||||
Enabled: true
|
||||
Frame Timeout: 15
|
||||
Frames:
|
||||
All Enabled: false
|
||||
base_footprint:
|
||||
Value: true
|
||||
base_link:
|
||||
Value: true
|
||||
base_scan:
|
||||
Value: true
|
||||
camera_depth_frame:
|
||||
Value: true
|
||||
camera_depth_optical_frame:
|
||||
Value: true
|
||||
camera_link:
|
||||
Value: true
|
||||
camera_rgb_frame:
|
||||
Value: true
|
||||
camera_rgb_optical_frame:
|
||||
Value: true
|
||||
caster_back_left_link:
|
||||
Value: true
|
||||
caster_back_right_link:
|
||||
Value: true
|
||||
imu_link:
|
||||
Value: true
|
||||
map:
|
||||
Value: true
|
||||
odom:
|
||||
Value: true
|
||||
wheel_left_link:
|
||||
Value: true
|
||||
wheel_right_link:
|
||||
Value: true
|
||||
Marker Scale: 1
|
||||
Name: TF
|
||||
Show Arrows: true
|
||||
Show Axes: true
|
||||
Show Names: false
|
||||
Tree:
|
||||
map:
|
||||
odom:
|
||||
base_footprint:
|
||||
base_link:
|
||||
base_scan:
|
||||
{}
|
||||
camera_link:
|
||||
camera_depth_frame:
|
||||
camera_depth_optical_frame:
|
||||
{}
|
||||
camera_rgb_frame:
|
||||
camera_rgb_optical_frame:
|
||||
{}
|
||||
caster_back_left_link:
|
||||
{}
|
||||
caster_back_right_link:
|
||||
{}
|
||||
imu_link:
|
||||
{}
|
||||
wheel_left_link:
|
||||
{}
|
||||
wheel_right_link:
|
||||
{}
|
||||
Update Interval: 0
|
||||
Value: true
|
||||
- Alpha: 1
|
||||
Autocompute Intensity Bounds: true
|
||||
Autocompute Value Bounds:
|
||||
Max Value: 10
|
||||
Min Value: -10
|
||||
Value: true
|
||||
Axis: Z
|
||||
Channel Name: intensity
|
||||
Class: rviz_default_plugins/LaserScan
|
||||
Color: 255; 255; 255
|
||||
Color Transformer: Intensity
|
||||
Decay Time: 0
|
||||
Enabled: true
|
||||
Invert Rainbow: false
|
||||
Max Color: 255; 255; 255
|
||||
Max Intensity: 0
|
||||
Min Color: 0; 0; 0
|
||||
Min Intensity: 0
|
||||
Name: LaserScan
|
||||
Position Transformer: XYZ
|
||||
Selectable: true
|
||||
Size (Pixels): 3
|
||||
Size (m): 0.009999999776482582
|
||||
Style: Flat Squares
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Best Effort
|
||||
Value: /scan
|
||||
Use Fixed Frame: true
|
||||
Use rainbow: true
|
||||
Value: true
|
||||
- Alpha: 1
|
||||
Autocompute Intensity Bounds: true
|
||||
Autocompute Value Bounds:
|
||||
Max Value: 10
|
||||
Min Value: -10
|
||||
Value: true
|
||||
Axis: Z
|
||||
Channel Name: intensity
|
||||
Class: rviz_default_plugins/PointCloud2
|
||||
Color: 255; 255; 255
|
||||
Color Transformer: ""
|
||||
Decay Time: 0
|
||||
Enabled: true
|
||||
Invert Rainbow: false
|
||||
Max Color: 255; 255; 255
|
||||
Max Intensity: 4096
|
||||
Min Color: 0; 0; 0
|
||||
Min Intensity: 0
|
||||
Name: Bumper Hit
|
||||
Position Transformer: ""
|
||||
Selectable: true
|
||||
Size (Pixels): 3
|
||||
Size (m): 0.07999999821186066
|
||||
Style: Spheres
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Best Effort
|
||||
Value: /mobile_base/sensors/bumper_pointcloud
|
||||
Use Fixed Frame: true
|
||||
Use rainbow: true
|
||||
Value: true
|
||||
- Alpha: 1
|
||||
Class: rviz_default_plugins/Map
|
||||
Color Scheme: map
|
||||
Draw Behind: true
|
||||
Enabled: true
|
||||
Name: Map
|
||||
Topic:
|
||||
Depth: 1
|
||||
Durability Policy: Transient Local
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /map
|
||||
Use Timestamp: false
|
||||
Value: true
|
||||
- Alpha: 1
|
||||
Class: nav2_rviz_plugins/ParticleCloud
|
||||
Color: 0; 180; 0
|
||||
Enabled: true
|
||||
Max Arrow Length: 0.3
|
||||
Min Arrow Length: 0.02
|
||||
Name: Amcl Particle Swarm
|
||||
Shape: Arrow (Flat)
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Best Effort
|
||||
Value: /particle_cloud
|
||||
Value: true
|
||||
- Class: rviz_common/Group
|
||||
Displays:
|
||||
- Alpha: 0.3
|
||||
Class: rviz_default_plugins/Map
|
||||
Color Scheme: costmap
|
||||
Draw Behind: false
|
||||
Enabled: true
|
||||
Name: Global Costmap
|
||||
Topic:
|
||||
Depth: 1
|
||||
Durability Policy: Transient Local
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /global_costmap/costmap
|
||||
Use Timestamp: false
|
||||
Value: true
|
||||
- Alpha: 0.3
|
||||
Class: rviz_default_plugins/Map
|
||||
Color Scheme: costmap
|
||||
Draw Behind: false
|
||||
Enabled: true
|
||||
Name: Downsampled Costmap
|
||||
Topic:
|
||||
Depth: 1
|
||||
Durability Policy: Transient Local
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /downsampled_costmap
|
||||
Use Timestamp: false
|
||||
Value: true
|
||||
- Alpha: 1
|
||||
Buffer Length: 1
|
||||
Class: rviz_default_plugins/Path
|
||||
Color: 255; 0; 0
|
||||
Enabled: true
|
||||
Head Diameter: 0.019999999552965164
|
||||
Head Length: 0.019999999552965164
|
||||
Length: 0.30000001192092896
|
||||
Line Style: Lines
|
||||
Line Width: 0.029999999329447746
|
||||
Name: Path
|
||||
Offset:
|
||||
X: 0
|
||||
Y: 0
|
||||
Z: 0
|
||||
Pose Color: 255; 85; 255
|
||||
Pose Style: Arrows
|
||||
Radius: 0.029999999329447746
|
||||
Shaft Diameter: 0.004999999888241291
|
||||
Shaft Length: 0.019999999552965164
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /plan
|
||||
Value: true
|
||||
- Alpha: 1
|
||||
Autocompute Intensity Bounds: true
|
||||
Autocompute Value Bounds:
|
||||
Max Value: 10
|
||||
Min Value: -10
|
||||
Value: true
|
||||
Axis: Z
|
||||
Channel Name: intensity
|
||||
Class: rviz_default_plugins/PointCloud2
|
||||
Color: 125; 125; 125
|
||||
Color Transformer: FlatColor
|
||||
Decay Time: 0
|
||||
Enabled: true
|
||||
Invert Rainbow: false
|
||||
Max Color: 255; 255; 255
|
||||
Max Intensity: 4096
|
||||
Min Color: 0; 0; 0
|
||||
Min Intensity: 0
|
||||
Name: VoxelGrid
|
||||
Position Transformer: XYZ
|
||||
Selectable: true
|
||||
Size (Pixels): 3
|
||||
Size (m): 0.05000000074505806
|
||||
Style: Boxes
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /global_costmap/voxel_marked_cloud
|
||||
Use Fixed Frame: true
|
||||
Use rainbow: true
|
||||
Value: true
|
||||
- Alpha: 1
|
||||
Class: rviz_default_plugins/Polygon
|
||||
Color: 25; 255; 0
|
||||
Enabled: false
|
||||
Name: Polygon
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /global_costmap/published_footprint
|
||||
Value: false
|
||||
Enabled: true
|
||||
Name: Global Planner
|
||||
- Class: rviz_common/Group
|
||||
Displays:
|
||||
- Alpha: 0.699999988079071
|
||||
Class: rviz_default_plugins/Map
|
||||
Color Scheme: costmap
|
||||
Draw Behind: false
|
||||
Enabled: true
|
||||
Name: Local Costmap
|
||||
Topic:
|
||||
Depth: 1
|
||||
Durability Policy: Transient Local
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /local_costmap/costmap
|
||||
Use Timestamp: false
|
||||
Value: true
|
||||
- Alpha: 1
|
||||
Buffer Length: 1
|
||||
Class: rviz_default_plugins/Path
|
||||
Color: 0; 12; 255
|
||||
Enabled: true
|
||||
Head Diameter: 0.30000001192092896
|
||||
Head Length: 0.20000000298023224
|
||||
Length: 0.30000001192092896
|
||||
Line Style: Lines
|
||||
Line Width: 0.029999999329447746
|
||||
Name: Local Plan
|
||||
Offset:
|
||||
X: 0
|
||||
Y: 0
|
||||
Z: 0
|
||||
Pose Color: 255; 85; 255
|
||||
Pose Style: None
|
||||
Radius: 0.029999999329447746
|
||||
Shaft Diameter: 0.10000000149011612
|
||||
Shaft Length: 0.10000000149011612
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /local_plan
|
||||
Value: true
|
||||
- Class: rviz_default_plugins/MarkerArray
|
||||
Enabled: false
|
||||
Name: Trajectories
|
||||
Namespaces:
|
||||
{}
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /marker
|
||||
Value: false
|
||||
- Alpha: 1
|
||||
Class: rviz_default_plugins/Polygon
|
||||
Color: 25; 255; 0
|
||||
Enabled: true
|
||||
Name: Polygon
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /local_costmap/published_footprint
|
||||
Value: true
|
||||
- Alpha: 1
|
||||
Autocompute Intensity Bounds: true
|
||||
Autocompute Value Bounds:
|
||||
Max Value: 10
|
||||
Min Value: -10
|
||||
Value: true
|
||||
Axis: Z
|
||||
Channel Name: intensity
|
||||
Class: rviz_default_plugins/PointCloud2
|
||||
Color: 255; 255; 255
|
||||
Color Transformer: RGB8
|
||||
Decay Time: 0
|
||||
Enabled: true
|
||||
Invert Rainbow: false
|
||||
Max Color: 255; 255; 255
|
||||
Max Intensity: 4096
|
||||
Min Color: 0; 0; 0
|
||||
Min Intensity: 0
|
||||
Name: VoxelGrid
|
||||
Position Transformer: XYZ
|
||||
Selectable: true
|
||||
Size (Pixels): 3
|
||||
Size (m): 0.009999999776482582
|
||||
Style: Flat Squares
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /local_costmap/voxel_marked_cloud
|
||||
Use Fixed Frame: true
|
||||
Use rainbow: true
|
||||
Value: true
|
||||
Enabled: true
|
||||
Name: Controller
|
||||
- Class: rviz_common/Group
|
||||
Displays:
|
||||
- Class: rviz_default_plugins/Image
|
||||
Enabled: true
|
||||
Max Value: 1
|
||||
Median window: 5
|
||||
Min Value: 0
|
||||
Name: RealsenseCamera
|
||||
Normalize Range: true
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /intel_realsense_r200_depth/image_raw
|
||||
Value: true
|
||||
- Alpha: 1
|
||||
Autocompute Intensity Bounds: true
|
||||
Autocompute Value Bounds:
|
||||
Max Value: 10
|
||||
Min Value: -10
|
||||
Value: true
|
||||
Axis: Z
|
||||
Channel Name: intensity
|
||||
Class: rviz_default_plugins/PointCloud2
|
||||
Color: 255; 255; 255
|
||||
Color Transformer: RGB8
|
||||
Decay Time: 0
|
||||
Enabled: true
|
||||
Invert Rainbow: false
|
||||
Max Color: 255; 255; 255
|
||||
Max Intensity: 4096
|
||||
Min Color: 0; 0; 0
|
||||
Min Intensity: 0
|
||||
Name: RealsenseDepthImage
|
||||
Position Transformer: XYZ
|
||||
Selectable: true
|
||||
Size (Pixels): 3
|
||||
Size (m): 0.009999999776482582
|
||||
Style: Flat Squares
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /intel_realsense_r200_depth/points
|
||||
Use Fixed Frame: true
|
||||
Use rainbow: true
|
||||
Value: true
|
||||
Enabled: false
|
||||
Name: Realsense
|
||||
- Class: rviz_default_plugins/MarkerArray
|
||||
Enabled: true
|
||||
Name: MarkerArray
|
||||
Namespaces:
|
||||
{}
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /waypoints
|
||||
Value: true
|
||||
Enabled: true
|
||||
Global Options:
|
||||
Background Color: 48; 48; 48
|
||||
Fixed Frame: map
|
||||
Frame Rate: 30
|
||||
Name: root
|
||||
Tools:
|
||||
- Class: rviz_default_plugins/MoveCamera
|
||||
- Class: rviz_default_plugins/Select
|
||||
- Class: rviz_default_plugins/FocusCamera
|
||||
- Class: rviz_default_plugins/Measure
|
||||
Line color: 128; 128; 0
|
||||
- Class: rviz_default_plugins/SetInitialPose
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /initialpose
|
||||
- Class: rviz_default_plugins/PublishPoint
|
||||
Single click: true
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /clicked_point
|
||||
- Class: nav2_rviz_plugins/GoalTool
|
||||
Transformation:
|
||||
Current:
|
||||
Class: rviz_default_plugins/TF
|
||||
Value: true
|
||||
Views:
|
||||
Current:
|
||||
Angle: -1.6150002479553223
|
||||
Class: rviz_default_plugins/TopDownOrtho
|
||||
Enable Stereo Rendering:
|
||||
Stereo Eye Separation: 0.05999999865889549
|
||||
Stereo Focal Distance: 1
|
||||
Swap Stereo Eyes: false
|
||||
Value: false
|
||||
Invert Z Axis: false
|
||||
Name: Current View
|
||||
Near Clip Distance: 0.009999999776482582
|
||||
Scale: 127.88431549072266
|
||||
Target Frame: <Fixed Frame>
|
||||
Value: TopDownOrtho (rviz_default_plugins)
|
||||
X: -0.044467076659202576
|
||||
Y: -0.38726311922073364
|
||||
Saved: ~
|
||||
Window Geometry:
|
||||
Displays:
|
||||
collapsed: false
|
||||
Height: 932
|
||||
Hide Left Dock: false
|
||||
Hide Right Dock: true
|
||||
Navigation 2:
|
||||
collapsed: false
|
||||
QMainWindow State: 000000ff00000000fd00000004000000000000016a0000034afc020000000afb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003d0000029b000000c900fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb00000018004e0061007600690067006100740069006f006e0020003201000002de000000a90000008100fffffffb0000001e005200650061006c00730065006e0073006500430061006d00650072006100000002c6000000c10000002800ffffff000000010000010f0000034afc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073000000003d0000034a000000a400fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000004420000003efc0100000002fb0000000800540069006d00650100000000000004420000000000000000fb0000000800540069006d00650100000000000004500000000000000000000004990000034a00000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000
|
||||
RealsenseCamera:
|
||||
collapsed: false
|
||||
Selection:
|
||||
collapsed: false
|
||||
Tool Properties:
|
||||
collapsed: false
|
||||
Views:
|
||||
collapsed: true
|
||||
Width: 1545
|
||||
X: 696
|
||||
Y: 229
|
|
@ -1,8 +0,0 @@
|
|||
================================================================================
|
||||
Changelog for package eutobot_node
|
||||
================================================================================
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
0.1.0 (2023-11-06)
|
||||
- First Draft
|
||||
|
|
@ -1,94 +0,0 @@
|
|||
################################################################################
|
||||
# Set minimum required version of cmake, project name and compile options
|
||||
################################################################################
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
project(eutobot_node)
|
||||
|
||||
if(NOT CMAKE_CXX_STANDARD)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
add_compile_options(-Wall -Wextra -Wpedantic)
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# Find ament packages and libraries for ament and system dependencies
|
||||
################################################################################
|
||||
find_package(ament_cmake REQUIRED)
|
||||
find_package(dynamixel_sdk REQUIRED)
|
||||
find_package(geometry_msgs REQUIRED)
|
||||
find_package(message_filters REQUIRED)
|
||||
find_package(nav_msgs REQUIRED)
|
||||
find_package(rclcpp REQUIRED)
|
||||
find_package(rcutils REQUIRED)
|
||||
find_package(sensor_msgs REQUIRED)
|
||||
find_package(std_msgs REQUIRED)
|
||||
find_package(std_srvs REQUIRED)
|
||||
find_package(tf2 REQUIRED)
|
||||
find_package(tf2_ros REQUIRED)
|
||||
find_package(eutobot_msgs REQUIRED)
|
||||
|
||||
################################################################################
|
||||
# Build
|
||||
################################################################################
|
||||
include_directories(
|
||||
include
|
||||
)
|
||||
|
||||
add_library(${PROJECT_NAME}_lib
|
||||
"src/devices/motor_power.cpp"
|
||||
"src/devices/sound.cpp"
|
||||
"src/devices/reset.cpp"
|
||||
|
||||
"src/diff_drive_controller.cpp"
|
||||
"src/dynamixel_sdk_wrapper.cpp"
|
||||
"src/odometry.cpp"
|
||||
"src/eutobot.cpp"
|
||||
|
||||
"src/sensors/battery_state.cpp"
|
||||
"src/sensors/imu.cpp"
|
||||
"src/sensors/joint_state.cpp"
|
||||
"src/sensors/sensor_state.cpp"
|
||||
)
|
||||
|
||||
set(DEPENDENCIES
|
||||
"dynamixel_sdk"
|
||||
"geometry_msgs"
|
||||
"message_filters"
|
||||
"nav_msgs"
|
||||
"rclcpp"
|
||||
"rcutils"
|
||||
"sensor_msgs"
|
||||
"std_msgs"
|
||||
"std_srvs"
|
||||
"tf2"
|
||||
"tf2_ros"
|
||||
"eutobot_msgs"
|
||||
)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME}_lib)
|
||||
ament_target_dependencies(${PROJECT_NAME}_lib ${DEPENDENCIES})
|
||||
|
||||
set(EXECUTABLE_NAME "eutobot_ros")
|
||||
|
||||
add_executable(${EXECUTABLE_NAME} src/node_main.cpp)
|
||||
target_link_libraries(${EXECUTABLE_NAME} ${PROJECT_NAME}_lib)
|
||||
ament_target_dependencies(${EXECUTABLE_NAME} ${DEPENDENCIES})
|
||||
|
||||
################################################################################
|
||||
# Install
|
||||
################################################################################
|
||||
install(DIRECTORY param
|
||||
DESTINATION share/${PROJECT_NAME}
|
||||
)
|
||||
|
||||
install(TARGETS ${EXECUTABLE_NAME}
|
||||
DESTINATION lib/${PROJECT_NAME}
|
||||
)
|
||||
|
||||
################################################################################
|
||||
# Macro for ament package
|
||||
################################################################################
|
||||
ament_export_include_directories(include)
|
||||
ament_package()
|
|
@ -1,114 +0,0 @@
|
|||
// Copyright 2019 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.
|
||||
//
|
||||
// Author: Darby Lim
|
||||
|
||||
#ifndef EUTOBOT_NODE__CONTROL_TABLE_HPP_
|
||||
#define EUTOBOT_NODE__CONTROL_TABLE_HPP_
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
namespace robotis
|
||||
{
|
||||
namespace eutobot
|
||||
{
|
||||
constexpr uint8_t EEPROM = 1;
|
||||
constexpr uint8_t RAM = 2;
|
||||
|
||||
constexpr uint8_t READ = 1;
|
||||
constexpr uint8_t READ_WRITE = 3;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint16_t addr;
|
||||
uint8_t memory;
|
||||
uint16_t length;
|
||||
uint8_t rw;
|
||||
} ControlItem;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
ControlItem model_number = {0, EEPROM, 2, READ};
|
||||
ControlItem model_information = {2, EEPROM, 4, READ};
|
||||
ControlItem firmware_version = {6, EEPROM, 1, READ};
|
||||
ControlItem id = {7, EEPROM, 1, READ};
|
||||
ControlItem baud_rate = {8, EEPROM, 1, READ};
|
||||
|
||||
ControlItem millis = {10, RAM, 4, READ};
|
||||
ControlItem micros = {14, RAM, 4, READ};
|
||||
|
||||
ControlItem device_status = {18, RAM, 1, READ};
|
||||
ControlItem heartbeat = {19, RAM, 1, READ_WRITE};
|
||||
|
||||
ControlItem external_led_1 = {20, RAM, 1, READ_WRITE};
|
||||
ControlItem external_led_2 = {21, RAM, 1, READ_WRITE};
|
||||
ControlItem external_led_3 = {22, RAM, 1, READ_WRITE};
|
||||
ControlItem external_led_4 = {23, RAM, 1, READ_WRITE};
|
||||
|
||||
ControlItem button_1 = {26, RAM, 1, READ};
|
||||
ControlItem button_2 = {27, RAM, 1, READ};
|
||||
|
||||
ControlItem bumper_1 = {28, RAM, 1, READ};
|
||||
ControlItem bumper_2 = {29, RAM, 1, READ};
|
||||
|
||||
ControlItem illumination = {30, RAM, 4, READ};
|
||||
ControlItem ir = {34, RAM, 4, READ};
|
||||
ControlItem sonar = {38, RAM, 4, READ};
|
||||
|
||||
ControlItem battery_voltage = {42, RAM, 4, READ};
|
||||
ControlItem battery_percentage = {46, RAM, 4, READ};
|
||||
|
||||
ControlItem sound = {50, RAM, 1, READ_WRITE};
|
||||
|
||||
ControlItem imu_re_calibration = {59, RAM, 1, READ_WRITE};
|
||||
|
||||
ControlItem imu_angular_velocity_x = {60, RAM, 4, READ};
|
||||
ControlItem imu_angular_velocity_y = {64, RAM, 4, READ};
|
||||
ControlItem imu_angular_velocity_z = {68, RAM, 4, READ};
|
||||
ControlItem imu_linear_acceleration_x = {72, RAM, 4, READ};
|
||||
ControlItem imu_linear_acceleration_y = {76, RAM, 4, READ};
|
||||
ControlItem imu_linear_acceleration_z = {80, RAM, 4, READ};
|
||||
ControlItem imu_magnetic_x = {84, RAM, 4, READ};
|
||||
ControlItem imu_magnetic_y = {88, RAM, 4, READ};
|
||||
ControlItem imu_magnetic_z = {92, RAM, 4, READ};
|
||||
ControlItem imu_orientation_w = {96, RAM, 4, READ};
|
||||
ControlItem imu_orientation_x = {100, RAM, 4, READ};
|
||||
ControlItem imu_orientation_y = {104, RAM, 4, READ};
|
||||
ControlItem imu_orientation_z = {108, RAM, 4, READ};
|
||||
|
||||
ControlItem present_current_left = {120, RAM, 4, READ};
|
||||
ControlItem present_current_right = {124, RAM, 4, READ};
|
||||
ControlItem present_velocity_left = {128, RAM, 4, READ};
|
||||
ControlItem present_velocity_right = {132, RAM, 4, READ};
|
||||
ControlItem present_position_left = {136, RAM, 4, READ};
|
||||
ControlItem present_position_right = {140, RAM, 4, READ};
|
||||
|
||||
ControlItem motor_torque_enable = {149, RAM, 1, READ_WRITE};
|
||||
|
||||
ControlItem cmd_velocity_linear_x = {150, RAM, 4, READ_WRITE};
|
||||
ControlItem cmd_velocity_linear_y = {154, RAM, 4, READ_WRITE};
|
||||
ControlItem cmd_velocity_linear_z = {158, RAM, 4, READ_WRITE};
|
||||
ControlItem cmd_velocity_angular_x = {162, RAM, 4, READ_WRITE};
|
||||
ControlItem cmd_velocity_angular_y = {166, RAM, 4, READ_WRITE};
|
||||
ControlItem cmd_velocity_angular_z = {170, RAM, 4, READ_WRITE};
|
||||
|
||||
ControlItem profile_acceleration_left = {174, RAM, 4, READ_WRITE};
|
||||
ControlItem profile_acceleration_right = {178, RAM, 4, READ_WRITE};
|
||||
} ControlTable;
|
||||
|
||||
const ControlTable extern_control_table;
|
||||
} // namespace eutobot
|
||||
} // namespace robotis
|
||||
|
||||
#endif // EUTOBOT_NODE__CONTROL_TABLE_HPP_
|
|
@ -1,58 +0,0 @@
|
|||
// Copyright 2019 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.
|
||||
//
|
||||
// Author: Darby Lim
|
||||
|
||||
#ifndef EUTOBOT_NODE__DEVICES__DEVICES_HPP_
|
||||
#define EUTOBOT_NODE__DEVICES__DEVICES_HPP_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include <rclcpp/rclcpp.hpp>
|
||||
|
||||
#include "eutobot_node/control_table.hpp"
|
||||
#include "eutobot_node/dynamixel_sdk_wrapper.hpp"
|
||||
|
||||
|
||||
namespace robotis
|
||||
{
|
||||
namespace eutobot
|
||||
{
|
||||
extern const ControlTable extern_control_table;
|
||||
namespace devices
|
||||
{
|
||||
class Devices
|
||||
{
|
||||
public:
|
||||
explicit Devices(
|
||||
std::shared_ptr<rclcpp::Node> & nh,
|
||||
std::shared_ptr<DynamixelSDKWrapper> & dxl_sdk_wrapper)
|
||||
: nh_(nh),
|
||||
dxl_sdk_wrapper_(dxl_sdk_wrapper)
|
||||
{
|
||||
}
|
||||
|
||||
virtual void command(const void * request, void * response) = 0;
|
||||
|
||||
protected:
|
||||
std::shared_ptr<rclcpp::Node> nh_;
|
||||
std::shared_ptr<DynamixelSDKWrapper> dxl_sdk_wrapper_;
|
||||
rclcpp::QoS qos_ = rclcpp::QoS(rclcpp::ServicesQoS());
|
||||
};
|
||||
} // namespace devices
|
||||
} // namespace eutobot
|
||||
} // namespace robotis
|
||||
#endif // EUTOBOT_NODE__DEVICES__DEVICES_HPP_
|
|
@ -1,53 +0,0 @@
|
|||
// Copyright 2019 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.
|
||||
//
|
||||
// Author: Darby Lim
|
||||
|
||||
#ifndef EUTOBOT_NODE__DEVICES__MOTOR_POWER_HPP_
|
||||
#define EUTOBOT_NODE__DEVICES__MOTOR_POWER_HPP_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include <std_srvs/srv/set_bool.hpp>
|
||||
|
||||
#include "eutobot_node/devices/devices.hpp"
|
||||
|
||||
namespace robotis
|
||||
{
|
||||
namespace eutobot
|
||||
{
|
||||
namespace devices
|
||||
{
|
||||
class MotorPower : public Devices
|
||||
{
|
||||
public:
|
||||
static void request(
|
||||
rclcpp::Client<std_srvs::srv::SetBool>::SharedPtr client,
|
||||
std_srvs::srv::SetBool::Request req);
|
||||
|
||||
explicit MotorPower(
|
||||
std::shared_ptr<rclcpp::Node> & nh,
|
||||
std::shared_ptr<DynamixelSDKWrapper> & dxl_sdk_wrapper,
|
||||
const std::string & server_name = "motor_power");
|
||||
|
||||
void command(const void * request, void * response) override;
|
||||
|
||||
private:
|
||||
rclcpp::Service<std_srvs::srv::SetBool>::SharedPtr srv_;
|
||||
};
|
||||
} // namespace devices
|
||||
} // namespace eutobot
|
||||
} // namespace robotis
|
||||
#endif // EUTOBOT_NODE__DEVICES__MOTOR_POWER_HPP_
|
|
@ -1,53 +0,0 @@
|
|||
// Copyright 2019 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.
|
||||
//
|
||||
// Author: Darby Lim
|
||||
|
||||
#ifndef EUTOBOT_NODE__DEVICES__RESET_HPP_
|
||||
#define EUTOBOT_NODE__DEVICES__RESET_HPP_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include <std_srvs/srv/trigger.hpp>
|
||||
|
||||
#include "eutobot_node/devices/devices.hpp"
|
||||
|
||||
namespace robotis
|
||||
{
|
||||
namespace eutobot
|
||||
{
|
||||
namespace devices
|
||||
{
|
||||
class Reset : public Devices
|
||||
{
|
||||
public:
|
||||
static void request(
|
||||
rclcpp::Client<std_srvs::srv::Trigger>::SharedPtr client,
|
||||
std_srvs::srv::Trigger::Request req);
|
||||
|
||||
explicit Reset(
|
||||
std::shared_ptr<rclcpp::Node> & nh,
|
||||
std::shared_ptr<DynamixelSDKWrapper> & dxl_sdk_wrapper,
|
||||
const std::string & server_name = "reset");
|
||||
|
||||
void command(const void * request, void * response) override;
|
||||
|
||||
private:
|
||||
rclcpp::Service<std_srvs::srv::Trigger>::SharedPtr srv_;
|
||||
};
|
||||
} // namespace devices
|
||||
} // namespace eutobot
|
||||
} // namespace robotis
|
||||
#endif // EUTOBOT_NODE__DEVICES__RESET_HPP_
|
|
@ -1,51 +0,0 @@
|
|||
// Copyright 2019 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.
|
||||
//
|
||||
// Author: Darby Lim
|
||||
|
||||
#ifndef EUTOBOT_NODE__DEVICES__SOUND_HPP_
|
||||
#define EUTOBOT_NODE__DEVICES__SOUND_HPP_
|
||||
|
||||
#include <eutobot_msgs/srv/sound.hpp>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include "eutobot_node/devices/devices.hpp"
|
||||
|
||||
namespace robotis
|
||||
{
|
||||
namespace eutobot
|
||||
{
|
||||
namespace devices
|
||||
{
|
||||
class Sound : public Devices
|
||||
{
|
||||
public:
|
||||
static void request(
|
||||
rclcpp::Client<eutobot_msgs::srv::Sound>::SharedPtr client,
|
||||
eutobot_msgs::srv::Sound::Request req);
|
||||
|
||||
explicit Sound(
|
||||
std::shared_ptr<rclcpp::Node> & nh,
|
||||
std::shared_ptr<DynamixelSDKWrapper> & dxl_sdk_wrapper,
|
||||
const std::string & server_name = "sound");
|
||||
|
||||
void command(const void * request, void * response) override;
|
||||
|
||||
private:
|
||||
rclcpp::Service<eutobot_msgs::srv::Sound>::SharedPtr srv_;
|
||||
};
|
||||
} // namespace devices
|
||||
} // namespace eutobot
|
||||
} // namespace robotis
|
||||
#endif // EUTOBOT_NODE__DEVICES__SOUND_HPP_
|
|
@ -1,42 +0,0 @@
|
|||
// Copyright 2019 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.
|
||||
//
|
||||
// Author: Darby Lim
|
||||
|
||||
#ifndef EUTOBOT_NODE__DIFF_DRIVE_CONTROLLER_HPP_
|
||||
#define EUTOBOT_NODE__DIFF_DRIVE_CONTROLLER_HPP_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <rclcpp/rclcpp.hpp>
|
||||
|
||||
#include "eutobot_node/odometry.hpp"
|
||||
|
||||
namespace robotis
|
||||
{
|
||||
namespace eutobot
|
||||
{
|
||||
class DiffDriveController : public rclcpp::Node
|
||||
{
|
||||
public:
|
||||
explicit DiffDriveController(const float wheel_seperation, const float wheel_radius);
|
||||
virtual ~DiffDriveController() {}
|
||||
|
||||
private:
|
||||
std::shared_ptr<rclcpp::Node> nh_;
|
||||
std::unique_ptr<Odometry> odometry_;
|
||||
};
|
||||
} // namespace eutobot
|
||||
} // namespace robotis
|
||||
#endif // EUTOBOT_NODE__DIFF_DRIVE_CONTROLLER_HPP_
|
|
@ -1,144 +0,0 @@
|
|||
// Copyright 2019 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.
|
||||
//
|
||||
// Author: Darby Lim
|
||||
|
||||
#ifndef EUTOBOT_NODE__DYNAMIXEL_SDK_WRAPPER_HPP_
|
||||
#define EUTOBOT_NODE__DYNAMIXEL_SDK_WRAPPER_HPP_
|
||||
|
||||
#include <rcutils/logging_macros.h>
|
||||
#include <dynamixel_sdk/dynamixel_sdk.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <chrono>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include <utility>
|
||||
|
||||
#define LOG_INFO RCUTILS_LOG_INFO_NAMED
|
||||
#define LOG_WARN RCUTILS_LOG_WARN_NAMED
|
||||
#define LOG_ERROR RCUTILS_LOG_ERROR_NAMED
|
||||
#define LOG_DEBUG RCUTILS_LOG_DEBUG_NAMED
|
||||
|
||||
#define READ_DATA_SIZE 200
|
||||
|
||||
namespace robotis
|
||||
{
|
||||
namespace eutobot
|
||||
{
|
||||
|
||||
|
||||
class DynamixelSDKWrapper
|
||||
{
|
||||
public:
|
||||
typedef struct
|
||||
{
|
||||
std::string usb_port;
|
||||
uint8_t id;
|
||||
int baud_rate;
|
||||
float protocol_version;
|
||||
} Device;
|
||||
|
||||
explicit DynamixelSDKWrapper(const Device & device);
|
||||
virtual ~DynamixelSDKWrapper();
|
||||
|
||||
template<typename DataByteT>
|
||||
DataByteT get_data_from_device(const uint16_t & addr, const uint16_t & length)
|
||||
{
|
||||
DataByteT data = 0;
|
||||
uint8_t * p_data = reinterpret_cast<uint8_t *>(&data);
|
||||
uint16_t index = addr - read_memory_.start_addr;
|
||||
|
||||
std::lock_guard<std::mutex> lock(read_data_mutex_);
|
||||
switch (length) {
|
||||
case 1:
|
||||
p_data[0] = read_memory_.data[index + 0];
|
||||
break;
|
||||
|
||||
case 2:
|
||||
p_data[0] = read_memory_.data[index + 0];
|
||||
p_data[1] = read_memory_.data[index + 1];
|
||||
break;
|
||||
|
||||
case 4:
|
||||
p_data[0] = read_memory_.data[index + 0];
|
||||
p_data[1] = read_memory_.data[index + 1];
|
||||
p_data[2] = read_memory_.data[index + 2];
|
||||
p_data[3] = read_memory_.data[index + 3];
|
||||
break;
|
||||
|
||||
default:
|
||||
p_data[0] = read_memory_.data[index + 0];
|
||||
break;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
bool set_data_to_device(
|
||||
const uint16_t & addr,
|
||||
const uint16_t & length,
|
||||
uint8_t * get_data,
|
||||
std::string * msg);
|
||||
|
||||
void init_read_memory(const uint16_t & start_addr, const uint16_t & length);
|
||||
void read_data_set();
|
||||
|
||||
bool is_connected_to_device();
|
||||
|
||||
private:
|
||||
bool init_dynamixel_sdk_handlers();
|
||||
|
||||
bool read_register(
|
||||
uint8_t id,
|
||||
uint16_t address,
|
||||
uint16_t length,
|
||||
uint8_t * data_basket,
|
||||
const char ** log = NULL);
|
||||
|
||||
bool write_register(
|
||||
uint8_t id,
|
||||
uint16_t address,
|
||||
uint16_t length,
|
||||
uint8_t * data,
|
||||
const char ** log = NULL);
|
||||
|
||||
dynamixel::PortHandler * portHandler_;
|
||||
dynamixel::PacketHandler * packetHandler_;
|
||||
|
||||
Device device_;
|
||||
|
||||
uint8_t read_data_[READ_DATA_SIZE] = {0, };
|
||||
uint8_t read_data_buffer_[READ_DATA_SIZE] = {0, };
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint16_t start_addr;
|
||||
uint16_t length;
|
||||
uint8_t * data;
|
||||
} Memory;
|
||||
|
||||
Memory read_memory_;
|
||||
|
||||
std::mutex sdk_mutex_;
|
||||
std::mutex read_data_mutex_;
|
||||
std::mutex write_data_mutex_;
|
||||
};
|
||||
} // namespace eutobot
|
||||
} // namespace robotis
|
||||
#endif // EUTOBOT_NODE__DYNAMIXEL_SDK_WRAPPER_HPP_
|
|
@ -1,117 +0,0 @@
|
|||
// Copyright 2019 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.
|
||||
//
|
||||
// Author: Darby Lim
|
||||
|
||||
#ifndef EUTOBOT_NODE__EUTOBOT_HPP_
|
||||
#define EUTOBOT_NODE__EUTOBOT_HPP_
|
||||
|
||||
#include <array>
|
||||
#include <chrono>
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
#include <queue>
|
||||
|
||||
#include <tf2_ros/transform_broadcaster.h>
|
||||
|
||||
#include <geometry_msgs/msg/twist.hpp>
|
||||
#include <nav_msgs/msg/odometry.hpp>
|
||||
#include <rclcpp/rclcpp.hpp>
|
||||
#include <sensor_msgs/msg/battery_state.hpp>
|
||||
#include <sensor_msgs/msg/imu.hpp>
|
||||
#include <sensor_msgs/msg/joint_state.hpp>
|
||||
#include <eutobot_msgs/msg/sensor_state.hpp>
|
||||
|
||||
#include "eutobot_node/control_table.hpp"
|
||||
#include "eutobot_node/devices/devices.hpp"
|
||||
#include "eutobot_node/devices/motor_power.hpp"
|
||||
#include "eutobot_node/devices/reset.hpp"
|
||||
#include "eutobot_node/devices/sound.hpp"
|
||||
#include "eutobot_node/dynamixel_sdk_wrapper.hpp"
|
||||
#include "eutobot_node/odometry.hpp"
|
||||
#include "eutobot_node/sensors/battery_state.hpp"
|
||||
#include "eutobot_node/sensors/imu.hpp"
|
||||
#include "eutobot_node/sensors/joint_state.hpp"
|
||||
#include "eutobot_node/sensors/sensor_state.hpp"
|
||||
#include "eutobot_node/sensors/sensors.hpp"
|
||||
|
||||
namespace robotis
|
||||
{
|
||||
namespace eutobot
|
||||
{
|
||||
extern const ControlTable extern_control_table;
|
||||
class EutoBot : public rclcpp::Node
|
||||
{
|
||||
public:
|
||||
typedef struct
|
||||
{
|
||||
float separation;
|
||||
float radius;
|
||||
} Wheels;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float profile_acceleration_constant;
|
||||
float profile_acceleration;
|
||||
} Motors;
|
||||
|
||||
explicit EutoBot(const std::string & usb_port);
|
||||
virtual ~EutoBot() {}
|
||||
|
||||
Wheels * get_wheels();
|
||||
Motors * get_motors();
|
||||
|
||||
private:
|
||||
void init_dynamixel_sdk_wrapper(const std::string & usb_port);
|
||||
void check_device_status();
|
||||
|
||||
void add_sensors();
|
||||
void add_devices();
|
||||
void add_motors();
|
||||
void add_wheels();
|
||||
|
||||
void run();
|
||||
|
||||
void publish_timer(const std::chrono::milliseconds timeout);
|
||||
void heartbeat_timer(const std::chrono::milliseconds timeout);
|
||||
|
||||
void cmd_vel_callback();
|
||||
void parameter_event_callback();
|
||||
|
||||
Wheels wheels_;
|
||||
Motors motors_;
|
||||
|
||||
std::shared_ptr<DynamixelSDKWrapper> dxl_sdk_wrapper_;
|
||||
|
||||
std::list<sensors::Sensors *> sensors_;
|
||||
std::map<std::string, devices::Devices *> devices_;
|
||||
|
||||
std::unique_ptr<Odometry> odom_;
|
||||
|
||||
rclcpp::Node::SharedPtr node_handle_;
|
||||
|
||||
rclcpp::TimerBase::SharedPtr publish_timer_;
|
||||
rclcpp::TimerBase::SharedPtr heartbeat_timer_;
|
||||
|
||||
rclcpp::Subscription<geometry_msgs::msg::Twist>::SharedPtr cmd_vel_sub_;
|
||||
|
||||
rclcpp::AsyncParametersClient::SharedPtr priv_parameters_client_;
|
||||
rclcpp::Subscription<rcl_interfaces::msg::ParameterEvent>::SharedPtr parameter_event_sub_;
|
||||
};
|
||||
} // namespace eutobot
|
||||
} // namespace robotis
|
||||
#endif // EUTOBOT_NODE__EUTOBOT_HPP_
|
|
@ -1,99 +0,0 @@
|
|||
// Copyright 2019 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.
|
||||
//
|
||||
// Author: Darby Lim
|
||||
|
||||
#ifndef EUTOBOT_NODE__ODOMETRY_HPP_
|
||||
#define EUTOBOT_NODE__ODOMETRY_HPP_
|
||||
|
||||
#include <array>
|
||||
#include <chrono>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include <message_filters/subscriber.h>
|
||||
#include <message_filters/sync_policies/approximate_time.h>
|
||||
#include <message_filters/synchronizer.h>
|
||||
#include <tf2_ros/transform_broadcaster.h>
|
||||
#include <tf2/LinearMath/Quaternion.h>
|
||||
|
||||
#include <geometry_msgs/msg/transform_stamped.hpp>
|
||||
#include <nav_msgs/msg/odometry.hpp>
|
||||
#include <rclcpp/rclcpp.hpp>
|
||||
#include <sensor_msgs/msg/imu.hpp>
|
||||
#include <sensor_msgs/msg/joint_state.hpp>
|
||||
|
||||
|
||||
namespace robotis
|
||||
{
|
||||
namespace eutobot
|
||||
{
|
||||
class Odometry
|
||||
{
|
||||
public:
|
||||
explicit Odometry(
|
||||
std::shared_ptr<rclcpp::Node> & nh,
|
||||
const double wheels_separation,
|
||||
const double wheels_radius);
|
||||
virtual ~Odometry() {}
|
||||
|
||||
private:
|
||||
bool calculate_odometry(const rclcpp::Duration & duration);
|
||||
|
||||
void update_imu(const std::shared_ptr<sensor_msgs::msg::Imu const> & imu);
|
||||
void update_joint_state(const std::shared_ptr<sensor_msgs::msg::JointState const> & joint_state);
|
||||
|
||||
void joint_state_callback(const sensor_msgs::msg::JointState::SharedPtr joint_state_msg);
|
||||
|
||||
void joint_state_and_imu_callback(
|
||||
const std::shared_ptr<sensor_msgs::msg::JointState const> & joint_state_msg,
|
||||
const std::shared_ptr<sensor_msgs::msg::Imu const> & imu_msg);
|
||||
|
||||
void publish(const rclcpp::Time & now);
|
||||
|
||||
std::shared_ptr<rclcpp::Node> nh_;
|
||||
std::unique_ptr<tf2_ros::TransformBroadcaster> tf_broadcaster_;
|
||||
|
||||
rclcpp::Publisher<nav_msgs::msg::Odometry>::SharedPtr odom_pub_;
|
||||
rclcpp::Subscription<sensor_msgs::msg::JointState>::SharedPtr joint_state_sub_;
|
||||
|
||||
std::shared_ptr<
|
||||
message_filters::Subscriber<sensor_msgs::msg::JointState>> msg_ftr_joint_state_sub_;
|
||||
std::shared_ptr<message_filters::Subscriber<sensor_msgs::msg::Imu>> msg_ftr_imu_sub_;
|
||||
|
||||
typedef message_filters::sync_policies::ApproximateTime<
|
||||
sensor_msgs::msg::JointState,
|
||||
sensor_msgs::msg::Imu> SyncPolicyJointStateImu;
|
||||
typedef message_filters::Synchronizer<SyncPolicyJointStateImu> SynchronizerJointStateImu;
|
||||
|
||||
std::shared_ptr<SynchronizerJointStateImu> joint_state_imu_sync_;
|
||||
|
||||
double wheels_separation_;
|
||||
double wheels_radius_;
|
||||
|
||||
std::string frame_id_of_odometry_;
|
||||
std::string child_frame_id_of_odometry_;
|
||||
|
||||
bool use_imu_;
|
||||
bool publish_tf_;
|
||||
|
||||
std::array<double, 2> diff_joint_positions_;
|
||||
double imu_angle_;
|
||||
|
||||
std::array<double, 3> robot_pose_;
|
||||
std::array<double, 3> robot_vel_;
|
||||
};
|
||||
} // namespace eutobot
|
||||
} // namespace robotis
|
||||
#endif // EUTOBOT_NODE__ODOMETRY_HPP_
|
|
@ -1,50 +0,0 @@
|
|||
// Copyright 2019 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.
|
||||
//
|
||||
// Author: Darby Lim
|
||||
|
||||
#ifndef EUTOBOT_NODE__SENSORS__BATTERY_STATE_HPP_
|
||||
#define EUTOBOT_NODE__SENSORS__BATTERY_STATE_HPP_
|
||||
|
||||
#include <sensor_msgs/msg/battery_state.hpp>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "eutobot_node/sensors/sensors.hpp"
|
||||
|
||||
namespace robotis
|
||||
{
|
||||
namespace eutobot
|
||||
{
|
||||
namespace sensors
|
||||
{
|
||||
class BatteryState : public Sensors
|
||||
{
|
||||
public:
|
||||
explicit BatteryState(
|
||||
std::shared_ptr<rclcpp::Node> & nh,
|
||||
const std::string & topic_name = "battery_state");
|
||||
|
||||
void publish(
|
||||
const rclcpp::Time & now,
|
||||
std::shared_ptr<DynamixelSDKWrapper> & dxl_sdk_wrapper) override;
|
||||
|
||||
private:
|
||||
rclcpp::Publisher<sensor_msgs::msg::BatteryState>::SharedPtr pub_;
|
||||
};
|
||||
} // namespace sensors
|
||||
} // namespace eutobot
|
||||
} // namespace robotis
|
||||
#endif // EUTOBOT_NODE__SENSORS__BATTERY_STATE_HPP_
|
|
@ -1,54 +0,0 @@
|
|||
// Copyright 2019 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.
|
||||
//
|
||||
// Author: Darby Lim
|
||||
|
||||
#ifndef EUTOBOT_NODE__SENSORS__IMU_HPP_
|
||||
#define EUTOBOT_NODE__SENSORS__IMU_HPP_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include <sensor_msgs/msg/imu.hpp>
|
||||
#include <sensor_msgs/msg/magnetic_field.hpp>
|
||||
|
||||
#include "eutobot_node/sensors/sensors.hpp"
|
||||
|
||||
namespace robotis
|
||||
{
|
||||
namespace eutobot
|
||||
{
|
||||
namespace sensors
|
||||
{
|
||||
class Imu : public Sensors
|
||||
{
|
||||
public:
|
||||
explicit Imu(
|
||||
std::shared_ptr<rclcpp::Node> & nh,
|
||||
const std::string & imu_topic_name = "imu",
|
||||
const std::string & mag_topic_name = "magnetic_field",
|
||||
const std::string & frame_id = "imu_link");
|
||||
|
||||
void publish(
|
||||
const rclcpp::Time & now,
|
||||
std::shared_ptr<DynamixelSDKWrapper> & dxl_sdk_wrapper) override;
|
||||
|
||||
private:
|
||||
rclcpp::Publisher<sensor_msgs::msg::Imu>::SharedPtr imu_pub_;
|
||||
rclcpp::Publisher<sensor_msgs::msg::MagneticField>::SharedPtr mag_pub_;
|
||||
};
|
||||
} // namespace sensors
|
||||
} // namespace eutobot
|
||||
} // namespace robotis
|
||||
#endif // EUTOBOT_NODE__SENSORS__IMU_HPP_
|
|
@ -1,59 +0,0 @@
|
|||
// Copyright 2019 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.
|
||||
//
|
||||
// Author: Darby Lim
|
||||
|
||||
#ifndef EUTOBOT_NODE__SENSORS__JOINT_STATE_HPP_
|
||||
#define EUTOBOT_NODE__SENSORS__JOINT_STATE_HPP_
|
||||
|
||||
#include <sensor_msgs/msg/joint_state.hpp>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "eutobot_node/sensors/sensors.hpp"
|
||||
|
||||
namespace robotis
|
||||
{
|
||||
namespace eutobot
|
||||
{
|
||||
namespace sensors
|
||||
{
|
||||
constexpr uint8_t JOINT_NUM = 2;
|
||||
|
||||
// ref) http://emanual.robotis.com/docs/en/dxl/x/xl430-w250/#goal-velocity104
|
||||
constexpr double RPM_TO_MS = 0.229 * 0.0034557519189487725;
|
||||
|
||||
// 0.087890625[deg] * 3.14159265359 / 180 = 0.001533981f
|
||||
constexpr double TICK_TO_RAD = 0.001533981;
|
||||
|
||||
class JointState : public Sensors
|
||||
{
|
||||
public:
|
||||
explicit JointState(
|
||||
std::shared_ptr<rclcpp::Node> & nh,
|
||||
const std::string & topic_name = "joint_states",
|
||||
const std::string & frame_id = "base_link");
|
||||
|
||||
void publish(
|
||||
const rclcpp::Time & now,
|
||||
std::shared_ptr<DynamixelSDKWrapper> & dxl_sdk_wrapper) override;
|
||||
|
||||
private:
|
||||
rclcpp::Publisher<sensor_msgs::msg::JointState>::SharedPtr pub_;
|
||||
};
|
||||
} // namespace sensors
|
||||
} // namespace eutobot
|
||||
} // namespace robotis
|
||||
#endif // EUTOBOT_NODE__SENSORS__JOINT_STATE_HPP_
|
|
@ -1,61 +0,0 @@
|
|||
// Copyright 2019 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.
|
||||
//
|
||||
// Author: Darby Lim
|
||||
|
||||
#ifndef EUTOBOT_NODE__SENSORS__SENSOR_STATE_HPP_
|
||||
#define EUTOBOT_NODE__SENSORS__SENSOR_STATE_HPP_
|
||||
|
||||
#include <eutobot_msgs/msg/sensor_state.hpp>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "eutobot_node/sensors/sensors.hpp"
|
||||
|
||||
namespace robotis
|
||||
{
|
||||
namespace eutobot
|
||||
{
|
||||
namespace sensors
|
||||
{
|
||||
class SensorState : public Sensors
|
||||
{
|
||||
public:
|
||||
explicit SensorState(
|
||||
std::shared_ptr<rclcpp::Node> & nh,
|
||||
const std::string & topic_name = "sensor_state",
|
||||
const uint8_t & bumper_forward = 0,
|
||||
const uint8_t & bumper_backward = 0,
|
||||
const uint8_t & illumination = 0,
|
||||
const uint8_t & cliff = 0,
|
||||
const uint8_t & sonar = 0);
|
||||
|
||||
void publish(
|
||||
const rclcpp::Time & now,
|
||||
std::shared_ptr<DynamixelSDKWrapper> & dxl_sdk_wrapper) override;
|
||||
|
||||
private:
|
||||
rclcpp::Publisher<eutobot_msgs::msg::SensorState>::SharedPtr pub_;
|
||||
|
||||
uint8_t bumper_forward_;
|
||||
uint8_t bumper_backward_;
|
||||
uint8_t illumination_;
|
||||
uint8_t cliff_;
|
||||
uint8_t sonar_;
|
||||
};
|
||||
} // namespace sensors
|
||||
} // namespace eutobot
|
||||
} // namespace robotis
|
||||
#endif // EUTOBOT_NODE__SENSORS__SENSOR_STATE_HPP_
|
|
@ -1,59 +0,0 @@
|
|||
// Copyright 2019 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.
|
||||
//
|
||||
// Author: Darby Lim
|
||||
|
||||
#ifndef EUTOBOT_NODE__SENSORS__SENSORS_HPP_
|
||||
#define EUTOBOT_NODE__SENSORS__SENSORS_HPP_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include <rclcpp/rclcpp.hpp>
|
||||
|
||||
#include "eutobot_node/control_table.hpp"
|
||||
#include "eutobot_node/dynamixel_sdk_wrapper.hpp"
|
||||
|
||||
namespace robotis
|
||||
{
|
||||
namespace eutobot
|
||||
{
|
||||
extern const ControlTable extern_control_table;
|
||||
namespace sensors
|
||||
{
|
||||
class Sensors
|
||||
{
|
||||
public:
|
||||
explicit Sensors(
|
||||
std::shared_ptr<rclcpp::Node> & nh,
|
||||
const std::string & frame_id = "")
|
||||
: nh_(nh),
|
||||
frame_id_(frame_id)
|
||||
{
|
||||
}
|
||||
|
||||
virtual void publish(
|
||||
const rclcpp::Time & now,
|
||||
std::shared_ptr<DynamixelSDKWrapper> & dxl_sdk_wrapper) = 0;
|
||||
|
||||
protected:
|
||||
std::shared_ptr<rclcpp::Node> nh_;
|
||||
std::string frame_id_;
|
||||
rclcpp::QoS qos_ = rclcpp::QoS(rclcpp::KeepLast(10));
|
||||
};
|
||||
} // namespace sensors
|
||||
} // namespace eutobot
|
||||
} // namespace robotis
|
||||
#endif // EUTOBOT_NODE__SENSORS__SENSORS_HPP_
|
|
@ -1,32 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||
<package format="3">
|
||||
<name>eutobot_node</name>
|
||||
<version>2.1.5</version>
|
||||
<description>
|
||||
Eutobot driver node that include diff drive controller, odometry and tf node
|
||||
</description>
|
||||
<maintainer email="ray@coasia.com">Ray Park</maintainer>
|
||||
<license>Apache 2.0</license>
|
||||
<url type="website">http://www.coasianexell.com/</url>
|
||||
<url type="repository">http://cnst.coasianexell.com:53000/robotics/eutobot</url>
|
||||
<url type="bugtracker">http://cnst.coasianexell.com:53000/issues</url>
|
||||
<author email="sw.jo@coasia.com">Biela Jo</author>
|
||||
<author email="emergency@coasia.com">Matt Lim</author>
|
||||
<buildtool_depend>ament_cmake</buildtool_depend>
|
||||
<depend>dynamixel_sdk</depend>
|
||||
<depend>geometry_msgs</depend>
|
||||
<depend>message_filters</depend>
|
||||
<depend>nav_msgs</depend>
|
||||
<depend>rclcpp</depend>
|
||||
<depend>rcutils</depend>
|
||||
<depend>sensor_msgs</depend>
|
||||
<depend>std_msgs</depend>
|
||||
<depend>std_srvs</depend>
|
||||
<depend>tf2</depend>
|
||||
<depend>tf2_ros</depend>
|
||||
<depend>eutobot_msgs</depend>
|
||||
<export>
|
||||
<build_type>ament_cmake</build_type>
|
||||
</export>
|
||||
</package>
|
|
@ -1,34 +0,0 @@
|
|||
eutobot_node:
|
||||
ros__parameters:
|
||||
|
||||
opencr:
|
||||
id: 200
|
||||
baud_rate: 1000000
|
||||
protocol_version: 2.0
|
||||
|
||||
wheels:
|
||||
separation: 0.287
|
||||
radius: 0.033
|
||||
|
||||
motors:
|
||||
profile_acceleration_constant: 214.577
|
||||
|
||||
# [rev/min2]
|
||||
# ref) http://emanual.robotis.com/docs/en/dxl/x/xl430-w250/#profile-acceleration
|
||||
profile_acceleration: 0.0
|
||||
|
||||
sensors:
|
||||
bumper_1: 0
|
||||
bumper_2: 0
|
||||
illumination: 0
|
||||
ir: 0
|
||||
sonar: 0
|
||||
|
||||
diff_drive_controller:
|
||||
ros__parameters:
|
||||
|
||||
odometry:
|
||||
publish_tf: true
|
||||
use_imu: true
|
||||
frame_id: "odom"
|
||||
child_frame_id: "base_footprint"
|
|
@ -1,60 +0,0 @@
|
|||
// Copyright 2019 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.
|
||||
//
|
||||
// Author: Darby Lim
|
||||
|
||||
#include "eutobot_node/devices/motor_power.hpp"
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
using robotis::eutobot::devices::MotorPower;
|
||||
|
||||
MotorPower::MotorPower(
|
||||
std::shared_ptr<rclcpp::Node> & nh,
|
||||
std::shared_ptr<DynamixelSDKWrapper> & dxl_sdk_wrapper,
|
||||
const std::string & server_name)
|
||||
: Devices(nh, dxl_sdk_wrapper)
|
||||
{
|
||||
RCLCPP_INFO(nh_->get_logger(), "Succeeded to create motor power server");
|
||||
srv_ = nh_->create_service<std_srvs::srv::SetBool>(
|
||||
server_name,
|
||||
[this](
|
||||
const std::shared_ptr<std_srvs::srv::SetBool::Request> request,
|
||||
std::shared_ptr<std_srvs::srv::SetBool::Response> response) -> void
|
||||
{
|
||||
this->command(static_cast<void *>(request.get()), static_cast<void *>(response.get()));
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
void MotorPower::command(const void * request, void * response)
|
||||
{
|
||||
std_srvs::srv::SetBool::Request req = *(std_srvs::srv::SetBool::Request *)request;
|
||||
std_srvs::srv::SetBool::Response * res = (std_srvs::srv::SetBool::Response *)response;
|
||||
|
||||
res->success = dxl_sdk_wrapper_->set_data_to_device(
|
||||
extern_control_table.motor_torque_enable.addr,
|
||||
extern_control_table.motor_torque_enable.length,
|
||||
reinterpret_cast<uint8_t *>(&req.data),
|
||||
&res->message);
|
||||
}
|
||||
|
||||
void MotorPower::request(
|
||||
rclcpp::Client<std_srvs::srv::SetBool>::SharedPtr client,
|
||||
std_srvs::srv::SetBool::Request req)
|
||||
{
|
||||
auto request = std::make_shared<std_srvs::srv::SetBool::Request>(req);
|
||||
auto result = client->async_send_request(request);
|
||||
}
|
|
@ -1,67 +0,0 @@
|
|||
// Copyright 2019 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.
|
||||
//
|
||||
// Author: Darby Lim
|
||||
|
||||
#include "eutobot_node/devices/reset.hpp"
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
using robotis::eutobot::devices::Reset;
|
||||
|
||||
Reset::Reset(
|
||||
std::shared_ptr<rclcpp::Node> & nh,
|
||||
std::shared_ptr<DynamixelSDKWrapper> & dxl_sdk_wrapper,
|
||||
const std::string & server_name)
|
||||
: Devices(nh, dxl_sdk_wrapper)
|
||||
{
|
||||
RCLCPP_INFO(nh_->get_logger(), "Succeeded to create reset server");
|
||||
srv_ = nh_->create_service<std_srvs::srv::Trigger>(
|
||||
server_name,
|
||||
[this](
|
||||
const std::shared_ptr<std_srvs::srv::Trigger::Request> request,
|
||||
std::shared_ptr<std_srvs::srv::Trigger::Response> response) -> void
|
||||
{
|
||||
this->command(static_cast<void *>(request.get()), static_cast<void *>(response.get()));
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
void Reset::command(const void * request, void * response)
|
||||
{
|
||||
(void) request;
|
||||
|
||||
std_srvs::srv::Trigger::Response * res = (std_srvs::srv::Trigger::Response *)response;
|
||||
|
||||
uint8_t reset = 1;
|
||||
|
||||
res->success = dxl_sdk_wrapper_->set_data_to_device(
|
||||
extern_control_table.imu_re_calibration.addr,
|
||||
extern_control_table.imu_re_calibration.length,
|
||||
&reset,
|
||||
&res->message);
|
||||
|
||||
RCLCPP_INFO(nh_->get_logger(), "Start Calibration of Gyro");
|
||||
rclcpp::sleep_for(std::chrono::seconds(5));
|
||||
RCLCPP_INFO(nh_->get_logger(), "Calibration End");
|
||||
}
|
||||
|
||||
void Reset::request(
|
||||
rclcpp::Client<std_srvs::srv::Trigger>::SharedPtr client,
|
||||
std_srvs::srv::Trigger::Request req)
|
||||
{
|
||||
auto request = std::make_shared<std_srvs::srv::Trigger::Request>(req);
|
||||
auto result = client->async_send_request(request);
|
||||
}
|
|
@ -1,60 +0,0 @@
|
|||
// Copyright 2019 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.
|
||||
//
|
||||
// Author: Darby Lim
|
||||
|
||||
#include "eutobot_node/devices/sound.hpp"
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
using robotis::eutobot::devices::Sound;
|
||||
|
||||
Sound::Sound(
|
||||
std::shared_ptr<rclcpp::Node> & nh,
|
||||
std::shared_ptr<DynamixelSDKWrapper> & dxl_sdk_wrapper,
|
||||
const std::string & server_name)
|
||||
: Devices(nh, dxl_sdk_wrapper)
|
||||
{
|
||||
RCLCPP_INFO(nh_->get_logger(), "Succeeded to create sound server");
|
||||
srv_ = nh_->create_service<eutobot_msgs::srv::Sound>(
|
||||
server_name,
|
||||
[this](
|
||||
const std::shared_ptr<eutobot_msgs::srv::Sound::Request> request,
|
||||
std::shared_ptr<eutobot_msgs::srv::Sound::Response> response) -> void
|
||||
{
|
||||
this->command(static_cast<void *>(request.get()), static_cast<void *>(response.get()));
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
void Sound::command(const void * request, void * response)
|
||||
{
|
||||
eutobot_msgs::srv::Sound::Request req = *(eutobot_msgs::srv::Sound::Request *)request;
|
||||
eutobot_msgs::srv::Sound::Response * res = (eutobot_msgs::srv::Sound::Response *)response;
|
||||
|
||||
res->success = dxl_sdk_wrapper_->set_data_to_device(
|
||||
extern_control_table.sound.addr,
|
||||
extern_control_table.sound.length,
|
||||
reinterpret_cast<uint8_t *>(&req.value),
|
||||
&res->message);
|
||||
}
|
||||
|
||||
void Sound::request(
|
||||
rclcpp::Client<eutobot_msgs::srv::Sound>::SharedPtr client,
|
||||
eutobot_msgs::srv::Sound::Request req)
|
||||
{
|
||||
auto request = std::make_shared<eutobot_msgs::srv::Sound::Request>(req);
|
||||
auto result = client->async_send_request(request);
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
// Copyright 2019 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.
|
||||
//
|
||||
// Author: Darby Lim
|
||||
|
||||
#include "eutobot_node/diff_drive_controller.hpp"
|
||||
|
||||
#include <memory>
|
||||
|
||||
using robotis::eutobot::DiffDriveController;
|
||||
|
||||
DiffDriveController::DiffDriveController(const float wheel_seperation, const float wheel_radius)
|
||||
: Node("diff_drive_controller", rclcpp::NodeOptions().use_intra_process_comms(true))
|
||||
{
|
||||
nh_ = std::shared_ptr<::rclcpp::Node>(this, [](::rclcpp::Node *) {});
|
||||
|
||||
odometry_ = std::make_unique<Odometry>(
|
||||
nh_,
|
||||
wheel_seperation,
|
||||
wheel_radius);
|
||||
|
||||
RCLCPP_INFO(this->get_logger(), "Run!");
|
||||
}
|
|
@ -1,182 +0,0 @@
|
|||
// Copyright 2019 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.
|
||||
//
|
||||
// Author: Darby Lim
|
||||
|
||||
#include "eutobot_node/dynamixel_sdk_wrapper.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <string>
|
||||
|
||||
using robotis::eutobot::DynamixelSDKWrapper;
|
||||
|
||||
DynamixelSDKWrapper::DynamixelSDKWrapper(const Device & device)
|
||||
: device_(device)
|
||||
{
|
||||
if (init_dynamixel_sdk_handlers() == false) {
|
||||
LOG_ERROR("DynamixelSDKWrapper", "Failed to initialize SDK handlers");
|
||||
return;
|
||||
} else {
|
||||
LOG_DEBUG("DynamixelSDKWrapper", "Success to initilize SDK handlers");
|
||||
}
|
||||
}
|
||||
|
||||
DynamixelSDKWrapper::~DynamixelSDKWrapper()
|
||||
{
|
||||
portHandler_->closePort();
|
||||
}
|
||||
|
||||
bool DynamixelSDKWrapper::is_connected_to_device()
|
||||
{
|
||||
uint8_t data[2];
|
||||
return this->read_register(device_.id, 0, 2, &data[0]);
|
||||
}
|
||||
|
||||
void DynamixelSDKWrapper::init_read_memory(const uint16_t & start_addr, const uint16_t & length)
|
||||
{
|
||||
read_memory_.start_addr = start_addr;
|
||||
read_memory_.length = length;
|
||||
read_memory_.data = &read_data_[0];
|
||||
}
|
||||
|
||||
void DynamixelSDKWrapper::read_data_set()
|
||||
{
|
||||
const char * log = NULL;
|
||||
bool ret = this->read_register(
|
||||
device_.id,
|
||||
read_memory_.start_addr,
|
||||
read_memory_.length,
|
||||
&read_data_buffer_[0],
|
||||
&log);
|
||||
|
||||
if (ret == false) {
|
||||
LOG_ERROR("DynamixelSDKWrapper", "Failed to read[%s]", log);
|
||||
} else {
|
||||
std::lock_guard<std::mutex> lock(read_data_mutex_);
|
||||
std::copy(read_data_buffer_, read_data_buffer_ + READ_DATA_SIZE, read_data_);
|
||||
LOG_DEBUG("DynamixelSDKWrapper", "Succeeded to read");
|
||||
}
|
||||
}
|
||||
|
||||
bool DynamixelSDKWrapper::set_data_to_device(
|
||||
const uint16_t & addr,
|
||||
const uint16_t & length,
|
||||
uint8_t * get_data,
|
||||
std::string * msg)
|
||||
{
|
||||
const char * log = nullptr;
|
||||
bool ret = false;
|
||||
|
||||
std::lock_guard<std::mutex> lock(write_data_mutex_);
|
||||
ret = write_register(device_.id, addr, length, get_data, &log);
|
||||
|
||||
if (ret == true) {
|
||||
*msg = "Succeeded to write data";
|
||||
return true;
|
||||
} else {
|
||||
*msg = "Failed to write data" + std::string(log);
|
||||
return false;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool DynamixelSDKWrapper::init_dynamixel_sdk_handlers()
|
||||
{
|
||||
portHandler_ = dynamixel::PortHandler::getPortHandler(device_.usb_port.c_str());
|
||||
packetHandler_ =
|
||||
dynamixel::PacketHandler::getPacketHandler(static_cast<int>(device_.protocol_version));
|
||||
|
||||
if (portHandler_->openPort()) {
|
||||
LOG_INFO("DynamixelSDKWrapper", "Succeeded to open the port(%s)!", device_.usb_port.c_str());
|
||||
} else {
|
||||
LOG_ERROR("DynamixelSDKWrapper", "Failed to open the port(%s)!", device_.usb_port.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
if (portHandler_->setBaudRate(static_cast<int>(device_.baud_rate))) {
|
||||
LOG_INFO("DynamixelSDKWrapper", "Succeeded to change the baudrate!");
|
||||
} else {
|
||||
LOG_ERROR("DynamixelSDKWrapper", "Failed to change the baudrate(%d)!", device_.baud_rate);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DynamixelSDKWrapper::read_register(
|
||||
uint8_t id,
|
||||
uint16_t address,
|
||||
uint16_t length,
|
||||
uint8_t * data_basket,
|
||||
const char ** log)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(sdk_mutex_);
|
||||
|
||||
int32_t dxl_comm_result = COMM_RX_FAIL;
|
||||
uint8_t dxl_error = 0;
|
||||
|
||||
dxl_comm_result = packetHandler_->readTxRx(
|
||||
portHandler_,
|
||||
id,
|
||||
address,
|
||||
length,
|
||||
data_basket,
|
||||
&dxl_error);
|
||||
|
||||
if (dxl_comm_result != COMM_SUCCESS) {
|
||||
if (log != NULL) {*log = packetHandler_->getTxRxResult(dxl_comm_result);}
|
||||
return false;
|
||||
} else if (dxl_error != 0) {
|
||||
if (log != NULL) {*log = packetHandler_->getRxPacketError(dxl_error);}
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DynamixelSDKWrapper::write_register(
|
||||
uint8_t id,
|
||||
uint16_t address,
|
||||
uint16_t length,
|
||||
uint8_t * data,
|
||||
const char ** log)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(sdk_mutex_);
|
||||
|
||||
int32_t dxl_comm_result = COMM_TX_FAIL;
|
||||
uint8_t dxl_error = 0;
|
||||
|
||||
dxl_comm_result = packetHandler_->writeTxRx(
|
||||
portHandler_,
|
||||
id,
|
||||
address,
|
||||
length,
|
||||
data,
|
||||
&dxl_error);
|
||||
|
||||
if (dxl_comm_result != COMM_SUCCESS) {
|
||||
if (log != NULL) {*log = packetHandler_->getTxRxResult(dxl_comm_result);}
|
||||
return false;
|
||||
} else if (dxl_error != 0) {
|
||||
if (log != NULL) {*log = packetHandler_->getRxPacketError(dxl_error);}
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
|
@ -1,368 +0,0 @@
|
|||
// Copyright 2019 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.
|
||||
//
|
||||
// Author: Darby Lim
|
||||
|
||||
#include "eutobot_node/eutobot.hpp"
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
using robotis::eutobot::EutoBot;
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
EutoBot::EutoBot(const std::string &usb_port)
|
||||
: Node("eutobot_node", rclcpp::NodeOptions().use_intra_process_comms(true))
|
||||
{
|
||||
RCLCPP_INFO(get_logger(), "Init EutoBot Node Main");
|
||||
node_handle_ = std::shared_ptr<::rclcpp::Node>(this, [](::rclcpp::Node *) {});
|
||||
|
||||
// init_dynamixel_sdk_wrapper(usb_port);
|
||||
// check_device_status();
|
||||
|
||||
// add_motors();
|
||||
// add_wheels();
|
||||
// add_sensors();
|
||||
// add_devices();
|
||||
|
||||
run();
|
||||
}
|
||||
|
||||
EutoBot::Wheels *EutoBot::get_wheels()
|
||||
{
|
||||
return &wheels_;
|
||||
}
|
||||
|
||||
EutoBot::Motors *EutoBot::get_motors()
|
||||
{
|
||||
return &motors_;
|
||||
}
|
||||
|
||||
void EutoBot::init_dynamixel_sdk_wrapper(const std::string &usb_port)
|
||||
{
|
||||
DynamixelSDKWrapper::Device opencr = {usb_port, 200, 1000000, 2.0f};
|
||||
|
||||
this->declare_parameter<uint8_t>("opencr.id");
|
||||
this->declare_parameter<int>("opencr.baud_rate");
|
||||
this->declare_parameter<float>("opencr.protocol_version");
|
||||
|
||||
this->get_parameter_or<uint8_t>("opencr.id", opencr.id, 200);
|
||||
this->get_parameter_or<int>("opencr.baud_rate", opencr.baud_rate, 1000000);
|
||||
this->get_parameter_or<float>("opencr.protocol_version", opencr.protocol_version, 2.0f);
|
||||
|
||||
RCLCPP_INFO(this->get_logger(), "Init DynamixelSDKWrapper");
|
||||
|
||||
dxl_sdk_wrapper_ = std::make_shared<DynamixelSDKWrapper>(opencr);
|
||||
|
||||
dxl_sdk_wrapper_->init_read_memory(
|
||||
extern_control_table.millis.addr,
|
||||
(extern_control_table.profile_acceleration_right.addr - extern_control_table.millis.addr) +
|
||||
extern_control_table.profile_acceleration_right.length);
|
||||
}
|
||||
|
||||
void EutoBot::check_device_status()
|
||||
{
|
||||
if (dxl_sdk_wrapper_->is_connected_to_device())
|
||||
{
|
||||
std::string sdk_msg;
|
||||
uint8_t reset = 1;
|
||||
|
||||
dxl_sdk_wrapper_->set_data_to_device(
|
||||
extern_control_table.imu_re_calibration.addr,
|
||||
extern_control_table.imu_re_calibration.length,
|
||||
&reset,
|
||||
&sdk_msg);
|
||||
|
||||
RCLCPP_INFO(this->get_logger(), "Start Calibration of Gyro");
|
||||
rclcpp::sleep_for(std::chrono::seconds(5));
|
||||
RCLCPP_INFO(this->get_logger(), "Calibration End");
|
||||
}
|
||||
else
|
||||
{
|
||||
RCLCPP_ERROR(this->get_logger(), "Failed connection with Devices");
|
||||
rclcpp::shutdown();
|
||||
return;
|
||||
}
|
||||
|
||||
const int8_t NOT_CONNECTED_MOTOR = -1;
|
||||
|
||||
int8_t device_status = dxl_sdk_wrapper_->get_data_from_device<int8_t>(
|
||||
extern_control_table.device_status.addr,
|
||||
extern_control_table.device_status.length);
|
||||
|
||||
switch (device_status)
|
||||
{
|
||||
case NOT_CONNECTED_MOTOR:
|
||||
RCLCPP_WARN(this->get_logger(), "Please double check your Dynamixels and Power");
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void EutoBot::add_motors()
|
||||
{
|
||||
RCLCPP_INFO(this->get_logger(), "Add Motors");
|
||||
|
||||
this->declare_parameter<float>("motors.profile_acceleration_constant");
|
||||
this->declare_parameter<float>("motors.profile_acceleration");
|
||||
|
||||
this->get_parameter_or<float>(
|
||||
"motors.profile_acceleration_constant",
|
||||
motors_.profile_acceleration_constant,
|
||||
214.577);
|
||||
|
||||
this->get_parameter_or<float>(
|
||||
"motors.profile_acceleration",
|
||||
motors_.profile_acceleration,
|
||||
0.0);
|
||||
}
|
||||
|
||||
void EutoBot::add_wheels()
|
||||
{
|
||||
RCLCPP_INFO(this->get_logger(), "Add Wheels");
|
||||
|
||||
this->declare_parameter<float>("wheels.separation");
|
||||
this->declare_parameter<float>("wheels.radius");
|
||||
|
||||
this->get_parameter_or<float>("wheels.separation", wheels_.separation, 0.160);
|
||||
this->get_parameter_or<float>("wheels.radius", wheels_.radius, 0.033);
|
||||
}
|
||||
|
||||
void EutoBot::add_sensors()
|
||||
{
|
||||
RCLCPP_INFO(this->get_logger(), "Add Sensors");
|
||||
|
||||
uint8_t is_connected_bumper_1 = 0;
|
||||
uint8_t is_connected_bumper_2 = 0;
|
||||
uint8_t is_connected_illumination = 0;
|
||||
uint8_t is_connected_ir = 0;
|
||||
uint8_t is_connected_sonar = 0;
|
||||
|
||||
this->declare_parameter<uint8_t>("sensors.bumper_1");
|
||||
this->declare_parameter<uint8_t>("sensors.bumper_2");
|
||||
this->declare_parameter<uint8_t>("sensors.illumination");
|
||||
this->declare_parameter<uint8_t>("sensors.ir");
|
||||
this->declare_parameter<uint8_t>("sensors.sonar");
|
||||
|
||||
this->get_parameter_or<uint8_t>(
|
||||
"sensors.bumper_1",
|
||||
is_connected_bumper_1,
|
||||
0);
|
||||
this->get_parameter_or<uint8_t>(
|
||||
"sensors.bumper_2",
|
||||
is_connected_bumper_2,
|
||||
0);
|
||||
this->get_parameter_or<uint8_t>(
|
||||
"sensors.illumination",
|
||||
is_connected_illumination,
|
||||
0);
|
||||
this->get_parameter_or<uint8_t>(
|
||||
"sensors.ir",
|
||||
is_connected_ir,
|
||||
0);
|
||||
this->get_parameter_or<uint8_t>(
|
||||
"sensors.sonar",
|
||||
is_connected_sonar,
|
||||
0);
|
||||
|
||||
sensors_.push_back(
|
||||
new sensors::BatteryState(
|
||||
node_handle_,
|
||||
"battery_state"));
|
||||
|
||||
sensors_.push_back(
|
||||
new sensors::Imu(
|
||||
node_handle_,
|
||||
"imu",
|
||||
"magnetic_field",
|
||||
"imu_link"));
|
||||
|
||||
sensors_.push_back(
|
||||
new sensors::SensorState(
|
||||
node_handle_,
|
||||
"sensor_state",
|
||||
is_connected_bumper_1,
|
||||
is_connected_bumper_2,
|
||||
is_connected_illumination,
|
||||
is_connected_ir,
|
||||
is_connected_sonar));
|
||||
|
||||
sensors_.push_back(new sensors::JointState(node_handle_, "joint_states", "base_link"));
|
||||
}
|
||||
|
||||
void EutoBot::add_devices()
|
||||
{
|
||||
RCLCPP_INFO(this->get_logger(), "Add Devices");
|
||||
devices_["motor_power"] =
|
||||
new devices::MotorPower(node_handle_, dxl_sdk_wrapper_, "motor_power");
|
||||
devices_["reset"] =
|
||||
new devices::Reset(node_handle_, dxl_sdk_wrapper_, "reset");
|
||||
devices_["sound"] =
|
||||
new devices::Sound(node_handle_, dxl_sdk_wrapper_, "sound");
|
||||
}
|
||||
|
||||
void EutoBot::run()
|
||||
{
|
||||
RCLCPP_INFO(this->get_logger(), "Run!");
|
||||
|
||||
publish_timer(std::chrono::milliseconds(50));
|
||||
heartbeat_timer(std::chrono::milliseconds(100));
|
||||
|
||||
parameter_event_callback();
|
||||
cmd_vel_callback();
|
||||
}
|
||||
|
||||
void EutoBot::publish_timer(const std::chrono::milliseconds timeout)
|
||||
{
|
||||
publish_timer_ = this->create_wall_timer(
|
||||
timeout,
|
||||
[this]() -> void
|
||||
{
|
||||
rclcpp::Time now = this->now();
|
||||
|
||||
dxl_sdk_wrapper_->read_data_set();
|
||||
|
||||
for (const auto &sensor : sensors_)
|
||||
{
|
||||
sensor->publish(now, dxl_sdk_wrapper_);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void EutoBot::heartbeat_timer(const std::chrono::milliseconds timeout)
|
||||
{
|
||||
heartbeat_timer_ = this->create_wall_timer(
|
||||
timeout,
|
||||
[this]() -> void
|
||||
{
|
||||
static uint8_t count = 0;
|
||||
std::string msg;
|
||||
|
||||
dxl_sdk_wrapper_->set_data_to_device(
|
||||
extern_control_table.heartbeat.addr,
|
||||
extern_control_table.heartbeat.length,
|
||||
&count,
|
||||
&msg);
|
||||
|
||||
RCLCPP_DEBUG(this->get_logger(), "hearbeat count : %d, msg : %s", count, msg.c_str());
|
||||
|
||||
count++;
|
||||
});
|
||||
}
|
||||
|
||||
void EutoBot::parameter_event_callback()
|
||||
{
|
||||
priv_parameters_client_ = std::make_shared<rclcpp::AsyncParametersClient>(this);
|
||||
while (!priv_parameters_client_->wait_for_service(std::chrono::seconds(1)))
|
||||
{
|
||||
if (!rclcpp::ok())
|
||||
{
|
||||
RCLCPP_ERROR(this->get_logger(), "Interrupted while waiting for the service. Exiting.");
|
||||
return;
|
||||
}
|
||||
|
||||
RCLCPP_WARN(this->get_logger(), "service not available, waiting again...");
|
||||
}
|
||||
|
||||
auto param_event_callback =
|
||||
[this](const rcl_interfaces::msg::ParameterEvent::SharedPtr event) -> void
|
||||
{
|
||||
for (const auto &changed_parameter : event->changed_parameters)
|
||||
{
|
||||
RCLCPP_DEBUG(
|
||||
this->get_logger(),
|
||||
"changed parameter name : %s",
|
||||
changed_parameter.name.c_str());
|
||||
|
||||
if (changed_parameter.name == "motors.profile_acceleration")
|
||||
{
|
||||
std::string sdk_msg;
|
||||
|
||||
motors_.profile_acceleration =
|
||||
rclcpp::Parameter::from_parameter_msg(changed_parameter).as_double();
|
||||
|
||||
motors_.profile_acceleration =
|
||||
motors_.profile_acceleration / motors_.profile_acceleration_constant;
|
||||
|
||||
union Data
|
||||
{
|
||||
int32_t dword[2];
|
||||
uint8_t byte[4 * 2];
|
||||
} data;
|
||||
|
||||
data.dword[0] = static_cast<int32_t>(motors_.profile_acceleration);
|
||||
data.dword[1] = static_cast<int32_t>(motors_.profile_acceleration);
|
||||
|
||||
uint16_t start_addr = extern_control_table.profile_acceleration_left.addr;
|
||||
uint16_t addr_length =
|
||||
(extern_control_table.profile_acceleration_right.addr -
|
||||
extern_control_table.profile_acceleration_left.addr) +
|
||||
extern_control_table.profile_acceleration_right.length;
|
||||
|
||||
uint8_t *p_data = &data.byte[0];
|
||||
|
||||
dxl_sdk_wrapper_->set_data_to_device(start_addr, addr_length, p_data, &sdk_msg);
|
||||
|
||||
RCLCPP_INFO(
|
||||
this->get_logger(),
|
||||
"changed parameter value : %f [rev/min2] sdk_msg : %s",
|
||||
motors_.profile_acceleration,
|
||||
sdk_msg.c_str());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
parameter_event_sub_ = priv_parameters_client_->on_parameter_event(param_event_callback);
|
||||
}
|
||||
|
||||
void EutoBot::cmd_vel_callback()
|
||||
{
|
||||
auto qos = rclcpp::QoS(rclcpp::KeepLast(10));
|
||||
cmd_vel_sub_ = this->create_subscription<geometry_msgs::msg::Twist>(
|
||||
"cmd_vel",
|
||||
qos,
|
||||
[this](const geometry_msgs::msg::Twist::SharedPtr msg) -> void
|
||||
{
|
||||
std::string sdk_msg;
|
||||
|
||||
union Data
|
||||
{
|
||||
int32_t dword[6];
|
||||
uint8_t byte[4 * 6];
|
||||
} data;
|
||||
|
||||
data.dword[0] = static_cast<int32_t>(msg->linear.x * 100);
|
||||
data.dword[1] = 0;
|
||||
data.dword[2] = 0;
|
||||
data.dword[3] = 0;
|
||||
data.dword[4] = 0;
|
||||
data.dword[5] = static_cast<int32_t>(msg->angular.z * 100);
|
||||
|
||||
uint16_t start_addr = extern_control_table.cmd_velocity_linear_x.addr;
|
||||
uint16_t addr_length =
|
||||
(extern_control_table.cmd_velocity_angular_z.addr -
|
||||
extern_control_table.cmd_velocity_linear_x.addr) +
|
||||
extern_control_table.cmd_velocity_angular_z.length;
|
||||
|
||||
uint8_t *p_data = &data.byte[0];
|
||||
|
||||
dxl_sdk_wrapper_->set_data_to_device(start_addr, addr_length, p_data, &sdk_msg);
|
||||
|
||||
RCLCPP_DEBUG(
|
||||
this->get_logger(),
|
||||
"lin_vel: %f ang_vel: %f msg : %s", msg->linear.x, msg->angular.z, sdk_msg.c_str());
|
||||
});
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
// Copyright 2019 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.
|
||||
//
|
||||
// Author: Darby Lim
|
||||
|
||||
#include <chrono>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include <rcutils/cmdline_parser.h>
|
||||
#include <rclcpp/rclcpp.hpp>
|
||||
|
||||
#include "eutobot_node/diff_drive_controller.hpp"
|
||||
#include "eutobot_node/eutobot.hpp"
|
||||
|
||||
void help_print()
|
||||
{
|
||||
printf("For eutobot node : \n");
|
||||
printf("eutobot_node [-i usb_port] [-h]\n");
|
||||
printf("options:\n");
|
||||
printf("-h : Print this help function.\n");
|
||||
printf("-i usb_port: Connected USB port with OpenCR.");
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
setvbuf(stdout, NULL, _IONBF, BUFSIZ);
|
||||
|
||||
if (rcutils_cli_option_exist(argv, argv + argc, "-h"))
|
||||
{
|
||||
help_print();
|
||||
return 0;
|
||||
}
|
||||
|
||||
rclcpp::init(argc, argv);
|
||||
// Dynmixel Port
|
||||
std::string usb_port = "/dev/ttyUSB0";
|
||||
char *cli_options;
|
||||
cli_options = rcutils_cli_get_option(argv, argv + argc, "-i");
|
||||
if (nullptr != cli_options)
|
||||
{
|
||||
usb_port = std::string(cli_options);
|
||||
}
|
||||
|
||||
rclcpp::executors::SingleThreadedExecutor executor;
|
||||
|
||||
auto eutobot = std::make_shared<robotis::eutobot::EutoBot>(usb_port);
|
||||
auto diff_drive_controller =
|
||||
std::make_shared<robotis::eutobot::DiffDriveController>(
|
||||
eutobot->get_wheels()->separation,
|
||||
eutobot->get_wheels()->radius);
|
||||
|
||||
executor.add_node(eutobot);
|
||||
executor.add_node(diff_drive_controller);
|
||||
executor.spin();
|
||||
|
||||
rclcpp::shutdown();
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,277 +0,0 @@
|
|||
// Copyright 2019 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.
|
||||
//
|
||||
// Author: Darby Lim
|
||||
|
||||
#include "eutobot_node/odometry.hpp"
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
using robotis::eutobot::Odometry;
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
Odometry::Odometry(
|
||||
std::shared_ptr<rclcpp::Node> & nh,
|
||||
const double wheels_separation,
|
||||
const double wheels_radius)
|
||||
: nh_(nh),
|
||||
wheels_separation_(wheels_separation),
|
||||
wheels_radius_(wheels_radius),
|
||||
use_imu_(false),
|
||||
publish_tf_(false),
|
||||
imu_angle_(0.0f)
|
||||
{
|
||||
RCLCPP_INFO(nh_->get_logger(), "Init Odometry");
|
||||
|
||||
nh_->declare_parameter<std::string>("odometry.frame_id");
|
||||
nh_->declare_parameter<std::string>("odometry.child_frame_id");
|
||||
|
||||
nh_->declare_parameter<bool>("odometry.use_imu");
|
||||
nh_->declare_parameter<bool>("odometry.publish_tf");
|
||||
|
||||
nh_->get_parameter_or<bool>(
|
||||
"odometry.use_imu",
|
||||
use_imu_,
|
||||
false);
|
||||
|
||||
nh_->get_parameter_or<bool>(
|
||||
"odometry.publish_tf",
|
||||
publish_tf_,
|
||||
false);
|
||||
|
||||
nh_->get_parameter_or<std::string>(
|
||||
"odometry.frame_id",
|
||||
frame_id_of_odometry_,
|
||||
std::string("odom"));
|
||||
|
||||
nh_->get_parameter_or<std::string>(
|
||||
"odometry.child_frame_id",
|
||||
child_frame_id_of_odometry_,
|
||||
std::string("base_footprint"));
|
||||
|
||||
auto qos = rclcpp::QoS(rclcpp::KeepLast(10));
|
||||
odom_pub_ = nh_->create_publisher<nav_msgs::msg::Odometry>("odom", qos);
|
||||
|
||||
tf_broadcaster_ = std::make_unique<tf2_ros::TransformBroadcaster>(nh_);
|
||||
|
||||
if (use_imu_) {
|
||||
uint32_t queue_size = 10;
|
||||
joint_state_imu_sync_ = std::make_shared<SynchronizerJointStateImu>(queue_size);
|
||||
|
||||
msg_ftr_joint_state_sub_ =
|
||||
std::make_shared<message_filters::Subscriber<sensor_msgs::msg::JointState>>(
|
||||
nh_,
|
||||
"joint_states");
|
||||
|
||||
msg_ftr_imu_sub_ =
|
||||
std::make_shared<message_filters::Subscriber<sensor_msgs::msg::Imu>>(
|
||||
nh_,
|
||||
"imu");
|
||||
|
||||
// connect message filters to synchronizer
|
||||
joint_state_imu_sync_->connectInput(*msg_ftr_joint_state_sub_, *msg_ftr_imu_sub_);
|
||||
|
||||
joint_state_imu_sync_->setInterMessageLowerBound(
|
||||
0,
|
||||
rclcpp::Duration(75ms));
|
||||
|
||||
joint_state_imu_sync_->setInterMessageLowerBound(
|
||||
1,
|
||||
rclcpp::Duration(15ms));
|
||||
|
||||
joint_state_imu_sync_->registerCallback(
|
||||
std::bind(
|
||||
&Odometry::joint_state_and_imu_callback,
|
||||
this,
|
||||
std::placeholders::_1,
|
||||
std::placeholders::_2));
|
||||
} else {
|
||||
joint_state_sub_ = nh_->create_subscription<sensor_msgs::msg::JointState>(
|
||||
"joint_states",
|
||||
qos,
|
||||
std::bind(&Odometry::joint_state_callback, this, std::placeholders::_1));
|
||||
}
|
||||
}
|
||||
|
||||
void Odometry::joint_state_callback(const sensor_msgs::msg::JointState::SharedPtr joint_state_msg)
|
||||
{
|
||||
static rclcpp::Time last_time = joint_state_msg->header.stamp;
|
||||
rclcpp::Duration duration(rclcpp::Duration::from_nanoseconds(
|
||||
joint_state_msg->header.stamp.nanosec - last_time.nanoseconds()));
|
||||
|
||||
update_joint_state(joint_state_msg);
|
||||
calculate_odometry(duration);
|
||||
publish(joint_state_msg->header.stamp);
|
||||
|
||||
last_time = joint_state_msg->header.stamp;
|
||||
}
|
||||
|
||||
void Odometry::joint_state_and_imu_callback(
|
||||
const std::shared_ptr<sensor_msgs::msg::JointState const> & joint_state_msg,
|
||||
const std::shared_ptr<sensor_msgs::msg::Imu const> & imu_msg)
|
||||
{
|
||||
RCLCPP_DEBUG(
|
||||
nh_->get_logger(),
|
||||
"[joint_state_msg_] nanosec : %d [imu_msg] nanosec : %d",
|
||||
joint_state_msg->header.stamp.nanosec,
|
||||
imu_msg->header.stamp.nanosec);
|
||||
|
||||
static rclcpp::Time last_time = joint_state_msg->header.stamp;
|
||||
rclcpp::Duration duration(rclcpp::Duration::from_nanoseconds(
|
||||
joint_state_msg->header.stamp.nanosec - last_time.nanoseconds()));
|
||||
|
||||
update_joint_state(joint_state_msg);
|
||||
update_imu(imu_msg);
|
||||
calculate_odometry(duration);
|
||||
publish(joint_state_msg->header.stamp);
|
||||
|
||||
last_time = joint_state_msg->header.stamp;
|
||||
}
|
||||
|
||||
void Odometry::publish(const rclcpp::Time & now)
|
||||
{
|
||||
auto odom_msg = std::make_unique<nav_msgs::msg::Odometry>();
|
||||
|
||||
odom_msg->header.frame_id = frame_id_of_odometry_;
|
||||
odom_msg->child_frame_id = child_frame_id_of_odometry_;
|
||||
odom_msg->header.stamp = now;
|
||||
|
||||
odom_msg->pose.pose.position.x = robot_pose_[0];
|
||||
odom_msg->pose.pose.position.y = robot_pose_[1];
|
||||
odom_msg->pose.pose.position.z = 0;
|
||||
|
||||
tf2::Quaternion q;
|
||||
q.setRPY(0.0, 0.0, robot_pose_[2]);
|
||||
|
||||
odom_msg->pose.pose.orientation.x = q.x();
|
||||
odom_msg->pose.pose.orientation.y = q.y();
|
||||
odom_msg->pose.pose.orientation.z = q.z();
|
||||
odom_msg->pose.pose.orientation.w = q.w();
|
||||
|
||||
odom_msg->twist.twist.linear.x = robot_vel_[0];
|
||||
odom_msg->twist.twist.angular.z = robot_vel_[2];
|
||||
|
||||
// TODO(Will Son): Find more accurate covariance.
|
||||
// odom_msg->pose.covariance[0] = 0.05;
|
||||
// odom_msg->pose.covariance[7] = 0.05;
|
||||
// odom_msg->pose.covariance[14] = 1.0e-9;
|
||||
// odom_msg->pose.covariance[21] = 1.0e-9;
|
||||
// odom_msg->pose.covariance[28] = 1.0e-9;
|
||||
// odom_msg->pose.covariance[35] = 0.0872665;
|
||||
|
||||
// odom_msg->twist.covariance[0] = 0.001;
|
||||
// odom_msg->twist.covariance[7] = 1.0e-9;
|
||||
// odom_msg->twist.covariance[14] = 1.0e-9;
|
||||
// odom_msg->twist.covariance[21] = 1.0e-9;
|
||||
// odom_msg->twist.covariance[28] = 1.0e-9;
|
||||
// odom_msg->twist.covariance[35] = 0.001;
|
||||
|
||||
geometry_msgs::msg::TransformStamped odom_tf;
|
||||
|
||||
odom_tf.transform.translation.x = odom_msg->pose.pose.position.x;
|
||||
odom_tf.transform.translation.y = odom_msg->pose.pose.position.y;
|
||||
odom_tf.transform.translation.z = odom_msg->pose.pose.position.z;
|
||||
odom_tf.transform.rotation = odom_msg->pose.pose.orientation;
|
||||
|
||||
odom_tf.header.frame_id = frame_id_of_odometry_;
|
||||
odom_tf.child_frame_id = child_frame_id_of_odometry_;
|
||||
odom_tf.header.stamp = now;
|
||||
|
||||
odom_pub_->publish(std::move(odom_msg));
|
||||
|
||||
if (publish_tf_) {
|
||||
tf_broadcaster_->sendTransform(odom_tf);
|
||||
}
|
||||
}
|
||||
|
||||
void Odometry::update_joint_state(
|
||||
const std::shared_ptr<sensor_msgs::msg::JointState const> & joint_state)
|
||||
{
|
||||
static std::array<double, 2> last_joint_positions = {0.0f, 0.0f};
|
||||
|
||||
diff_joint_positions_[0] = joint_state->position[0] - last_joint_positions[0];
|
||||
diff_joint_positions_[1] = joint_state->position[1] - last_joint_positions[1];
|
||||
|
||||
last_joint_positions[0] = joint_state->position[0];
|
||||
last_joint_positions[1] = joint_state->position[1];
|
||||
}
|
||||
|
||||
void Odometry::update_imu(const std::shared_ptr<sensor_msgs::msg::Imu const> & imu)
|
||||
{
|
||||
imu_angle_ = atan2f(
|
||||
imu->orientation.x * imu->orientation.y + imu->orientation.w * imu->orientation.z,
|
||||
0.5f - imu->orientation.y * imu->orientation.y - imu->orientation.z * imu->orientation.z);
|
||||
}
|
||||
|
||||
bool Odometry::calculate_odometry(const rclcpp::Duration & duration)
|
||||
{
|
||||
// rotation value of wheel [rad]
|
||||
double wheel_l = diff_joint_positions_[0];
|
||||
double wheel_r = diff_joint_positions_[1];
|
||||
|
||||
double delta_s = 0.0;
|
||||
double delta_theta = 0.0;
|
||||
|
||||
double theta = 0.0;
|
||||
static double last_theta = 0.0;
|
||||
|
||||
// v = translational velocity [m/s]
|
||||
// w = rotational velocity [rad/s]
|
||||
double v = 0.0;
|
||||
double w = 0.0;
|
||||
|
||||
double step_time = duration.seconds();
|
||||
|
||||
if (step_time == 0.0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (std::isnan(wheel_l)) {
|
||||
wheel_l = 0.0;
|
||||
}
|
||||
|
||||
if (std::isnan(wheel_r)) {
|
||||
wheel_r = 0.0;
|
||||
}
|
||||
|
||||
delta_s = wheels_radius_ * (wheel_r + wheel_l) / 2.0;
|
||||
|
||||
if (use_imu_) {
|
||||
theta = imu_angle_;
|
||||
delta_theta = theta - last_theta;
|
||||
} else {
|
||||
theta = wheels_radius_ * (wheel_r - wheel_l) / wheels_separation_;
|
||||
delta_theta = theta;
|
||||
}
|
||||
|
||||
// compute odometric pose
|
||||
robot_pose_[0] += delta_s * cos(robot_pose_[2] + (delta_theta / 2.0));
|
||||
robot_pose_[1] += delta_s * sin(robot_pose_[2] + (delta_theta / 2.0));
|
||||
robot_pose_[2] += delta_theta;
|
||||
|
||||
RCLCPP_DEBUG(nh_->get_logger(), "x : %f, y : %f", robot_pose_[0], robot_pose_[1]);
|
||||
|
||||
// compute odometric instantaneouse velocity
|
||||
v = delta_s / step_time;
|
||||
w = delta_theta / step_time;
|
||||
|
||||
robot_vel_[0] = v;
|
||||
robot_vel_[1] = 0.0;
|
||||
robot_vel_[2] = w;
|
||||
|
||||
last_theta = theta;
|
||||
return true;
|
||||
}
|
|
@ -1,56 +0,0 @@
|
|||
// Copyright 2019 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.
|
||||
//
|
||||
// Author: Darby Lim
|
||||
|
||||
#include "eutobot_node/sensors/battery_state.hpp"
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
using robotis::eutobot::sensors::BatteryState;
|
||||
|
||||
BatteryState::BatteryState(
|
||||
std::shared_ptr<rclcpp::Node> & nh,
|
||||
const std::string & topic_name)
|
||||
: Sensors(nh)
|
||||
{
|
||||
pub_ = nh->create_publisher<sensor_msgs::msg::BatteryState>(topic_name, this->qos_);
|
||||
|
||||
RCLCPP_INFO(nh_->get_logger(), "Succeeded to create battery state publisher");
|
||||
}
|
||||
|
||||
void BatteryState::publish(
|
||||
const rclcpp::Time & now,
|
||||
std::shared_ptr<DynamixelSDKWrapper> & dxl_sdk_wrapper)
|
||||
{
|
||||
auto msg = std::make_unique<sensor_msgs::msg::BatteryState>();
|
||||
|
||||
msg->header.stamp = now;
|
||||
|
||||
msg->design_capacity = 1.8f;
|
||||
|
||||
msg->voltage = 0.01f * dxl_sdk_wrapper->get_data_from_device<int32_t>(
|
||||
extern_control_table.battery_voltage.addr,
|
||||
extern_control_table.battery_voltage.length);
|
||||
|
||||
msg->percentage = 0.01f * dxl_sdk_wrapper->get_data_from_device<int32_t>(
|
||||
extern_control_table.battery_percentage.addr,
|
||||
extern_control_table.battery_percentage.length);
|
||||
|
||||
msg->voltage <= 7.0 ? msg->present = false : msg->present = true;
|
||||
|
||||
pub_->publish(std::move(msg));
|
||||
}
|
|
@ -1,106 +0,0 @@
|
|||
// Copyright 2019 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.
|
||||
//
|
||||
// Author: Darby Lim
|
||||
|
||||
#include "eutobot_node/sensors/imu.hpp"
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
using robotis::eutobot::sensors::Imu;
|
||||
|
||||
Imu::Imu(
|
||||
std::shared_ptr<rclcpp::Node> & nh,
|
||||
const std::string & imu_topic_name,
|
||||
const std::string & mag_topic_name,
|
||||
const std::string & frame_id)
|
||||
: Sensors(nh, frame_id)
|
||||
{
|
||||
imu_pub_ = nh->create_publisher<sensor_msgs::msg::Imu>(imu_topic_name, this->qos_);
|
||||
mag_pub_ = nh->create_publisher<sensor_msgs::msg::MagneticField>(mag_topic_name, this->qos_);
|
||||
|
||||
RCLCPP_INFO(nh_->get_logger(), "Succeeded to create imu publisher");
|
||||
}
|
||||
|
||||
void Imu::publish(
|
||||
const rclcpp::Time & now,
|
||||
std::shared_ptr<DynamixelSDKWrapper> & dxl_sdk_wrapper)
|
||||
{
|
||||
auto imu_msg = std::make_unique<sensor_msgs::msg::Imu>();
|
||||
|
||||
imu_msg->header.frame_id = this->frame_id_;
|
||||
imu_msg->header.stamp = now;
|
||||
|
||||
imu_msg->orientation.w = dxl_sdk_wrapper->get_data_from_device<float>(
|
||||
extern_control_table.imu_orientation_w.addr,
|
||||
extern_control_table.imu_orientation_w.length);
|
||||
|
||||
imu_msg->orientation.x = dxl_sdk_wrapper->get_data_from_device<float>(
|
||||
extern_control_table.imu_orientation_x.addr,
|
||||
extern_control_table.imu_orientation_x.length);
|
||||
|
||||
imu_msg->orientation.y = dxl_sdk_wrapper->get_data_from_device<float>(
|
||||
extern_control_table.imu_orientation_y.addr,
|
||||
extern_control_table.imu_orientation_y.length);
|
||||
|
||||
imu_msg->orientation.z = dxl_sdk_wrapper->get_data_from_device<float>(
|
||||
extern_control_table.imu_orientation_z.addr,
|
||||
extern_control_table.imu_orientation_z.length);
|
||||
|
||||
imu_msg->angular_velocity.x = dxl_sdk_wrapper->get_data_from_device<float>(
|
||||
extern_control_table.imu_angular_velocity_x.addr,
|
||||
extern_control_table.imu_angular_velocity_x.length);
|
||||
|
||||
imu_msg->angular_velocity.y = dxl_sdk_wrapper->get_data_from_device<float>(
|
||||
extern_control_table.imu_angular_velocity_y.addr,
|
||||
extern_control_table.imu_angular_velocity_y.length);
|
||||
|
||||
imu_msg->angular_velocity.z = dxl_sdk_wrapper->get_data_from_device<float>(
|
||||
extern_control_table.imu_angular_velocity_z.addr,
|
||||
extern_control_table.imu_angular_velocity_z.length);
|
||||
|
||||
imu_msg->linear_acceleration.x = dxl_sdk_wrapper->get_data_from_device<float>(
|
||||
extern_control_table.imu_linear_acceleration_x.addr,
|
||||
extern_control_table.imu_linear_acceleration_x.length);
|
||||
|
||||
imu_msg->linear_acceleration.y = dxl_sdk_wrapper->get_data_from_device<float>(
|
||||
extern_control_table.imu_linear_acceleration_y.addr,
|
||||
extern_control_table.imu_linear_acceleration_y.length);
|
||||
|
||||
imu_msg->linear_acceleration.z = dxl_sdk_wrapper->get_data_from_device<float>(
|
||||
extern_control_table.imu_linear_acceleration_z.addr,
|
||||
extern_control_table.imu_linear_acceleration_z.length);
|
||||
|
||||
auto mag_msg = std::make_unique<sensor_msgs::msg::MagneticField>();
|
||||
|
||||
mag_msg->header.frame_id = this->frame_id_;
|
||||
mag_msg->header.stamp = now;
|
||||
|
||||
mag_msg->magnetic_field.x = dxl_sdk_wrapper->get_data_from_device<float>(
|
||||
extern_control_table.imu_magnetic_x.addr,
|
||||
extern_control_table.imu_magnetic_x.length);
|
||||
|
||||
mag_msg->magnetic_field.y = dxl_sdk_wrapper->get_data_from_device<float>(
|
||||
extern_control_table.imu_magnetic_y.addr,
|
||||
extern_control_table.imu_magnetic_y.length);
|
||||
|
||||
mag_msg->magnetic_field.z = dxl_sdk_wrapper->get_data_from_device<float>(
|
||||
extern_control_table.imu_magnetic_z.addr,
|
||||
extern_control_table.imu_magnetic_z.length);
|
||||
|
||||
imu_pub_->publish(std::move(imu_msg));
|
||||
mag_pub_->publish(std::move(mag_msg));
|
||||
}
|
|
@ -1,91 +0,0 @@
|
|||
// Copyright 2019 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.
|
||||
//
|
||||
// Author: Darby Lim
|
||||
|
||||
#include <array>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "eutobot_node/sensors/joint_state.hpp"
|
||||
|
||||
using robotis::eutobot::sensors::JointState;
|
||||
|
||||
JointState::JointState(
|
||||
std::shared_ptr<rclcpp::Node> & nh,
|
||||
const std::string & topic_name,
|
||||
const std::string & frame_id)
|
||||
: Sensors(nh, frame_id)
|
||||
{
|
||||
pub_ = nh->create_publisher<sensor_msgs::msg::JointState>(topic_name, this->qos_);
|
||||
|
||||
RCLCPP_INFO(nh_->get_logger(), "Succeeded to create joint state publisher");
|
||||
}
|
||||
|
||||
void JointState::publish(
|
||||
const rclcpp::Time & now,
|
||||
std::shared_ptr<DynamixelSDKWrapper> & dxl_sdk_wrapper)
|
||||
{
|
||||
auto msg = std::make_unique<sensor_msgs::msg::JointState>();
|
||||
|
||||
static std::array<int32_t, JOINT_NUM> last_diff_position, last_position;
|
||||
|
||||
std::array<int32_t, JOINT_NUM> position =
|
||||
{dxl_sdk_wrapper->get_data_from_device<int32_t>(
|
||||
extern_control_table.present_position_left.addr,
|
||||
extern_control_table.present_position_left.length),
|
||||
dxl_sdk_wrapper->get_data_from_device<int32_t>(
|
||||
extern_control_table.present_position_right.addr,
|
||||
extern_control_table.present_position_right.length)};
|
||||
|
||||
std::array<int32_t, JOINT_NUM> velocity =
|
||||
{dxl_sdk_wrapper->get_data_from_device<int32_t>(
|
||||
extern_control_table.present_velocity_left.addr,
|
||||
extern_control_table.present_velocity_left.length),
|
||||
dxl_sdk_wrapper->get_data_from_device<int32_t>(
|
||||
extern_control_table.present_velocity_right.addr,
|
||||
extern_control_table.present_velocity_right.length)};
|
||||
|
||||
// std::array<int32_t, JOINT_NUM> current =
|
||||
// {dxl_sdk_wrapper->get_data_from_device<int32_t>(
|
||||
// extern_control_table.resent_current_left.addr,
|
||||
// extern_control_table.resent_current_left.length),
|
||||
// dxl_sdk_wrapper->get_data_from_device<int32_t>(
|
||||
// extern_control_table.resent_current_right.addr,
|
||||
// extern_control_table.resent_current_right.length)};
|
||||
|
||||
msg->header.frame_id = this->frame_id_;
|
||||
msg->header.stamp = now;
|
||||
|
||||
msg->name.push_back("wheel_left_joint");
|
||||
msg->name.push_back("wheel_right_joint");
|
||||
|
||||
msg->position.push_back(TICK_TO_RAD * last_diff_position[0]);
|
||||
msg->position.push_back(TICK_TO_RAD * last_diff_position[1]);
|
||||
|
||||
msg->velocity.push_back(RPM_TO_MS * velocity[0]);
|
||||
msg->velocity.push_back(RPM_TO_MS * velocity[1]);
|
||||
|
||||
// msg->effort.push_back(current[0]);
|
||||
// msg->effort.push_back(current[1]);
|
||||
|
||||
last_diff_position[0] += (position[0] - last_position[0]);
|
||||
last_diff_position[1] += (position[1] - last_position[1]);
|
||||
|
||||
last_position = position;
|
||||
|
||||
pub_->publish(std::move(msg));
|
||||
}
|
|
@ -1,134 +0,0 @@
|
|||
// Copyright 2019 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.
|
||||
//
|
||||
// Author: Darby Lim
|
||||
|
||||
#include "eutobot_node/sensors/sensor_state.hpp"
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
using robotis::eutobot::sensors::SensorState;
|
||||
|
||||
SensorState::SensorState(
|
||||
std::shared_ptr<rclcpp::Node> & nh,
|
||||
const std::string & topic_name,
|
||||
const uint8_t & bumper_forward,
|
||||
const uint8_t & bumper_backward,
|
||||
const uint8_t & illumination,
|
||||
const uint8_t & cliff,
|
||||
const uint8_t & sonar)
|
||||
: Sensors(nh),
|
||||
bumper_forward_(bumper_forward),
|
||||
bumper_backward_(bumper_backward),
|
||||
illumination_(illumination),
|
||||
cliff_(cliff),
|
||||
sonar_(sonar)
|
||||
{
|
||||
pub_ = nh->create_publisher<eutobot_msgs::msg::SensorState>(topic_name, this->qos_);
|
||||
|
||||
RCLCPP_INFO(nh_->get_logger(), "Succeeded to create sensor state publisher");
|
||||
}
|
||||
|
||||
void SensorState::publish(
|
||||
const rclcpp::Time & now,
|
||||
std::shared_ptr<DynamixelSDKWrapper> & dxl_sdk_wrapper)
|
||||
{
|
||||
auto msg = std::make_unique<eutobot_msgs::msg::SensorState>();
|
||||
|
||||
msg->header.stamp = now;
|
||||
|
||||
if (bumper_forward_ || bumper_backward_) {
|
||||
uint8_t bumper_push_state;
|
||||
uint8_t bumper_forward_state;
|
||||
uint8_t bumper_backward_state;
|
||||
|
||||
bumper_forward_state = dxl_sdk_wrapper->get_data_from_device<uint8_t>(
|
||||
extern_control_table.bumper_1.addr,
|
||||
extern_control_table.bumper_1.length);
|
||||
|
||||
bumper_backward_state = dxl_sdk_wrapper->get_data_from_device<uint8_t>(
|
||||
extern_control_table.bumper_2.addr,
|
||||
extern_control_table.bumper_2.length);
|
||||
|
||||
bumper_push_state = bumper_forward_state << 0;
|
||||
bumper_push_state |= bumper_backward_state << 1;
|
||||
|
||||
msg->bumper = bumper_push_state;
|
||||
} else if (!bumper_forward_ && !bumper_backward_) {
|
||||
msg->bumper = 0;
|
||||
}
|
||||
|
||||
if (cliff_) {
|
||||
msg->cliff = dxl_sdk_wrapper->get_data_from_device<float>(
|
||||
extern_control_table.ir.addr,
|
||||
extern_control_table.ir.length);
|
||||
} else {
|
||||
msg->cliff = 0.0f;
|
||||
}
|
||||
|
||||
if (sonar_) {
|
||||
msg->sonar = dxl_sdk_wrapper->get_data_from_device<float>(
|
||||
extern_control_table.sonar.addr,
|
||||
extern_control_table.sonar.length);
|
||||
} else {
|
||||
msg->sonar = 0.0f;
|
||||
}
|
||||
|
||||
if (illumination_) {
|
||||
msg->illumination = dxl_sdk_wrapper->get_data_from_device<float>(
|
||||
extern_control_table.illumination.addr,
|
||||
extern_control_table.illumination.length);
|
||||
} else {
|
||||
msg->illumination = 0.0f;
|
||||
}
|
||||
|
||||
// update button state
|
||||
uint8_t button_push_state;
|
||||
uint8_t button_0_state;
|
||||
uint8_t button_1_state;
|
||||
|
||||
button_0_state = dxl_sdk_wrapper->get_data_from_device<uint8_t>(
|
||||
extern_control_table.button_1.addr,
|
||||
extern_control_table.button_1.length);
|
||||
|
||||
button_1_state = dxl_sdk_wrapper->get_data_from_device<uint8_t>(
|
||||
extern_control_table.button_2.addr,
|
||||
extern_control_table.button_2.length);
|
||||
|
||||
button_push_state = button_0_state << 0;
|
||||
button_push_state |= button_1_state << 1;
|
||||
|
||||
msg->button = button_push_state;
|
||||
|
||||
// update torque enable state
|
||||
msg->torque = dxl_sdk_wrapper->get_data_from_device<bool>(
|
||||
extern_control_table.motor_torque_enable.addr,
|
||||
extern_control_table.motor_torque_enable.length);
|
||||
|
||||
msg->left_encoder = dxl_sdk_wrapper->get_data_from_device<int32_t>(
|
||||
extern_control_table.present_position_left.addr,
|
||||
extern_control_table.present_position_left.length);
|
||||
|
||||
msg->right_encoder = dxl_sdk_wrapper->get_data_from_device<int32_t>(
|
||||
extern_control_table.present_position_right.addr,
|
||||
extern_control_table.present_position_right.length);
|
||||
|
||||
msg->battery = 0.01f * dxl_sdk_wrapper->get_data_from_device<int32_t>(
|
||||
extern_control_table.battery_voltage.addr,
|
||||
extern_control_table.battery_voltage.length);
|
||||
|
||||
pub_->publish(std::move(msg));
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
================================================================================
|
||||
Changelog for package eutobot_teleop
|
||||
================================================================================
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
0.1.0 (2023-11-06)
|
||||
- First Draft
|
|
@ -1,228 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
#
|
||||
# Copyright (c) 2011, Willow Garage, Inc.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Software License Agreement (BSD License 2.0)
|
||||
#
|
||||
# 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 {copyright_holder} 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 THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "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 THE
|
||||
# COPYRIGHT OWNER OR CONTRIBUTORS 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.
|
||||
#
|
||||
# Author: Darby Lim
|
||||
|
||||
import os
|
||||
import select
|
||||
import sys
|
||||
import rclpy
|
||||
|
||||
from geometry_msgs.msg import Twist
|
||||
from rclpy.qos import QoSProfile
|
||||
|
||||
if os.name == 'nt':
|
||||
import msvcrt
|
||||
else:
|
||||
import termios
|
||||
import tty
|
||||
|
||||
BURGER_MAX_LIN_VEL = 0.22
|
||||
BURGER_MAX_ANG_VEL = 2.84
|
||||
|
||||
WAFFLE_MAX_LIN_VEL = 0.26
|
||||
WAFFLE_MAX_ANG_VEL = 1.82
|
||||
|
||||
LIN_VEL_STEP_SIZE = 0.01
|
||||
ANG_VEL_STEP_SIZE = 0.1
|
||||
|
||||
msg = """
|
||||
Control Your EutoBot!
|
||||
---------------------------
|
||||
Moving around:
|
||||
w
|
||||
a s d
|
||||
x
|
||||
|
||||
w/x : increase/decrease linear velocity (Burger : ~ 0.22, Waffle and Waffle Pi : ~ 0.26)
|
||||
a/d : increase/decrease angular velocity (Burger : ~ 2.84, Waffle and Waffle Pi : ~ 1.82)
|
||||
|
||||
space key, s : force stop
|
||||
|
||||
CTRL-C to quit
|
||||
"""
|
||||
|
||||
e = """
|
||||
Communications Failed
|
||||
"""
|
||||
|
||||
|
||||
def get_key(settings):
|
||||
if os.name == 'nt':
|
||||
return msvcrt.getch().decode('utf-8')
|
||||
tty.setraw(sys.stdin.fileno())
|
||||
rlist, _, _ = select.select([sys.stdin], [], [], 0.1)
|
||||
if rlist:
|
||||
key = sys.stdin.read(1)
|
||||
else:
|
||||
key = ''
|
||||
|
||||
termios.tcsetattr(sys.stdin, termios.TCSADRAIN, settings)
|
||||
return key
|
||||
|
||||
|
||||
def print_vels(target_linear_velocity, target_angular_velocity):
|
||||
print('currently:\tlinear velocity {0}\t angular velocity {1} '.format(
|
||||
target_linear_velocity,
|
||||
target_angular_velocity))
|
||||
|
||||
|
||||
def make_simple_profile(output, input, slop):
|
||||
if input > output:
|
||||
output = min(input, output + slop)
|
||||
elif input < output:
|
||||
output = max(input, output - slop)
|
||||
else:
|
||||
output = input
|
||||
|
||||
return output
|
||||
|
||||
|
||||
def constrain(input_vel, low_bound, high_bound):
|
||||
if input_vel < low_bound:
|
||||
input_vel = low_bound
|
||||
elif input_vel > high_bound:
|
||||
input_vel = high_bound
|
||||
else:
|
||||
input_vel = input_vel
|
||||
|
||||
return input_vel
|
||||
|
||||
|
||||
def check_linear_limit_velocity(velocity):
|
||||
return constrain(velocity, -WAFFLE_MAX_LIN_VEL, WAFFLE_MAX_LIN_VEL)
|
||||
|
||||
|
||||
def check_angular_limit_velocity(velocity):
|
||||
return constrain(velocity, -WAFFLE_MAX_ANG_VEL, WAFFLE_MAX_ANG_VEL)
|
||||
|
||||
|
||||
def main():
|
||||
settings = None
|
||||
if os.name != 'nt':
|
||||
settings = termios.tcgetattr(sys.stdin)
|
||||
|
||||
rclpy.init()
|
||||
|
||||
qos = QoSProfile(depth=10)
|
||||
node = rclpy.create_node('teleop_keyboard')
|
||||
pub = node.create_publisher(Twist, 'cmd_vel', qos)
|
||||
|
||||
status = 0
|
||||
target_linear_velocity = 0.0
|
||||
target_angular_velocity = 0.0
|
||||
control_linear_velocity = 0.0
|
||||
control_angular_velocity = 0.0
|
||||
|
||||
try:
|
||||
print(msg)
|
||||
while(1):
|
||||
key = get_key(settings)
|
||||
if key == 'w':
|
||||
target_linear_velocity =\
|
||||
check_linear_limit_velocity(target_linear_velocity + LIN_VEL_STEP_SIZE)
|
||||
status = status + 1
|
||||
print_vels(target_linear_velocity, target_angular_velocity)
|
||||
elif key == 'x':
|
||||
target_linear_velocity =\
|
||||
check_linear_limit_velocity(target_linear_velocity - LIN_VEL_STEP_SIZE)
|
||||
status = status + 1
|
||||
print_vels(target_linear_velocity, target_angular_velocity)
|
||||
elif key == 'a':
|
||||
target_angular_velocity =\
|
||||
check_angular_limit_velocity(target_angular_velocity + ANG_VEL_STEP_SIZE)
|
||||
status = status + 1
|
||||
print_vels(target_linear_velocity, target_angular_velocity)
|
||||
elif key == 'd':
|
||||
target_angular_velocity =\
|
||||
check_angular_limit_velocity(target_angular_velocity - ANG_VEL_STEP_SIZE)
|
||||
status = status + 1
|
||||
print_vels(target_linear_velocity, target_angular_velocity)
|
||||
elif key == ' ' or key == 's':
|
||||
target_linear_velocity = 0.0
|
||||
control_linear_velocity = 0.0
|
||||
target_angular_velocity = 0.0
|
||||
control_angular_velocity = 0.0
|
||||
print_vels(target_linear_velocity, target_angular_velocity)
|
||||
else:
|
||||
if (key == '\x03'):
|
||||
break
|
||||
|
||||
if status == 20:
|
||||
print(msg)
|
||||
status = 0
|
||||
|
||||
twist = Twist()
|
||||
|
||||
control_linear_velocity = make_simple_profile(
|
||||
control_linear_velocity,
|
||||
target_linear_velocity,
|
||||
(LIN_VEL_STEP_SIZE / 2.0))
|
||||
|
||||
twist.linear.x = control_linear_velocity
|
||||
twist.linear.y = 0.0
|
||||
twist.linear.z = 0.0
|
||||
|
||||
control_angular_velocity = make_simple_profile(
|
||||
control_angular_velocity,
|
||||
target_angular_velocity,
|
||||
(ANG_VEL_STEP_SIZE / 2.0))
|
||||
|
||||
twist.angular.x = 0.0
|
||||
twist.angular.y = 0.0
|
||||
twist.angular.z = control_angular_velocity
|
||||
|
||||
pub.publish(twist)
|
||||
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
finally:
|
||||
twist = Twist()
|
||||
twist.linear.x = 0.0
|
||||
twist.linear.y = 0.0
|
||||
twist.linear.z = 0.0
|
||||
|
||||
twist.angular.x = 0.0
|
||||
twist.angular.y = 0.0
|
||||
twist.angular.z = 0.0
|
||||
|
||||
pub.publish(twist)
|
||||
|
||||
if os.name != 'nt':
|
||||
termios.tcsetattr(sys.stdin, termios.TCSADRAIN, settings)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
|
@ -1,21 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||
<package format="3">
|
||||
<name>eutobot_teleop</name>
|
||||
<version>2.1.5</version>
|
||||
<description>
|
||||
Teleoperation node using keyboard for EutoBot.
|
||||
</description>
|
||||
<maintainer email="ray@coasia.com">Ray Park</maintainer>
|
||||
<license>Apache 2.0</license>
|
||||
<url type="website">http://www.coasianexell.com/</url>
|
||||
<url type="repository">http://cnst.coasianexell.com:53000/robotics/eutobot</url>
|
||||
<url type="bugtracker">http://cnst.coasianexell.com:53000/issues</url>
|
||||
<author email="sw.jo@coasia.com">Biela Jo</author>
|
||||
<author email="emergency@coasia.com">Matt Lim</author>
|
||||
<exec_depend>geometry_msgs</exec_depend>
|
||||
<exec_depend>rclpy</exec_depend>
|
||||
<export>
|
||||
<build_type>ament_python</build_type>
|
||||
</export>
|
||||
</package>
|
|
@ -1,4 +0,0 @@
|
|||
[develop]
|
||||
script-dir=$base/lib/eutobot_teleop
|
||||
[install]
|
||||
install-scripts=$base/lib/eutobot_teleop
|
|
@ -1,39 +0,0 @@
|
|||
from setuptools import find_packages
|
||||
from setuptools import setup
|
||||
|
||||
package_name = 'eutobot_teleop'
|
||||
|
||||
setup(
|
||||
name=package_name,
|
||||
version='2.1.5',
|
||||
packages=find_packages(exclude=[]),
|
||||
data_files=[
|
||||
('share/ament_index/resource_index/packages', ['resource/' + package_name]),
|
||||
('share/' + package_name, ['package.xml']),
|
||||
],
|
||||
install_requires=[
|
||||
'setuptools',
|
||||
],
|
||||
zip_safe=True,
|
||||
author='Darby Lim',
|
||||
author_email='thlim@robotis.com',
|
||||
maintainer='Will Son',
|
||||
maintainer_email='willson@robotis.com',
|
||||
keywords=['ROS'],
|
||||
classifiers=[
|
||||
'Intended Audience :: Developers',
|
||||
'License :: OSI Approved :: Apache Software License',
|
||||
'Programming Language :: Python',
|
||||
'Topic :: Software Development',
|
||||
],
|
||||
description=(
|
||||
'Teleoperation node using keyboard for EutoBot.'
|
||||
),
|
||||
license='Apache License, Version 2.0',
|
||||
tests_require=['pytest'],
|
||||
entry_points={
|
||||
'console_scripts': [
|
||||
'teleop_keyboard = eutobot_teleop.script.teleop_keyboard:main'
|
||||
],
|
||||
},
|
||||
)
|
|
@ -1,5 +1,5 @@
|
|||
cmake_minimum_required(VERSION 3.5)
|
||||
project(yahboomcar_base_node)
|
||||
project(eutobot_base_node)
|
||||
|
||||
# Default to C99
|
||||
if(NOT CMAKE_C_STANDARD)
|
||||
|
@ -37,16 +37,10 @@ if(BUILD_TESTING)
|
|||
ament_lint_auto_find_test_dependencies()
|
||||
endif()
|
||||
|
||||
add_executable(base_node_X3 src/base_node_X3.cpp)
|
||||
add_executable(base_node_x1 src/base_node_x1.cpp)
|
||||
add_executable(base_node_R2 src/base_node_R2.cpp)
|
||||
ament_target_dependencies(base_node_X3 rclcpp tf2 tf2_ros nav_msgs geometry_msgs)
|
||||
ament_target_dependencies(base_node_x1 rclcpp tf2 tf2_ros nav_msgs geometry_msgs)
|
||||
ament_target_dependencies(base_node_R2 rclcpp tf2 tf2_ros nav_msgs geometry_msgs)
|
||||
add_executable(base_node src/base_node.cpp)
|
||||
ament_target_dependencies(base_node rclcpp tf2 tf2_ros nav_msgs geometry_msgs)
|
||||
install(TARGETS
|
||||
base_node_X3
|
||||
base_node_x1
|
||||
base_node_R2
|
||||
base_node
|
||||
DESTINATION lib/${PROJECT_NAME}
|
||||
)
|
||||
ament_package()
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||
<package format="3">
|
||||
<name>yahboomcar_base_node</name>
|
||||
<name>eutobot_base_node</name>
|
||||
<version>0.0.0</version>
|
||||
<description>TODO: Package description</description>
|
||||
<maintainer email="nx-ros2@todo.todo">nx-ros2</maintainer>
|
|
@ -18,24 +18,12 @@ from geometry_msgs.msg import Twist
|
|||
from sensor_msgs.msg import Imu,MagneticField, JointState
|
||||
from rclpy.clock import Clock
|
||||
|
||||
#from dynamic_reconfigure.server import Server
|
||||
car_type_dic={
|
||||
'R2':5,
|
||||
'X3':1,
|
||||
'NONE':-1
|
||||
}
|
||||
class yahboomcar_driver(Node):
|
||||
class eutobot_driver(Node):
|
||||
def __init__(self, name):
|
||||
super().__init__(name)
|
||||
global car_type_dic
|
||||
self.RA2DE = 180 / pi
|
||||
# self.car = Rosmaster()
|
||||
self.car = Rosmaster(1, "/dev/ttyUSB0", 2, False);
|
||||
self.car.set_car_type(1)
|
||||
self.car = Rosmaster(1, "/dev/ttyUSB1", 2, False)
|
||||
#get parameter
|
||||
self.declare_parameter('car_type', 'X3')
|
||||
self.car_type = self.get_parameter('car_type').get_parameter_value().string_value
|
||||
print (self.car_type)
|
||||
self.declare_parameter('imu_link', 'imu_link')
|
||||
self.imu_link = self.get_parameter('imu_link').get_parameter_value().string_value
|
||||
print (self.imu_link)
|
||||
|
@ -82,15 +70,10 @@ class yahboomcar_driver(Node):
|
|||
vy = msg.linear.y*1.0
|
||||
angular = msg.angular.z*1.0 # wait for chang
|
||||
self.car.set_car_motion(vx, vy, angular)
|
||||
'''print("cmd_vx: ",vx)
|
||||
print("cmd_vy: ",vy)
|
||||
print("cmd_angular: ",angular)'''
|
||||
#rospy.loginfo("nav_use_rot:{}".format(self.nav_use_rotvel))
|
||||
#print(self.nav_use_rotvel)
|
||||
|
||||
def RGBLightcallback(self,msg):
|
||||
# RGBLight control
|
||||
if not isinstance(msg, Int32): return
|
||||
# print ("RGBLight: ", msg.data)
|
||||
for i in range(3): self.car.set_colorful_effect(msg.data, 6, parm=1)
|
||||
def Buzzercallback(self,msg):
|
||||
if not isinstance(msg, Bool): return
|
||||
|
@ -127,9 +110,7 @@ class yahboomcar_driver(Node):
|
|||
my = my * 1.0
|
||||
mz = mz * 1.0
|
||||
vx, vy, angular = self.car.get_motion_data()
|
||||
'''print("vx: ",vx)
|
||||
print("vy: ",vy)
|
||||
print("angular: ",angular)'''
|
||||
|
||||
# Publish gyroscope data
|
||||
imu.header.stamp = time_stamp.to_msg()
|
||||
imu.header.frame_id = self.imu_link
|
||||
|
@ -151,11 +132,6 @@ class yahboomcar_driver(Node):
|
|||
twist.linear.y = vy *1.0
|
||||
twist.angular.z = angular*1.0
|
||||
self.velPublisher.publish(twist)
|
||||
# print("ax: %.5f, ay: %.5f, az: %.5f" % (ax, ay, az))
|
||||
# print("gx: %.5f, gy: %.5f, gz: %.5f" % (gx, gy, gz))
|
||||
# print("mx: %.5f, my: %.5f, mz: %.5f" % (mx, my, mz))
|
||||
# rospy.loginfo("battery: {}".format(battery))
|
||||
# rospy.loginfo("vx: {}, vy: {}, angular: {}".format(twist.linear.x, twist.linear.y, twist.angular.z))
|
||||
self.imuPublisher.publish(imu)
|
||||
self.magPublisher.publish(mag)
|
||||
self.volPublisher.publish(battery)
|
||||
|
@ -163,6 +139,6 @@ class yahboomcar_driver(Node):
|
|||
|
||||
def main():
|
||||
rclpy.init()
|
||||
driver = yahboomcar_driver('driver_node')
|
||||
driver = eutobot_driver('driver_node')
|
||||
rclpy.spin(driver)
|
||||
|
Binary file not shown.
Binary file not shown.
|
@ -4,6 +4,8 @@ from launch import LaunchDescription
|
|||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.conditions import IfCondition, UnlessCondition
|
||||
from launch.substitutions import Command, LaunchConfiguration
|
||||
from launch.substitutions import ThisLaunchFileDir
|
||||
from launch.substitutions import Command
|
||||
|
||||
from launch_ros.actions import Node
|
||||
from launch_ros.parameter_descriptions import ParameterValue
|
||||
|
@ -16,9 +18,9 @@ from launch.launch_description_sources import PythonLaunchDescriptionSource
|
|||
|
||||
print("---------------------robot_type = x3---------------------")
|
||||
def generate_launch_description():
|
||||
urdf_tutorial_path = get_package_share_path('yahboomcar_description')
|
||||
default_model_path = urdf_tutorial_path / 'urdf/yahboomcar_X3.urdf'
|
||||
default_rviz_config_path = urdf_tutorial_path / 'rviz/yahboomcar.rviz'
|
||||
urdf_tutorial_path = get_package_share_path('eutobot_description')
|
||||
default_model_path = urdf_tutorial_path / 'urdf/eutobot_X3.urdf'
|
||||
default_rviz_config_path = urdf_tutorial_path / 'rviz/eutobot.rviz'
|
||||
|
||||
gui_arg = DeclareLaunchArgument(name='gui', default_value='false', choices=['true', 'false'],
|
||||
description='Flag to enable joint_state_publisher_gui')
|
||||
|
@ -60,26 +62,29 @@ def generate_launch_description():
|
|||
)
|
||||
|
||||
imu_filter_config = os.path.join(
|
||||
get_package_share_directory('yahboomcar_bringup'),
|
||||
get_package_share_directory('eutobot_bringup'),
|
||||
'param',
|
||||
'imu_filter_param.yaml'
|
||||
)
|
||||
|
||||
ekf_filter_config = os.path.join(
|
||||
get_package_share_directory('yahboomcar_bringup'),
|
||||
get_package_share_directory('eutobot_bringup'),
|
||||
'param',
|
||||
'ekf.yaml'
|
||||
)
|
||||
|
||||
lidar_pkg_dir = LaunchConfiguration(
|
||||
'lidar_pkg_dir',
|
||||
default=os.path.join(get_package_share_directory('ydlidar_ros2_driver'), 'launch'))
|
||||
|
||||
driver_node = Node(
|
||||
package='yahboomcar_bringup',
|
||||
package='eutobot_bringup',
|
||||
executable='Mcnamu_driver_X3',
|
||||
)
|
||||
|
||||
base_node = Node(
|
||||
package='yahboomcar_base_node',
|
||||
executable='base_node_X3',
|
||||
# 이 tf는 ekf 융합을 사용할 때 ekf로 publish 된다.
|
||||
package='eutobot_base_node',
|
||||
executable='base_node',
|
||||
parameters=[{'pub_odom_tf': LaunchConfiguration('pub_odom_tf')}]
|
||||
)
|
||||
|
||||
|
@ -103,6 +108,10 @@ def generate_launch_description():
|
|||
)
|
||||
|
||||
return LaunchDescription([
|
||||
# IncludeLaunchDescription(
|
||||
# PythonLaunchDescriptionSource([lidar_pkg_dir, '/ydlidar_launch.py']),
|
||||
# launch_arguments={'port': '/dev/ttySAC6', 'frame_id': 'base_scan'}.items(),
|
||||
# ),
|
||||
gui_arg,
|
||||
model_arg,
|
||||
rviz_arg,
|
||||
|
@ -115,5 +124,4 @@ def generate_launch_description():
|
|||
base_node,
|
||||
imu_filter_node,
|
||||
ekf_filter_node
|
||||
# yahboom_joy_node
|
||||
])
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||
<package format="3">
|
||||
<name>yahboomcar_bringup</name>
|
||||
<name>eutobot_bringup</name>
|
||||
<version>0.0.0</version>
|
||||
<description>TODO: Package description</description>
|
||||
<maintainer email="nx-ros2@todo.todo">nx-ros2</maintainer>
|
|
@ -0,0 +1,4 @@
|
|||
[develop]
|
||||
script-dir=$base/lib/eutobot_bringup
|
||||
[install]
|
||||
install-scripts=$base/lib/eutobot_bringup
|
|
@ -0,0 +1,43 @@
|
|||
from setuptools import setup
|
||||
import os
|
||||
from glob import glob
|
||||
|
||||
package_name = 'eutobot_bringup'
|
||||
|
||||
setup(
|
||||
name=package_name,
|
||||
version='0.0.0',
|
||||
packages=[package_name],
|
||||
data_files=[
|
||||
('share/ament_index/resource_index/packages',
|
||||
['resource/' + package_name]),
|
||||
('share/' + package_name, ['package.xml']),
|
||||
(os.path.join('share',package_name,'launch'),glob(os.path.join('launch','*launch.py'))),
|
||||
#(os.path.join('share','eutobot_description','urdf'),glob(os.path.join('urdf','*.*'))),
|
||||
#(os.path.join('share','eutobot_description','meshes'),glob(os.path.join('meshes','*.*'))),
|
||||
(os.path.join('share','eutobot_description','rviz'),glob(os.path.join('rviz','*.rviz*'))),
|
||||
(os.path.join('share', package_name, 'param'), glob(os.path.join('param', '*.yaml'))),
|
||||
],
|
||||
install_requires=['setuptools'],
|
||||
zip_safe=True,
|
||||
maintainer='nx-ros2',
|
||||
maintainer_email='nx-ros2@todo.todo',
|
||||
description='TODO: Package description',
|
||||
license='TODO: License declaration',
|
||||
tests_require=['pytest'],
|
||||
entry_points={
|
||||
'console_scripts': [
|
||||
'Mcnamu_driver_X3 = eutobot_bringup.Mcnamu_driver_X3:main',
|
||||
'Mcnamu_driver_x1 = eutobot_bringup.Mcnamu_driver_x1:main',
|
||||
'calibrate_linear_X3 = eutobot_bringup.calibrate_linear_X3:main',
|
||||
'calibrate_angular_X3 = eutobot_bringup.calibrate_angular_X3:main',
|
||||
'patrol_4ROS = eutobot_bringup.patrol_4ROS:main',
|
||||
'patrol_a1_X3 = eutobot_bringup.patrol_a1_X3:main',
|
||||
'Ackman_driver_R2 = eutobot_bringup.Ackman_driver_R2:main',
|
||||
'calibrate_linear_R2 = eutobot_bringup.calibrate_linear_R2:main',
|
||||
'calibrate_angular_R2 = eutobot_bringup.calibrate_angular_R2:main',
|
||||
'patrol_4ROS_R2 = eutobot_bringup.patrol_4ROS_R2:main',
|
||||
'patrol_a1_R2 = eutobot_bringup.patrol_a1_R2:main',
|
||||
],
|
||||
},
|
||||
)
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue