sudo rosdep init rosdep update rosdep install --from-paths aandd_ekew_driver_py -y --ignore-src
this node uses weight_scale_interfaces
cd ~/dev_ws/src git clone https://github.com/TechMagicKK/weight_scale_interfaces.git cd ~/dev_ws colcon build --cmake-clean-first --symlink-install --packages-select weight_scale_interfaces . install/local_setup.zsh
cd ~/dev_ws/aandd_ekew_driver_py/launch edit bringup.launch.py for change params (port, baudrate, rate)
cd ~/dev_ws colcon build --cmake-clean-first --symlink-install --packages-select aandd_ekew_driver_py . install/local_setup.zsh
ros2 launch aandd_ekew_driver_py bringup.launch.py
ros2 launch aandd_ekew_driver_py bringup.launch.py use_fake:=True
ros2 param set /aandd_ekew_node rate 1.2-
check vendor id and product id.
-
plug/unplug the usb cable in order to find the vendor id and product id of your device with
lsusbcommand. For example, you can see the following text.Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 003 Device 004: ID 04f2:b7c0 Chicony Electronics Co., Ltd Integrated Camera Bus 003 Device 003: ID 06cb:00f9 Synaptics, Inc. Bus 003 Device 005: ID 8087:0033 Intel Corp. Bus 003 Device 007: ID 0584:b020 RATOC System, Inc. REX-USB60F Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
-
hopefully you can find the new line. the example is the following.
Bus 003 Device 007: ID 0584:b020 RATOC System, Inc. REX-USB60FThe vendor id is
0584, and product id isb020. NOTE: This is example, the vendor id and product id depend on your device. It may be difference in your device.
-
-
change value in
aandd_ekew_driver_py/rules/99-weight-scale.ruleswith your product id and product id.-
open rule file
cd ros_ws/src/aandd_ekew_driver_py/rules vim 99-weight-scale.rules -
change values for
idVendorandidProduct. If your vendor id is0584and product id isb020, edit it as below.SUBSYSTEM=="tty", ATTRS{idVendor}=="0584", ATTRS{idProduct}=="b020", SYMLINK+="weightscale", MODE="0666"
-
-
copy the rule file into
/etc/udev/rules.d/sudo cp 99-weight-scale.rules /etc/udev/rules.d
-
enable your rule
sudo udevadm control --reload
-
unplug and plug your usb cable. If the change is successful, you can find
/dev/weightscale. -
change
porttoweightscaleinbringup.launch.py.- port = launch.substitutions.LaunchConfiguration('port', default='/dev/ttyUSB0') + port = launch.substitutions.LaunchConfiguration('port', default='/dev/weightscale')