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

Fixes for Galactic Devel #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

guillaumeautran
Copy link

Very minor adjustment to support ROS2 Galactic release.

@@ -54,6 +54,7 @@ if(NOT (LIBSWIPL_INCLUDE_DIR AND LIBSWIPL_LIBRARY))
swipl
libswipl
PATHS
${SWIPL_BASE}/../
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this compensate for a different "prefix"?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe so but it might be more specific to my setup (building within Nix environment).

@@ -966,9 +966,6 @@
sub_atom(Func, 0, Pre, _, Package).

load_type_support(Package) :-
rwm_c_identifier(Id),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this not be conditional on the ROS2 version?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point. which ROS 2 version is this project claiming to be compatible with? The last LTS is Humble but my patch here just deals with Galactic. Have not tried with Humble yet.

Copy link
Member

@JanWielemaker JanWielemaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy if you adjust the PR. I'm also happy to do so myself, but I can't test this in my current setup. Notable just removing the load from load_type_support/1 worries me.

@@ -623,7 +623,7 @@ free_rcl_node(void* ptr)
static foreign_t
ros_create_node(term_t Context, term_t Name, term_t Node, term_t Options)
{ rcl_context_t *context;
rclswi_node_t *node;
rclswi_node_t *node = NULL;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this is to avoid an uninitialized warning? The correct fix seems to be to move rcl_node_init() inside the if (rc) block, no?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't want to move that there because the node variable is also used on line 686 when we call the rcl_node_init. That being said, we can probably simply remove the if (rc) line since that variable is not changed anywhere.

@@ -1545,7 +1545,7 @@ free_rcl_clock(void *ptr)
static foreign_t
ros_create_clock(term_t Context, term_t Type, term_t Clock)
{ rcl_context_t *context;
rcl_clock_type_t type;
rcl_clock_type_t type = RCL_ROS_TIME;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like an uninitialized warning as well? It is actually right. The if at line 1557 should have an else return FALSE.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that is an uninitialized warning. The compiler will attempt all code paths and generate such a warning if it finds one resulting in an uninitialized variable.
Always a good idea to initialize things.

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

Successfully merging this pull request may close these issues.

2 participants