Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.

Add rosconsole echo#168

Closed
efernandez wants to merge 3 commits intoros:kinetic-develfrom
efernandez:add_rosconsole_echo
Closed

Add rosconsole echo#168
efernandez wants to merge 3 commits intoros:kinetic-develfrom
efernandez:add_rosconsole_echo

Conversation

@efernandez
Copy link
Copy Markdown

This PR update the auto-complete code for rosconsole adding the echo command added in ros/ros_comm#1324

@efernandez
Copy link
Copy Markdown
Author

FYI @mikepurvis @dirk-thomas

@dirk-thomas
Copy link
Copy Markdown
Member

With ros/ros_comm#1324 being merged in the lunar-devel branch and this repo not distinguishing between Kinetic and Lunar I am wondering how to proceed with this. I would rather not backport new features into Kinetic but also don't want to branch this repo just for this completion script...

@efernandez
Copy link
Copy Markdown
Author

@dirk-thomas Do you think I should check for something like rosversion for the pkg and make the completion script compatible with kinetic and lunar?

It'd be easier if you create lunar-devel here, but I could try that.

@dirk-thomas
Copy link
Copy Markdown
Member

Do you think I should check for something like rosversion for the pkg and make the completion script compatible with kinetic and lunar?

The completion script could check the ROS distro and only conditionally add the new completion options. While not "great" that would be fine with me to get this working for newer distros.

It'd be easier if you create lunar-devel here, but I could try that.

As mentioned in my previous comment I don't think the overhead of branching (and having to maintain these branches in the future) is justified by the improved completion script.

@efernandez efernandez force-pushed the add_rosconsole_echo branch from 92a9d76 to 1753350 Compare May 6, 2018 17:07
@efernandez efernandez force-pushed the add_rosconsole_echo branch from 1753350 to 510e2ef Compare May 6, 2018 17:12
@efernandez
Copy link
Copy Markdown
Author

Rebased and updated checking for rosversion rospy >= 1.13.7. rosconsole echo was merged right after rospy version 1.13.6 was released.

For testing in my local checkout of ros_comm I only had to do:

diff --git a/clients/rospy/package.xml b/clients/rospy/package.xml
index a56d141..ebc057c 100644
--- a/clients/rospy/package.xml
+++ b/clients/rospy/package.xml
@@ -1,6 +1,6 @@
 <package>
   <name>rospy</name>
-  <version>1.13.6</version>
+  <version>1.13.7</version>
   <description>
     rospy is a pure Python client library for ROS. The rospy client
     API enables Python programmers to quickly interface with ROS <a

And the auto-completion works as expected.

The reason I didn't check the ros distro (rosversion -d) is because in our software it's always indigo regardless of the ros_comm version that we use. @mikepurvis might be able to comment more on this if needed.

fi

VERSION_ECHO="1.13.7"
dpkg --compare-versions ${VERSION_ECHO} le ${VERSION}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we rely on this to be available across all targeted platforms (e.g. Fedora, macOS)?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Good call.

Honestly, I google how to reliably compare versions. I picked this option because it was really simple, but it probably isn't available in other OSs.

I'm open to suggestions. What do you think of the two options here: https://stackoverflow.com/questions/16989598/bash-comparing-version-numbers/24067243 ?

I think sort -V should work in most systems nowadays, although some people say it's only available in the GNU sort version. If you think it's better to perform the check w/o sort -V, I can implement the other option.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Actually, it seems the FreeBSD supports sort -V. Do you know if macOS supports it? I don't have a Mac at hand atm.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems like a custom bash function is the most portable way to do it (without using Python):

https://stackoverflow.com/a/4025065/671658

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Actually, that online man page might be out-of-date, on my macbook I see the option:

% man sort | grep '\-V'
     -V, --version-sort

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

@dirk-thomas @wjwwood I'm happy to create a new PR, but I'm not sure if you'd be ok with using sort -V or you prefer the approach from https://stackoverflow.com/a/4025065/671658 🤔

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm happy to create a new PR

Absolutely, please make sure to target the default branch (which is noetic-devel) first and the patch can be backorder afterwards.

but I'm not sure if you'd be ok with using sort -V or you prefer the approach from https://stackoverflow.com/a/4025065/671658

As long as it is proven to work on currently supported platforms anything is fine with me.

@dirk-thomas
Copy link
Copy Markdown
Member

Closing due to inactivity.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants