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

change how to get ros2 version #14063

Closed
wants to merge 9 commits into from
27 changes: 15 additions & 12 deletions msg/tools/generate_microRTPS_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,18 +250,21 @@ def check_rtps_id_uniqueness(classifier):
"FastRTPSGen not found. Specify the location of fastrtpsgen with the -f flag")

# get ROS 2 version, if exists
ros2_distro = ""
try:
rosversion_out = subprocess.check_output(["rosversion", "-d"])
rosversion_out = rosversion_out.rstrip()
if rosversion_out not in ["<unknown>", "kinetic", "lunar", "melodic"]:
ros2_distro = rosversion_out
except OSError as e:
if e.errno == errno.ENOENT:
if args.ros2_distro != None:
ros2_distro = args.ros2_distro
else:
raise
ros2_distro = os.environ.get('ROS_DISTRO')
Copy link
Member

Choose a reason for hiding this comment

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

Can you please add a check that makes sure that makes sure that the ROS_DISTRO that is set is not a ROS 1 distro? Can be done on the next line. Otherwise, the rest of the process will fail. Thanks.

if ros2_distro is None :
try:
rosversion_out = subprocess.check_output(["rosversion", "-d"])
rosversion_out = rosversion_out.rstrip()
if rosversion_out not in ["<unknown>", "kinetic", "lunar", "melodic"]:
ros2_distro = rosversion_out
else :
ros2_distro = ""
except OSError as e:
if e.errno == errno.ENOENT:
if args.ros2_distro != None:
ros2_distro = args.ros2_distro
else:
raise

# If nothing specified it's generated both
if agent == False and client == False:
Expand Down
2 changes: 1 addition & 1 deletion src/modules/commander/commander_params.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ PARAM_DEFINE_INT32(COM_ARM_MAG_STR, 1);
/**
* Enable RC stick override of auto and/or offboard modes
*
* When RC stick override is enabled, moving the RC sticks immediately gives control back
* When RC stick override is enabled, moving the RC sticks immediately gives control back
* to the pilot (switches to manual position mode):
* bit 0: Enable for auto modes (except for in critical battery reaction),
* bit 1: Enable for offboard mode.
Expand Down