0
$\begingroup$

I've been creating this stand alone urdf.xacro file to enact my macros. Is there a way to invoke/call a xacro macro from a python launch file and pass parameters? I've provided the file below. I'm using ROS 2 Humble.

<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="pxxls_assembly">
    
    <xacro:include filename="$(find interbotix_xsturret_descriptions)/urdf/pxxls.urdf.xacro"
      ns="interbotix" />
    <xacro:interbotix.pxxls robot_name="pxxls" base_link_frame="base_link" />

</robot>

......

$\endgroup$
2
  • 1
    $\begingroup$ Welcome to Robotics, Yato. When you ask, "Is there a way to do this," what are you asking about? Is there a way to do... what? Could you please edit your question to clarify what you're trying to do? $\endgroup$
    – Chuck
    Jan 26 at 21:33
  • $\begingroup$ You can xacro.process_file(urdf_file, mappings={'robot_name': ''}).toxml() to pass in parameters to a urdf. $\endgroup$
    – Yato
    Feb 5 at 19:00

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.