bitmeal / ros-modbus-device-driver

Mozilla Public License 2.0
16 stars 7 forks source link

Node not starting on ROS Noetic #5

Open Meguenani opened 1 year ago

Meguenani commented 1 year ago

Dear @bitmeal, First of all thank you very much for sharing your work. I really appreciate the effort. I have ROS noetic that turns on Ubuntu 20.04 that uses Python3. WHen i run the node with the following command : rosrun ros_modbus_device_driver modbus_device_driver.py --mapping /home/arcoe/catkin_ws/src/varg_shooter/ros-modbus-device-driver/devicemapping.json

It literally shows nothing. It is like nothing started. It does not show any "connecting to: " message, nothing.

I made sure the pkg is built with catkin build. Is there any adaptation I need to make for Python3 ? any advices on how to properly start the node ?

Best regards

bitmeal commented 1 year ago

Thank you for reporting the issue. I can reproduce it on ROS Noetic. Seems to me that argparse has had some API change I am unaware of and cannot find documented by now.

To circumvent the problem, just use ROS parameters and change your --mapping to _mapping:= and all should hopefully work well.

Meguenani commented 1 year ago

Hi @bitmeal, Thank you very much for your answer. Now the node starts correctly and connects to the server side. I am testing it with a Siemens 1500 PLC and I think that with S7 PLCs from Siemens there is an issue with the bits order (bits order not bytes). For example when I send 00000011 from the PLC, I receive 11000000 on the node side. I think a bit_reorder function is much needed. Because of this problem, real values are not transmitted correctly.

Meguenani commented 1 year ago

My bad, it works. With Siemens PLCs I just had to specify : "byteorder_reverse": false, "wordorder_reverse": true, LREAL transfer works well

bitmeal commented 1 year ago

Glad both your problems are fixed for now and it works for you! And thank you for reporting the node working with Siemens PLCs.

I will leave the issue open, as command line argument parsing is not working and still needs a fix.