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

에스엔비 라이다 센서 관련 문의입니다. #2

Open
sinkangchul opened this issue Jul 4, 2022 · 2 comments
Open

에스엔비 라이다 센서 관련 문의입니다. #2

sinkangchul opened this issue Jul 4, 2022 · 2 comments

Comments

@sinkangchul
Copy link

현재 test_yrl_library.cpp 부분에서 openGL을 사용하여 (x,y,z)값에 대한 점을 찍어보는 작업을 진행중입니다.

//== 1. CREATE DRIVER INSTANCE ===========================================
YujinRobotYrlDriver* instance =  new YujinRobotYrlDriver();
//========================================================================

이 부분을 전역변수로 설정하여

void display()
{
glPointSize(0.5f); // 정점의 size 조절

//glClear(GL_COLOR_BUFFER_BIT);

glBegin(GL_POINTS);     // mode 선택

int ret = instance->GetCartesianOutputsWithIntensity(SystemTime, IntensityArray, XCoordArray, YCoordArray, ZCoordArray);
if (ret == -1)
{
    std::this_thread::sleep_for(std::chrono::milliseconds(40));
}

std::cout << IntensityArray.size() << std::endl;

for (int i = 0; i < XCoordArrays.size(); i++)
{
    if (XCoordArrays.at(i) != 0)
    {
        //std::cout << XCoordArray.at(i) / 10 << ", " << YCoordArrays.at(i) / 10 << ", " << ZCoordArrays.at(i) / 10 << std::endl;
        x_d = XCoordArrays.at(i) / 10;
        y_d = YCoordArrays.at(i) / 10;
        z_d = ZCoordArrays.at(i) / 10;
        glColor3f(0.5, z_d, 0.1);
        glVertex2f(x_d, y_d);

    }
}
glEnd();
glutSwapBuffers();

}

display 함수의 GetCartesianOutputsWithIntensity(...)를 실행할 방법이 있을까요?

  • 현재 저희가 원하는 방향은 x,y,z값의 대한 좌표를 가지고 2D에서 점을 찍고 일정 COUNT에 따른 이미지 저장을 하려고 합니다.
@CharlieYangPM
Copy link

안녕하세요. 유진로봇 개발본부 PM Charlie Yang 입니다. 위에 문의하신 함수는 Git에 제공한 test_yrl_library.cpp에 있습니다.

@sinkangchul
Copy link
Author

int main( int argc, char ** argv)
{
#ifdef _WIN32
std::thread thread(threadFucntion);
#endif

std::cout << "========================================" << std::endl; 
std::cout << "           Test YRL driver          " << std::endl; 
std::cout << "========================================\n" << std::endl;

if (argc != 2)
{
    LOGPRINT(main, YRL_LOG_USER, ("WRONG ARGUMENT! USAGE: [./test_yrl_library] [IP_ADDRESS]\n"));
    return -1;
}

#ifdef _WIN32
WSADATA wsaData;
if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0)
{
printf("WSAStartup() error!");
}
#endif

//== 1. CREATE DRIVER INSTANCE ===========================================
//YujinRobotYrlDriver* instance =  new YujinRobotYrlDriver();
//========================================================================

//== 2. SET IP ===========================================================
// THIS MUST BE SET BEFOR CALLING Start().
// THIS WILL BE USED TO CONNECT LIDAR
::instance->SetIPAddrParam(ip);
//========================================================================

//== 3. START DRIVER =====================================================
// THIS FUNCTION SHOULD BE ONLY ONCE CALLED.
int ret = ::instance->Start();

이 부분을 주석처리하고

/*********************************************************************

  • Copyright (c) 2022, YujinRobot Corp.
  • Non-monifiable freely redistributable software(FRS)
    • Redistribution. Redistribution and use in binary form, without modification,
  • are permitted provided that the following conditions are met:
    • Redistributions must reproduce the above copyright notice and the following
  • disclaimer in the documentation and/or other materials provided with the distribution.
    • Neither the name of YujinRobot Corporation nor the names of its suppliers may be used
  • to endorse or promote products derived from this software without specific prior written permission.
  • THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OFOR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
    *********************************************************************/
    #include <GL/glut.h>
    #include <stdio.h>
    #include <math.h>
    #include
    #include "C:/Users/win\source/repos/YRL3_V2_DLL_test/YRL3_V2_DLL_test/include/yujinrobot_yrldriver/yujinrobot_yrldriver.hpp"
    #include

YujinRobotYrlDriver* instance = new YujinRobotYrlDriver();

가장 상단에 선언했을 경우

[YRLTCPSocket][YRL_LOG_ERROR][YRLTCPSocket::SetNonBlockingMode:110] [tcp_client] socket error: 10038
[YRLTCPSocket][YRL_LOG_ERROR][YRLTCPSocket::SetNonBlockingMode:111] [tcp_client] non-blocking mode setting failed. Close socket.
[YRLTCPSocket][YRL_LOG_ERROR][YRLTCPSocket::Connect:200] [tcp_client] serverAddress: 192.168.1.250 serverPort: 1234, connection failed during connection. errno:0. Close socket.
[YRLTCPSocket][YRL_LOG_ERROR][YRLTCPSocket::SetBlockingMode:79] [tcp_client] blocking mode setting failed. Close socket.
[YujinRobotYrlDriver][YRL_LOG_ERROR][YujinRobotYrlDriver::Start:173] FAILED TO START TCP COMM.
-2
[main][YRL_LOG_USER] CANNOT START COMMUNICATION WITH LIDAR.
[main][YRL_LOG_USER] CONNECT TO [IP:192.168.1.250 PORT:1234] FAILED. CHECK YOUR NETWORK CONNECTION.

C:\Users\win\source\repos\YRL3_V2_DLL_test\x64\Release\test_driver.exe(프로세스 10392개)이(가) 종료되었습니다(코드: -1073740791개).
이 창을 닫으려면 아무 키나 누르세요...

이런 에러가 뜹니다..

다른 함수에서
instance->GetCartesianOutputsWithIntensity(SystemTime, IntensityArray, XCoordArray, YCoordArray, ZCoordArray);
이 명령어를 사용하는 방법이 있나요?

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

2 participants