Example #1
0
        protected virtual void _send_states(long now, ToolState rr_tool_state, ToolStateSensorData rr_state_sensor_data)
        {
            if (rrvar_tool_state != null)
            {
                rrvar_tool_state.OutValue = rr_tool_state;
            }

            rrvar_tool_state_sensor_data?.AsyncSendPacket(rr_state_sensor_data).ContinueWith(t => { var ignore = t.Exception; }, System.Threading.Tasks.TaskContinuationOptions.OnlyOnFaulted);

            if (rrvar_device_clock_now != null)
            {
                rrvar_device_clock_now.OutValue = DateTimeUtil.FillDeviceTime(RobotRaconteurNode.s, tool_info?.device_info, _state_seqno);
            }
        }
Example #2
0
        protected virtual void _fill_sensor_data(long now, ToolState rr_tool_state, out ToolStateSensorData rr_state_sensor_data)
        {
            if (rr_tool_state == null)
            {
                rr_state_sensor_data = null;
                return;
            }



            var sensor_data_header = SensorDataUtil.FillSensorDataHeader(RobotRaconteurNode.s, _tool_info?.device_info, _state_seqno);

            var sensor_data = new ToolStateSensorData();

            sensor_data.data_header = sensor_data_header;
            sensor_data.robot_state = rr_tool_state;

            rr_state_sensor_data = sensor_data;
        }