Hi All, I am currently working on a project to remote control an excavator via an Ethernet link. The hydraulic valves are controlled by a SNAP PAC R-1, which is connected to a wireless bridge to a control PC running ROS (robot operating system). The system is presently operational and I can control the position of the hydraulic arm using a joystick.
I have been using the “IOP-DEV-OPTOMMP-LX” kit, which works but I am concerned that the data types will not translate well if we decided to use the code on a different platform (e.g. an ARM-based single board computer). The code uses data types like LONG, which are ok, but it also uses “long” as well (I am compiling the code on a 64-bit machine so I’m not exactly sure what effect this has on the code). What are the assumed widths of the data types used (short, int, long)? Are they the same as the Windows standard data types as defined in “Windows Data Types”? If so I can use cstdint, like below (these examples may not be correct, they are off the top of my head). This example may not work in Windows but it will work in Linux, which is the platform I am most interested in at the moment.
#include <cstdint>
typedef std::int32_t LONG;
typedef std::int16_t SHORT;
typedef std::uint8_t BYTE;
The method of connecting to the PAC may also be different but I am more interested in the data type sizes right now.
Any advice appreciated.
Kind Regards
Bart