Closed bmegli closed 1 year ago
Related to #24
Current workaround if problem happens is to restart the node
Another workaround is not to change MTU but in some scenarios it is necessary
It looks like device remembers MTU
I can see it in output
[ INFO] [1696942328.057653062]: Network mtu = 9000
And it is value set last time when launching node
Above comes from
if (implemented_features_["GevSCPSPacketSize"])
ROS_INFO(" Network mtu = %lu", aravis::device::feature::get_integer(p_device_, "GevSCPSPacketSize"));
Which confirms it's readout from device
Logic on dynamic reconfigure change
if (changed_mtu)
{
if (implemented_features_["GevSCPSPacketSize"])
{
ROS_INFO("Set mtu = %d", config.mtu);
aravis::device::feature::set_integer(p_device_, "GevSCPSPacketSize", config.mtu);
ros::Duration(1.0).sleep();
config.mtu = aravis::device::feature::get_integer(p_device_, "GevSCPSPacketSize");
ROS_INFO("Get mtu = %d", config.mtu);
}
else
ROS_INFO("Camera does not support mtu (i.e. GevSCPSPacketSize).");
}
It also looks like apart from dynamic reconfigure MTU there is also initially setup value from ROS parameter
pnh.param<int>("mtu", config_.mtu, config_.mtu);
This value seems to be happily ignored later (overwritten by dynamic reconfigure default?)
At the same time device may have different MTU from above 2 values.
What a mess.
sudo ifconfig enp60s0 mtu 9000
Start ROS driver
Wait until camera initializes
Modify MTU on MotionCam3D ROS driver
rosrun rqt_reconfigure rqt_reconfigure
# set to matching 9000
Restart of ROS driver fixes the problem
OS MTU doesn't need to be changed after starting the driver for the problem to manifest
Updating above
After fixing setting up MTU from rosparam in:
I can now initialize with selected MTU from cold booted MotionCam3D and ROS without corrupted data
Now that MTU was removed from dynamic reconfigure.
Setting MTU using launchtime GenICam GevSCPSPacketSize
will not cause problem.
Maybe problem can be reproduced by service call GenICam setup at runtime
The call would be:
rosservice call /camera/set_integer_feature_value "feature: 'GevSCPSPacketSize'
value: 9000"
Needs retesting scenario
sudo ifconfig enp60s0 mtu 9000
Start ROS driver
Wait until camera initializes
Modify MTU on MotionCam3D ROS driver using service
rosservice call /camera/set_integer_feature_value "feature: 'GevSCPSPacketSize'
value: 9000"
Using GevSCPSPacketSize
This is not affected by bug.
If getting corrupted data after service call changing MTU restarting node will fix the problem
This worked with dynamic reconfigure, probably will also work with service
Note:
Sometimes when manipulating MTU data is corrupted afterwards