diff --git a/hironx_ros_bridge/robot/dynpick/dynpick_driver.cpp b/hironx_ros_bridge/robot/dynpick/dynpick_driver.cpp index 45262dc7..3e72db97 100644 --- a/hironx_ros_bridge/robot/dynpick/dynpick_driver.cpp +++ b/hironx_ros_bridge/robot/dynpick/dynpick_driver.cpp @@ -307,8 +307,13 @@ int main(int argc, char **argv) { #ifdef __QNX__ slogf(0, _SLOG_INFO, "Started fd1 = %d, fd2 = %d\n", fd1, fd2); #endif - SetComAttr(fd1); + /* Switch the order of SetComAttr depending on your sensor. Also alter the order at ReadCom calls later in this file. */ + // serusb1=right, serusb2=left + //SetComAttr(fd1); + //SetComAttr(fd2); + // serusb2=right, serusb1=left SetComAttr(fd2); + SetComAttr(fd1); /* Create the Dispatch Interface */ dpp = dispatch_create(); @@ -364,8 +369,12 @@ int main(int argc, char **argv) { /* The "Data Pump" - get and process messages */ while (1) { /* do serial read */ - ReadCom(fd1, force_sensor_data_0); - ReadCom(fd2, force_sensor_data_1); + // serusb1=right, serusb2=left + //ReadCom(fd1, force_sensor_data_0); + //ReadCom(fd2, force_sensor_data_1); + // serusb2=right, serusb1=left + ReadCom(fd2, force_sensor_data_0); + ReadCom(fd1, force_sensor_data_1); printf("dispatch\n"); /* process message */ diff --git a/hironx_ros_bridge/robot/dynpick/run_dynpick.sh b/hironx_ros_bridge/robot/dynpick/run_dynpick.sh index f8517945..aba544f5 100755 --- a/hironx_ros_bridge/robot/dynpick/run_dynpick.sh +++ b/hironx_ros_bridge/robot/dynpick/run_dynpick.sh @@ -30,12 +30,13 @@ # Written by TORK -# slay devc-serusb -# sleep 1 +slay -f devc-serusb +sleep 3 ## devc-serusb needs to be that of QNX6.5.0 SP1, to recognize Dynpick WDF-6M200-3, which is USB-Serial with 921.6kbps. ## And looks like we don't need to specifically call it as long as right version of /sbin/devc-serusb is placed. -# devc-serusb -E -F -b 921600 -d busno=0,devno=1,vid=0x10c4,did=0xea60 -# sleep 1 -# stty < /dev/serusb1 +devc-serusb -E -F -b 921600 -d busno=4,devno=2,unit=1,vid=0x10c4,did=0xea60 +devc-serusb -E -F -b 921600 -d busno=4,devno=3,unit=2,vid=0x10c4,did=0xea60 +sleep 3 +# stty < /dev/serusb1 ./dynpick_driver & # stty < /dev/serusb1