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

Qt-OpenGL draws ray with wrong color #132

Open
jtrautmann opened this issue Mar 4, 2020 · 5 comments
Open

Qt-OpenGL draws ray with wrong color #132

jtrautmann opened this issue Mar 4, 2020 · 5 comments
Assignees

Comments

@jtrautmann
Copy link

If I call CQTOpenGLUserFunctions::DrawRay, the displayed ray is not in the color I choose. For example, if I choose CColor::BLUE as parameter, the ray is displayed in red, and if I choose CColor::RED, it gets displayed in yellow.

I built argos using the commit from January 13.
OS: Ubuntu 18.04

@jtrautmann jtrautmann changed the title Qt-OpenGL draw arrow with wrong colors Qt-OpenGL draws arrow with wrong colors Mar 4, 2020
@jtrautmann jtrautmann changed the title Qt-OpenGL draws arrow with wrong colors Qt-OpenGL draws ray with wrong color Mar 4, 2020
@ilpincy
Copy link
Owner

ilpincy commented Jul 3, 2020

Do you have a code snippet I can try?

@jtrautmann
Copy link
Author

Okay I have a minimal example here:

/* test_user_functions.h */
#ifndef TEST_USER_FUNCTIONS_H
#define TEST_USER_FUNCTIONS_H

#include <argos3/plugins/simulator/visualizations/qt-opengl/qtopengl_user_functions.h>
#include <argos3/plugins/robots/foot-bot/simulator/footbot_entity.h>

using namespace argos;

class TestUserFunctions : public CQTOpenGLUserFunctions {

public:
    TestUserFunctions();

    void Draw(CFootBotEntity& c_entity);

};

#endif

/* test_user_functions.cpp */
#include "test_user_functions.h"

TestUserFunctions::TestUserFunctions() {
    RegisterUserFunction<TestUserFunctions,CFootBotEntity>(
                                                &TestUserFunctions::Draw);
}

void TestUserFunctions::Draw(CFootBotEntity& c_entity) {
    CRay3 ray(CVector3(0,0,0.01), CVector3(1,0,0));
    CColor color = CColor::BLUE;
    DrawRay(ray, color);
}

REGISTER_QTOPENGL_USER_FUNCTIONS(TestUserFunctions, "test")

@ilpincy
Copy link
Owner

ilpincy commented Jul 3, 2020

OK, will have a look today and report my findings.

@ilpincy ilpincy self-assigned this Jul 4, 2020
@ilpincy
Copy link
Owner

ilpincy commented Jul 7, 2020

I tested the code but I couldn't reproduce the issue. On what platform are you working? My test was on OSX 10.15.4.

@jtrautmann
Copy link
Author

OK, interesting... I'm working on Ubuntu 18.04.

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