Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

about "no response" #9

Open
comwise opened this issue Nov 23, 2018 · 4 comments
Open

about "no response" #9

comwise opened this issue Nov 23, 2018 · 4 comments

Comments

@comwise
Copy link

comwise commented Nov 23, 2018

i have the same following problem, but i use UAM-05LP.
->Still for a long time, the laser will occur it
->reboot node process, it is not invalid, but reboot robot will be ok
i see the code, the problem will be here

`//! 距離データの取得
static int receive_data(urg_t *urg, long data[], unsigned short intensity[],
long *time_stamp, unsigned long long *system_time_stamp)
{
urg_measurement_type_t type;
char buffer[BUFFER_SIZE];
int ret = 0;
int n;
int extended_timeout = urg->timeout
+ 2 * (urg->scan_usec * (urg->scanning_skip_scan) / 1000);

// エコーバックの取得
n = connection_readline(&urg->connection,
                        buffer, BUFFER_SIZE, extended_timeout);
if (n <= 0) {
    return set_errno_and_return(urg, URG_NO_RESPONSE);
}`

i don't debug this code, the problem only happens sometimes


The device I used is: UST-10LX.
The version of Lib I used is: urg_library-1.2.2.zip.
The test environment is: Windows10 64bit and Visual Studio 2015.
Open the device through the network port, starts to measure, and gets the data by calling get_distance_intensity().
Sometimes there is a "no response" error in a few minutes (and it may take a few days to meet this problem). After this error, you can no longer continue to get data through get_distance_intensity().
The error is returned even when close () is called and open () is invoked. Only by closing the program and run it again can continue to receive data through the get_distance_intensity().
Do you have the same problem? Or could you give me some advice?
I look forward to your reply very much. I hope my poor English does not affect your reading.

@comwise
Copy link
Author

comwise commented Dec 5, 2018

i debug the code, you can following my flow:

  1. the laser can connected, can get product info by connect_urg_device

  2. the laser can set urg_start_measurement by URG_DISTANCE_INTENSITY
    *** but get scan data is none, block here:
    tcpclient_read(...)
    ...
    `#if defined(URG_WINDOWS_OS)
    int no_timeout = 1;
    setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, (const char *)&no_timeout, sizeof(struct timeval));
    n = recv(sock, tmpbuf, BUFSIZE - num_in_buf, 0);
    #else
    n = recv(sock, tmpbuf, BUFSIZE - num_in_buf, MSG_DONTWAIT);
    #endif
    if (n > 0) {
    tcpclient_buffer_write(cli, tmpbuf, n); // copy socket to my buffer
    }

    n = tcpclient_buffer_read(cli, &userbuf[req_size-rem_size], rem_size);
    // n never be greater than rem_size`
    

here you will see the n == 0
i browse the document "Communication_protocol_UAM-05LP_2.2.0_r3_en.pdf"
i think that is something wrong with the hareware of UAM-05LP laser

i know that will be valid if i reboot the laser, but i cann't find reboot command
if you find good way, I look forward to your best solution, you can reply @comwise ,thanks

@comwise
Copy link
Author

comwise commented Dec 6, 2018

i add "BM" command to debug it, but the response messages is "BM01Q"
// the doc readme
Request and response messages of BM command are shown in Figure 8.7.1.1 and Table
8.7.1.1 shows the status code detail. Generally, the status is always 02, but when the device
is in the lockout state due to error or if it is switched to laser off mode, the status will be 01

Code Detail
01 Laser emission is stopped due to internal error or the device is switched to laser off mode
02 Laser is on

@comwise
Copy link
Author

comwise commented Dec 6, 2018

use “GE” command,
send string is 'GE0000108001\n' ,
response message is ’GE0000108001\n0Nn‘
//the doc readme on P28
Code Detail
00 No error
01 Start parameter contains non numeric character
02 End parameter contains non numeric character
03 Grouping parameter contains non numeric character
04 End parameter exceeds the measurement step
05 End parameter is smaller than start parameter
06 Skips parameter contains non numeric character

i can't understand the '0N' ?

i find more answer about these on P27
Table 8.6.1 Common SCIP Status Codes
Code Detail
00 No error
01 ~ 07 Error in the command parameter
0D Request message is longer than specified
0E Undefined command
0G User specified string is longer than allowed.
0H User specified string has error
0N UAM is in lockout state due to error

so there is some wrong with the laser hardware

@comwise
Copy link
Author

comwise commented Aug 2, 2021

i have resolve this problem,you can see this https://github.com/comwise/urg_node

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant