I am using PCAN-USB FD in order to publish some sensor information within ROS2 framework utilizing the docker image ade from https://autowarefoundation.gitlab.io/au ... n-ade.html
I get the following error at initialization:
PCAN_ERROR_ILLOPERATION: An operation is not allowed due to the current configuration
When I try the same code within a normal c++ project and run it outside the ade environment it works fine and receives the sensor information.
Any hints why such behaviour happens when running inside a docker image?
The example of used code is below:
Code: Select all
#include <pcanbasic/PCANBasic.h>
bool PCAN_Interface::initialize(){
TPCANStatus result;
char strMsg[256];
TPCANBitrateFD bitrate;
bitrate = "f_clock_mhz=24, nom_brp=3, nom_tseg1=5, nom_tseg2=2, nom_sjw=1, data_brp=2, data_tseg1=4, data_tseg2=1, data_sjw=1";
result = CAN_InitializeFD(PCAN_USBBUS1, bitrate );
if (result != PCAN_ERROR_OK){
CAN_GetErrorText(result, 0, strMsg);
std::cout << strMsg << std::endl;
return false;
}
else {
std::cout << "PCAN-USB was initialized" << std::endl;
return true;
}
}
int main(int argc, char *argv[]){
PCAN_Interface pcan;
pcan.initialize();
}