This is a ROS wrapper for BlueRobotics Screw, Gripper and Sonar.
In addition, this package assumes connecting a screw and gripper to Rasberry Pi GPIO, and snonar to USB. Please refer to the following sites for parts installation and circuit wiring.
-
Screw (use 13pin)
-
Gripper (use 18pin)
-
Sonar (use USBserial port)
$ ssh pi@ip_adress_of_your_raspi
type passward
$ cd ~/your_ws/src
$ gitclone https://github.com/kumahika/GPIO_output
$ cd ~/your_ws/
$ catkin_make
$ cd ~/your_ws/src/GPIO_output/src
$ chmod +x screw_sub.py
$ chmod +x gripper.py
$ chmod +x sonar_pub.py
$ cd ~/your_ws/
$ source devel/setup.bash
$ rosrun GPIO_output screw_sub.py
$ roslaunch GPIO_output act3.launch
Check all topics
$ rostopic list
/gripper/pwm
/rosout
/rosout_agg
/screw/pwm
/sonar/confidence
/sonar/distance
/sonar/ping_interval
/sonar/ping_number
/sonar/scan_length
/sonar/scan_start
/sonar/speed_of_sound
/sonar/transmit_duration
/sonar/voltage
Screw operation test
$ rostopic pub /screw/pwm std_msgs/Int64 -- '3'
ON OF
mid
Gripper operation test
$ rostopic pub /gripper/pwm std_msgs/Int64 -- '3'
Open and Close
mid
You can set up pwm duty and duration of screw and gripper. Execute the following code or specify options in the launch file.
$ rosparam set /screw_subscreiber/duration_screw '2' # unit is sec
$ rosparam set /duration_gripper '2' # unit is sec
$ rosparam set /screw_subscreiber/pwm_screw '100' # You can set duty between -100 and 100.