Answer
stringlengths 44
28.2k
⌀ | Id
stringlengths 1
6
| CreationDate
stringlengths 23
23
| Tags
stringlengths 4
94
| Body
stringlengths 54
35.7k
| Title
stringlengths 13
150
|
---|---|---|---|---|---|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>It seem like the problem with the OpenCV. In <a href="https://github.com/hrnr/m-explore/blob/melodic-devel/map_merge/src/combine_grids/estimation_internal.h#L68" rel="nofollow noreferrer">this line</a> try to change <code>return xfeatures2d::SURF::create();</code> to <code>return cv::xfeatures2d::SURF::create();</code> as the code is not defining <code>using namespace cv;</code></p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/73435/aarsh_t/" rel="nofollow noreferrer">aarsh_t</a> with karma: 328 on 2023-01-20</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 2</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/75936/distro/" rel="nofollow noreferrer">distro</a> on 2023-01-20</strong>:<br />
@aarsh_t I already have openCV and need it for other projecs I'm working on. I don't want to break those other projects by doing this. Is there a way to make a seperate environment to built an openCV that will only affect this one <code>explore_lite</code> package?</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/73435/aarsh_t/" rel="nofollow noreferrer">aarsh_t</a> on 2023-01-20</strong>:<br />
Sorry I did not read the other answer carefully. I will updated the answer in 2 mins.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/75936/distro/" rel="nofollow noreferrer">distro</a> on 2023-01-20</strong>:<br />
@aarsh_t Thanks it worked! I'm now trying to use the <code>explore.launch</code> file. Would you know how to connect to <code>move_base server</code>?:
<code>Waiting to connect to move_base server</code></p>
<p><strong>Comment by <a href="https://answers.ros.org/users/73435/aarsh_t/" rel="nofollow noreferrer">aarsh_t</a> on 2023-01-21</strong>:<br />
Sorry I haven't used the package so I have no idea of how to play with it. May be you can ask to the developer or create a new question.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/75936/distro/" rel="nofollow noreferrer">distro</a> on 2023-01-21</strong>:<br />
@aarsh thank you</p>
|
102949
|
2023-01-20T01:18:44.000
|
|ros-melodic|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I'm trying to build the ROS melodic branch of <a href="https://github.com/hrnr/m-explore/tree/melodic-devel" rel="nofollow noreferrer">explore_lite</a>. I get this error:</p>
<pre><code> Errors << multirobot_map_merge:make /home/philip/catkin_ws/logs/multirobot_map_merge/build.make.000.log
In file included from /home/philip/catkin_ws/src/m-explore/map_merge/src/combine_grids/merging_pipeline.cpp:46:0:
/home/philip/catkin_ws/src/m-explore/map_merge/src/combine_grids/estimation_internal.h: In function ‘cv::Ptr<cv::Feature2D> combine_grids::internal::chooseFeatureFinder(combine_grids::FeatureType)’:
/home/philip/catkin_ws/src/m-explore/map_merge/src/combine_grids/estimation_internal.h:68:14: error: ‘xfeatures2d’ has not been declared
return xfeatures2d::SURF::create();
</code></pre>
<p>What dependency am I missing?</p>
<hr />
<p><a href="https://answers.ros.org/question/411604/trying-to-build-explore_lite-in-ros-melodic/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/75936/distro/" rel="nofollow noreferrer">distro</a> on ROS Answers with karma: 167 on 2023-01-20</p>
<p>Post score: 0</p>
|
Trying to build explore_lite in ROS melodic
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hello @Anirban,</p>
<p>By looking at your issue, I can conclude that you have the same IP address in your ubuntu and Teaching pendant. Try to change the IP address to <strong>192.168.137.101 or any other number (Not 100).</strong></p>
<p>You cannot have the same ip address on a network. (An IP address conflict happens when two or more devices in a network have the same IP address. This results to one or both of the devices not being able to communicate with each other.)</p>
<p>Then try and check what errors are you getting.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/63046/ranjit-kathiriya/" rel="nofollow noreferrer">Ranjit Kathiriya</a> with karma: 1622 on 2023-01-27</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/134859/anirban/" rel="nofollow noreferrer">Anirban</a> on 2023-01-30</strong>:<br />
No unfortunately it did not work. Anyways, thanks a lot for the help!</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/134859/anirban/" rel="nofollow noreferrer">Anirban</a> on 2023-01-30</strong>:<br />
But it did help..Yes I was setting it wrong it seems. I later changed the IP.</p>
|
102951
|
2023-01-20T05:05:01.000
|
|ros|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hi,</p>
<p>I have a new Doosan A0509s arm. I am trying to run it using ROS.</p>
<p>The virtual mode works and launches properly when using the following -</p>
<blockquote>
<p>roslaunch dsr_launcher
dsr_moveit.launch model:=a0509</p>
</blockquote>
<p>The problem arises when I am connecting the Real robot. I am running the following -</p>
<blockquote>
<p>roslaunch dsr_control
dsr_moveit.launch model:=a0509
host:=192.168.137.100 mode:=real</p>
</blockquote>
<p>But, I am getting the following errors -</p>
<blockquote>
<p>Connection refused [ERROR]
[1674121841.041127378]: [dsr_control]
Error initializing robot</p>
</blockquote>
<blockquote>
<p>[dsr01a0509-3] process has died [pid
40413, exit code 255, cmd
/home/anirban/catkin_ws/devel/lib/dsr_control/dsr_control_node
__name:=dsr01a0509 __log:=/home/anirban/.ros/log/bb3cbe20-97de-11ed-9a96-67be539470cf/dsr01a0509-3.log].
log file:
/home/anirban/.ros/log/bb3cbe20-97de-11ed-9a96-67be539470cf/dsr01a0509-3*.log</p>
</blockquote>
<p>I am able to ping to 192.168.127.100 when using the real robot, but ROS is unable to connect to it.</p>
<p>System details -
Ubuntu 20.04
Ros Noetic</p>
<p>Can you please help me debug this issue?
Thank you.</p>
<hr />
<p>Update : What I tried till now -</p>
<ol>
<li><p>Ping - Pinging the ip 192.168.137.100 works. But error still exists.</p>
</li>
<li><p>Tried running with admin privilages sudo i -</p>
</li>
</ol>
<blockquote>
<p>$sudo -i</p>
</blockquote>
<p>then cd into catkin workspace, then source. Then run the roslaunch. Did not work.</p>
<ol start="3">
<li>Checked firewall using ufw.</li>
</ol>
<blockquote>
<p>$sudo ufw</p>
</blockquote>
<p>status Shows inactive. My Laptop is connected directly to the Robot Controller via Ethernet cable.</p>
<hr />
<p>Update : I am adding the images of the robot, system and errors.</p>
<ol>
<li>Ros - <img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16748131007033823.png" alt="image description" />--<img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/1674813141318893.png" alt="image description" /></li>
<li>Error - <img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16748122067090713.png" alt="image description" /></li>
<li>Wired connection - <img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16748129515992781.png" alt="image description" /><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16748129677915998.png" alt="image description" /></li>
<li>Robot Teaching pendant - <img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16748128934875943.jpeg" alt="image description" /></li>
</ol>
<hr />
<p>Entire terminal when I run</p>
<blockquote>
<p>roslaunch dsr_control
dsr_moveit.launch model:=a0509
host:=192.168.137.100 mode:=real
port:=12345</p>
</blockquote>
<pre><code>anirban@anirban-X556UQK:~/catkin_ws$ roslaunch dsr_control dsr_moveit.launch model:=a0509 host:=192.168.137.100 mode:=real port:=12345
... logging to /home/anirban/.ros/log/83c6d0ae-9e26-11ed-8965-8fa9bb3397d0/roslaunch-anirban-X556UQK-6161.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
xacro: in-order processing became default in ROS Melodic. You can drop the option.
started roslaunch server http://anirban-X556UQK:45415/
SUMMARY
========
PARAMETERS
* /dsr01a0509/command: True
* /dsr01a0509/dsr_joint1_position/joint: joint1
* /dsr01a0509/dsr_joint1_position/pid/d: 200.0
* /dsr01a0509/dsr_joint1_position/pid/i: 100.0
* /dsr01a0509/dsr_joint1_position/pid/i_clamp: 500
* /dsr01a0509/dsr_joint1_position/pid/p: 500.0
* /dsr01a0509/dsr_joint1_position/type: position_controll...
* /dsr01a0509/dsr_joint2_position/joint: joint2
* /dsr01a0509/dsr_joint2_position/pid/d: 250.0
* /dsr01a0509/dsr_joint2_position/pid/i: 100.0
* /dsr01a0509/dsr_joint2_position/pid/i_clamp: 500
* /dsr01a0509/dsr_joint2_position/pid/p: 500.0
* /dsr01a0509/dsr_joint2_position/type: position_controll...
* /dsr01a0509/dsr_joint3_position/joint: joint3
* /dsr01a0509/dsr_joint3_position/pid/d: 40.0
* /dsr01a0509/dsr_joint3_position/pid/i: 20.0
* /dsr01a0509/dsr_joint3_position/pid/i_clamp: 500
* /dsr01a0509/dsr_joint3_position/pid/p: 300.0
* /dsr01a0509/dsr_joint3_position/type: position_controll...
* /dsr01a0509/dsr_joint4_position/joint: joint4
* /dsr01a0509/dsr_joint4_position/pid/d: 40.0
* /dsr01a0509/dsr_joint4_position/pid/i: 0.0
* /dsr01a0509/dsr_joint4_position/pid/i_clamp: 500
* /dsr01a0509/dsr_joint4_position/pid/p: 100.0
* /dsr01a0509/dsr_joint4_position/type: position_controll...
* /dsr01a0509/dsr_joint5_position/joint: joint5
* /dsr01a0509/dsr_joint5_position/pid/d: 25.0
* /dsr01a0509/dsr_joint5_position/pid/i: 20.0
* /dsr01a0509/dsr_joint5_position/pid/i_clamp: 500
* /dsr01a0509/dsr_joint5_position/pid/p: 200.0
* /dsr01a0509/dsr_joint5_position/type: position_controll...
* /dsr01a0509/dsr_joint6_position/joint: joint6
* /dsr01a0509/dsr_joint6_position/pid/d: 25.0
* /dsr01a0509/dsr_joint6_position/pid/i: 20.0
* /dsr01a0509/dsr_joint6_position/pid/i_clamp: 500
* /dsr01a0509/dsr_joint6_position/pid/p: 300.0
* /dsr01a0509/dsr_joint6_position/type: position_controll...
* /dsr01a0509/dsr_joint_position_controller/joints: ['joint1', 'joint...
* /dsr01a0509/dsr_joint_position_controller/publish_rate: 20
* /dsr01a0509/dsr_joint_position_controller/type: position_controll...
* /dsr01a0509/dsr_joint_publisher/publish_rate: 150
* /dsr01a0509/dsr_joint_publisher/type: joint_state_contr...
* /dsr01a0509/dsr_joint_trajectory_controller/joints: ['joint1', 'joint...
* /dsr01a0509/dsr_joint_trajectory_controller/publish_rate: 20
* /dsr01a0509/dsr_joint_trajectory_controller/type: position_controll...
* /dsr01a0509/dsr_velocity_controller/angular/z/has_acceleration_limits: True
* /dsr01a0509/dsr_velocity_controller/angular/z/has_velocity_limits: True
* /dsr01a0509/dsr_velocity_controller/angular/z/max_acceleration: 6.0
* /dsr01a0509/dsr_velocity_controller/angular/z/max_velocity: 2.0
* /dsr01a0509/dsr_velocity_controller/base_frame_id: base_link
* /dsr01a0509/dsr_velocity_controller/cmd_vel_timeout: 0.25
* /dsr01a0509/dsr_velocity_controller/enable_odom_tf: False
* /dsr01a0509/dsr_velocity_controller/estimate_velocity_from_position: False
* /dsr01a0509/dsr_velocity_controller/left_wheel: ['front_left_whee...
* /dsr01a0509/dsr_velocity_controller/linear/x/has_acceleration_limits: True
* /dsr01a0509/dsr_velocity_controller/linear/x/has_velocity_limits: True
* /dsr01a0509/dsr_velocity_controller/linear/x/max_acceleration: 3.0
* /dsr01a0509/dsr_velocity_controller/linear/x/max_velocity: 1.0
* /dsr01a0509/dsr_velocity_controller/pose_covariance_diagonal: [0.001, 0.001, 0....
* /dsr01a0509/dsr_velocity_controller/publish_rate: 50
* /dsr01a0509/dsr_velocity_controller/right_wheel: ['front_right_whe...
* /dsr01a0509/dsr_velocity_controller/twist_covariance_diagonal: [0.001, 0.001, 0....
* /dsr01a0509/dsr_velocity_controller/type: diff_drive_contro...
* /dsr01a0509/dsr_velocity_controller/wheel_radius_multiplier: 1.0
* /dsr01a0509/dsr_velocity_controller/wheel_separation_multiplier: 1.875
* /dsr01a0509/gripper: none
* /dsr01a0509/host: 192.168.137.100
* /dsr01a0509/mobile: none
* /dsr01a0509/mode: real
* /dsr01a0509/model: a0509
* /dsr01a0509/move_group/allow_trajectory_execution: True
* /dsr01a0509/move_group/arm/longest_valid_segment_fraction: 0.005
* /dsr01a0509/move_group/arm/planner_configs: ['SBL', 'EST', 'L...
* /dsr01a0509/move_group/arm/projection_evaluator: joints(joint1,joi...
* /dsr01a0509/move_group/capabilities:
* /dsr01a0509/move_group/controller_list: [{'name': 'dsr_jo...
* /dsr01a0509/move_group/controller_manager_name: /
* /dsr01a0509/move_group/controller_manager_ns: /
* /dsr01a0509/move_group/disable_capabilities:
* /dsr01a0509/move_group/jiggle_fraction: 0.05
* /dsr01a0509/move_group/max_range: 5.0
* /dsr01a0509/move_group/max_safe_path_cost: 1
* /dsr01a0509/move_group/moveit_controller_manager: moveit_simple_con...
* /dsr01a0509/move_group/moveit_manage_controllers: True
* /dsr01a0509/move_group/octomap_resolution: 0.025
* /dsr01a0509/move_group/planner_configs/BFMT/balanced: 0
* /dsr01a0509/move_group/planner_configs/BFMT/cache_cc: 1
* /dsr01a0509/move_group/planner_configs/BFMT/extended_fmt: 1
* /dsr01a0509/move_group/planner_configs/BFMT/heuristics: 1
* /dsr01a0509/move_group/planner_configs/BFMT/nearest_k: 1
* /dsr01a0509/move_group/planner_configs/BFMT/num_samples: 1000
* /dsr01a0509/move_group/planner_configs/BFMT/optimality: 1
* /dsr01a0509/move_group/planner_configs/BFMT/radius_multiplier: 1.0
* /dsr01a0509/move_group/planner_configs/BFMT/type: geometric::BFMT
* /dsr01a0509/move_group/planner_configs/BKPIECE/border_fraction: 0.9
* /dsr01a0509/move_group/planner_configs/BKPIECE/failed_expansion_score_factor: 0.5
* /dsr01a0509/move_group/planner_configs/BKPIECE/min_valid_path_fraction: 0.5
* /dsr01a0509/move_group/planner_configs/BKPIECE/range: 0.0
* /dsr01a0509/move_group/planner_configs/BKPIECE/type: geometric::BKPIECE
* /dsr01a0509/move_group/planner_configs/BiEST/range: 0.0
* /dsr01a0509/move_group/planner_configs/BiEST/type: geometric::BiEST
* /dsr01a0509/move_group/planner_configs/BiTRRT/cost_threshold: 1e300
* /dsr01a0509/move_group/planner_configs/BiTRRT/frountier_node_ratio: 0.1
* /dsr01a0509/move_group/planner_configs/BiTRRT/frountier_threshold: 0.0
* /dsr01a0509/move_group/planner_configs/BiTRRT/init_temperature: 100
* /dsr01a0509/move_group/planner_configs/BiTRRT/range: 0.0
* /dsr01a0509/move_group/planner_configs/BiTRRT/temp_change_factor: 0.1
* /dsr01a0509/move_group/planner_configs/BiTRRT/type: geometric::BiTRRT
* /dsr01a0509/move_group/planner_configs/EST/goal_bias: 0.05
* /dsr01a0509/move_group/planner_configs/EST/range: 0.0
* /dsr01a0509/move_group/planner_configs/EST/type: geometric::EST
* /dsr01a0509/move_group/planner_configs/FMT/cache_cc: 1
* /dsr01a0509/move_group/planner_configs/FMT/extended_fmt: 1
* /dsr01a0509/move_group/planner_configs/FMT/heuristics: 0
* /dsr01a0509/move_group/planner_configs/FMT/nearest_k: 1
* /dsr01a0509/move_group/planner_configs/FMT/num_samples: 1000
* /dsr01a0509/move_group/planner_configs/FMT/radius_multiplier: 1.1
* /dsr01a0509/move_group/planner_configs/FMT/type: geometric::FMT
* /dsr01a0509/move_group/planner_configs/KPIECE/border_fraction: 0.9
* /dsr01a0509/move_group/planner_configs/KPIECE/failed_expansion_score_factor: 0.5
* /dsr01a0509/move_group/planner_configs/KPIECE/goal_bias: 0.05
* /dsr01a0509/move_group/planner_configs/KPIECE/min_valid_path_fraction: 0.5
* /dsr01a0509/move_group/planner_configs/KPIECE/range: 0.0
* /dsr01a0509/move_group/planner_configs/KPIECE/type: geometric::KPIECE
* /dsr01a0509/move_group/planner_configs/LBKPIECE/border_fraction: 0.9
* /dsr01a0509/move_group/planner_configs/LBKPIECE/min_valid_path_fraction: 0.5
* /dsr01a0509/move_group/planner_configs/LBKPIECE/range: 0.0
* /dsr01a0509/move_group/planner_configs/LBKPIECE/type: geometric::LBKPIECE
* /dsr01a0509/move_group/planner_configs/LBTRRT/epsilon: 0.4
* /dsr01a0509/move_group/planner_configs/LBTRRT/goal_bias: 0.05
* /dsr01a0509/move_group/planner_configs/LBTRRT/range: 0.0
* /dsr01a0509/move_group/planner_configs/LBTRRT/type: geometric::LBTRRT
* /dsr01a0509/move_group/planner_configs/LazyPRM/range: 0.0
* /dsr01a0509/move_group/planner_configs/LazyPRM/type: geometric::LazyPRM
* /dsr01a0509/move_group/planner_configs/LazyPRMstar/type: geometric::LazyPR...
* /dsr01a0509/move_group/planner_configs/PDST/type: geometric::PDST
* /dsr01a0509/move_group/planner_configs/PRM/max_nearest_neighbors: 10
* /dsr01a0509/move_group/planner_configs/PRM/type: geometric::PRM
* /dsr01a0509/move_group/planner_configs/PRMstar/type: geometric::PRMstar
* /dsr01a0509/move_group/planner_configs/ProjEST/goal_bias: 0.05
* /dsr01a0509/move_group/planner_configs/ProjEST/range: 0.0
* /dsr01a0509/move_group/planner_configs/ProjEST/type: geometric::ProjEST
* /dsr01a0509/move_group/planner_configs/RRT/goal_bias: 0.05
* /dsr01a0509/move_group/planner_configs/RRT/range: 0.0
* /dsr01a0509/move_group/planner_configs/RRT/type: geometric::RRT
* /dsr01a0509/move_group/planner_configs/RRTConnect/range: 0.0
* /dsr01a0509/move_group/planner_configs/RRTConnect/type: geometric::RRTCon...
* /dsr01a0509/move_group/planner_configs/RRTstar/delay_collision_checking: 1
* /dsr01a0509/move_group/planner_configs/RRTstar/goal_bias: 0.05
* /dsr01a0509/move_group/planner_configs/RRTstar/range: 0.0
* /dsr01a0509/move_group/planner_configs/RRTstar/type: geometric::RRTstar
* /dsr01a0509/move_group/planner_configs/SBL/range: 0.0
* /dsr01a0509/move_group/planner_configs/SBL/type: geometric::SBL
* /dsr01a0509/move_group/planner_configs/SPARS/dense_delta_fraction: 0.001
* /dsr01a0509/move_group/planner_configs/SPARS/max_failures: 1000
* /dsr01a0509/move_group/planner_configs/SPARS/sparse_delta_fraction: 0.25
* /dsr01a0509/move_group/planner_configs/SPARS/stretch_factor: 3.0
* /dsr01a0509/move_group/planner_configs/SPARS/type: geometric::SPARS
* /dsr01a0509/move_group/planner_configs/SPARStwo/dense_delta_fraction: 0.001
* /dsr01a0509/move_group/planner_configs/SPARStwo/max_failures: 5000
* /dsr01a0509/move_group/planner_configs/SPARStwo/sparse_delta_fraction: 0.25
* /dsr01a0509/move_group/planner_configs/SPARStwo/stretch_factor: 3.0
* /dsr01a0509/move_group/planner_configs/SPARStwo/type: geometric::SPARStwo
* /dsr01a0509/move_group/planner_configs/STRIDE/degree: 16
* /dsr01a0509/move_group/planner_configs/STRIDE/estimated_dimension: 0.0
* /dsr01a0509/move_group/planner_configs/STRIDE/goal_bias: 0.05
* /dsr01a0509/move_group/planner_configs/STRIDE/max_degree: 18
* /dsr01a0509/move_group/planner_configs/STRIDE/max_pts_per_leaf: 6
* /dsr01a0509/move_group/planner_configs/STRIDE/min_degree: 12
* /dsr01a0509/move_group/planner_configs/STRIDE/min_valid_path_fraction: 0.2
* /dsr01a0509/move_group/planner_configs/STRIDE/range: 0.0
* /dsr01a0509/move_group/planner_configs/STRIDE/type: geometric::STRIDE
* /dsr01a0509/move_group/planner_configs/STRIDE/use_projected_distance: 0
* /dsr01a0509/move_group/planner_configs/TRRT/frountierNodeRatio: 0.1
* /dsr01a0509/move_group/planner_configs/TRRT/frountier_threshold: 0.0
* /dsr01a0509/move_group/planner_configs/TRRT/goal_bias: 0.05
* /dsr01a0509/move_group/planner_configs/TRRT/init_temperature: 10e-6
* /dsr01a0509/move_group/planner_configs/TRRT/k_constant: 0.0
* /dsr01a0509/move_group/planner_configs/TRRT/max_states_failed: 10
* /dsr01a0509/move_group/planner_configs/TRRT/min_temperature: 10e-10
* /dsr01a0509/move_group/planner_configs/TRRT/range: 0.0
* /dsr01a0509/move_group/planner_configs/TRRT/temp_change_factor: 2.0
* /dsr01a0509/move_group/planner_configs/TRRT/type: geometric::TRRT
* /dsr01a0509/move_group/planning_plugin: ompl_interface/OM...
* /dsr01a0509/move_group/planning_scene_monitor/publish_geometry_updates: True
* /dsr01a0509/move_group/planning_scene_monitor/publish_planning_scene: True
* /dsr01a0509/move_group/planning_scene_monitor/publish_state_updates: True
* /dsr01a0509/move_group/planning_scene_monitor/publish_transforms_updates: True
* /dsr01a0509/move_group/request_adapters: default_planner_r...
* /dsr01a0509/move_group/start_state_max_bounds_error: 0.1
* /dsr01a0509/move_group/trajectory_execution/allowed_execution_duration_scaling: 1.2
* /dsr01a0509/move_group/trajectory_execution/allowed_goal_duration_margin: 0.5
* /dsr01a0509/move_group/trajectory_execution/allowed_start_tolerance: 0.01
* /dsr01a0509/move_group/use_controller_manager: True
* /dsr01a0509/name: dsr01
* /dsr01a0509/port: 12345
* /dsr01a0509/rate: 10
* /dsr01a0509/robot_description: <?xml version="1....
* /dsr01a0509/robot_description_kinematics/arm/kinematics_solver: kdl_kinematics_pl...
* /dsr01a0509/robot_description_kinematics/arm/kinematics_solver_attempts: 5
* /dsr01a0509/robot_description_kinematics/arm/kinematics_solver_search_resolution: 0.005
* /dsr01a0509/robot_description_kinematics/arm/kinematics_solver_timeout: 0.05
* /dsr01a0509/robot_description_planning/joint_limits/joint1/has_acceleration_limits: False
* /dsr01a0509/robot_description_planning/joint_limits/joint1/has_velocity_limits: True
* /dsr01a0509/robot_description_planning/joint_limits/joint1/max_acceleration: 0
* /dsr01a0509/robot_description_planning/joint_limits/joint1/max_velocity: 2.094
* /dsr01a0509/robot_description_planning/joint_limits/joint2/has_acceleration_limits: False
* /dsr01a0509/robot_description_planning/joint_limits/joint2/has_velocity_limits: True
* /dsr01a0509/robot_description_planning/joint_limits/joint2/max_acceleration: 0
* /dsr01a0509/robot_description_planning/joint_limits/joint2/max_velocity: 2.094
* /dsr01a0509/robot_description_planning/joint_limits/joint3/has_acceleration_limits: False
* /dsr01a0509/robot_description_planning/joint_limits/joint3/has_velocity_limits: True
* /dsr01a0509/robot_description_planning/joint_limits/joint3/max_acceleration: 0
* /dsr01a0509/robot_description_planning/joint_limits/joint3/max_velocity: 3.142
* /dsr01a0509/robot_description_planning/joint_limits/joint4/has_acceleration_limits: False
* /dsr01a0509/robot_description_planning/joint_limits/joint4/has_velocity_limits: True
* /dsr01a0509/robot_description_planning/joint_limits/joint4/max_acceleration: 0
* /dsr01a0509/robot_description_planning/joint_limits/joint4/max_velocity: 3.927
* /dsr01a0509/robot_description_planning/joint_limits/joint5/has_acceleration_limits: False
* /dsr01a0509/robot_description_planning/joint_limits/joint5/has_velocity_limits: True
* /dsr01a0509/robot_description_planning/joint_limits/joint5/max_acceleration: 0
* /dsr01a0509/robot_description_planning/joint_limits/joint5/max_velocity: 3.927
* /dsr01a0509/robot_description_planning/joint_limits/joint6/has_acceleration_limits: False
* /dsr01a0509/robot_description_planning/joint_limits/joint6/has_velocity_limits: True
* /dsr01a0509/robot_description_planning/joint_limits/joint6/max_acceleration: 0
* /dsr01a0509/robot_description_planning/joint_limits/joint6/max_velocity: 3.927
* /dsr01a0509/robot_description_semantic: <?xml version="1....
* /dsr01a0509/rviz_anirban_X556UQK_6161_3195294438742091615/arm/kinematics_solver: kdl_kinematics_pl...
* /dsr01a0509/rviz_anirban_X556UQK_6161_3195294438742091615/arm/kinematics_solver_attempts: 5
* /dsr01a0509/rviz_anirban_X556UQK_6161_3195294438742091615/arm/kinematics_solver_search_resolution: 0.005
* /dsr01a0509/rviz_anirban_X556UQK_6161_3195294438742091615/arm/kinematics_solver_timeout: 0.05
* /dsr01a0509/standby: 5000
* /rosdistro: noetic
* /rosversion: 1.15.15
NODES
/
dsr01a0509 (dsr_control/dsr_control_node)
/dsr01a0509/
controller_spawner (controller_manager/spawner)
move_group (moveit_ros_move_group/move_group)
robot_state_publisher (robot_state_publisher/robot_state_publisher)
rviz_anirban_X556UQK_6161_3195294438742091615 (rviz/rviz)
auto-starting new master
process[master]: started with pid [6171]
ROS_MASTER_URI=http://localhost:11311
setting /run_id to 83c6d0ae-9e26-11ed-8965-8fa9bb3397d0
process[rosout-1]: started with pid [6181]
started core service [/rosout]
process[dsr01a0509/controller_spawner-2]: started with pid [6188]
process[dsr01a0509-3]: started with pid [6189]
process[dsr01a0509/robot_state_publisher-4]: started with pid [6190]
process[dsr01a0509/move_group-5]: started with pid [6191]
[ INFO] [1674812378.633075970]: rate is 10
[ INFO] [1674812378.640493720]: name_space is dsr01, a0509
[ INFO] [1674812378.640541798]: [dsr_hw_interface] constructed
process[dsr01a0509/rviz_anirban_X556UQK_6161_3195294438742091615-6]: started with pid [6197]
[ WARN] [1674812378.707470299]: Falling back to using the move_group node's namespace (deprecated Melodic behavior).
[ INFO] [1674812378.719049842]: Loading robot model 'a0509'...
[ INFO] [1674812378.719103631]: No root/virtual joint specified in SRDF. Assuming fixed joint
[ WARN] [1674812378.719174720]: Link base_0 has visual geometry but no collision geometry. Collision geometry will be left empty. Fix your URDF file by explicitly specifying collision geometry.
[ WARN] [1674812378.719265361]: Link link3 has visual geometry but no collision geometry. Collision geometry will be left empty. Fix your URDF file by explicitly specifying collision geometry.
[ WARN] [1674812378.719295289]: Link link6 has visual geometry but no collision geometry. Collision geometry will be left empty. Fix your URDF file by explicitly specifying collision geometry.
[ WARN] [1674812378.742293413]: Kinematics solver doesn't support #attempts anymore, but only a timeout.
Please remove the parameter '/dsr01a0509/robot_description_kinematics/arm/kinematics_solver_attempts' from your configuration.
[ INFO] [1674812378.805409208]: [dsr_hw_interface] init() ==> setup callback fucntion
[ INFO] [1674812378.805450706]: INIT@@@@@@@@@@@@@@@@@@@@@@@@@
[ INFO] [1674812378.805469254]: [dsr_hw_interface] init() ==> arm is standby
[ INFO] [1674812378.825407692]: Publishing maintained planning scene on 'monitored_planning_scene'
[ INFO] [1674812378.828823888]: host 192.168.137.100, port=12345 bCommand: 1, mode: real
Connection refused
[ERROR] [1674812378.829097250]: [dsr_control] Error initializing robot
[ INFO] [1674812378.829458459]: Listening to 'joint_states' for joint states
[ INFO] [1674812378.840566307]: Listening to '/dsr01a0509/attached_collision_object' for attached collision objects
[ INFO] [1674812378.840657679]: Starting planning scene monitor
[ INFO] [1674812378.843513825]: Listening to '/dsr01a0509/planning_scene'
[ INFO] [1674812378.843581176]: Starting world geometry update monitor for collision objects, attached objects, octomap updates.
[ INFO] [1674812378.845703507]: Listening to '/dsr01a0509/collision_object'
[ INFO] [1674812378.847755078]: Listening to '/dsr01a0509/planning_scene_world' for planning scene world geometry
[ INFO] [1674812378.848611374]: No 3D sensor plugin(s) defined for octomap updates
[ INFO] [1674812378.849754565]: Loading planning pipeline ''
[dsr01a0509-3] process has died [pid 6189, exit code 255, cmd /home/anirban/catkin_ws/devel/lib/dsr_control/dsr_control_node __name:=dsr01a0509 __log:=/home/anirban/.ros/log/83c6d0ae-9e26-11ed-8965-8fa9bb3397d0/dsr01a0509-3.log].
log file: /home/anirban/.ros/log/83c6d0ae-9e26-11ed-8965-8fa9bb3397d0/dsr01a0509-3*.log
[ INFO] [1674812378.907974174]: rviz version 1.14.19
[ INFO] [1674812378.908026003]: compiled against Qt version 5.12.8
[ INFO] [1674812378.908055888]: compiled against OGRE version 1.9.0 (Ghadamon)
[ INFO] [1674812378.911719435]: Using planning interface 'OMPL'
[ INFO] [1674812378.916463332]: Param 'default_workspace_bounds' was not set. Using default value: 10
[ INFO] [1674812378.917006591]: Param 'start_state_max_bounds_error' was set to 0.1
[ INFO] [1674812378.917779770]: Param 'start_state_max_dt' was not set. Using default value: 0.5
[ INFO] [1674812378.918430042]: Param 'start_state_max_dt' was not set. Using default value: 0.5
[ INFO] [1674812378.919572173]: Param 'jiggle_fraction' was set to 0.05
[ INFO] [1674812378.920528155]: Param 'max_sampling_attempts' was not set. Using default value: 100
[ INFO] [1674812378.920646468]: Using planning request adapter 'Add Time Parameterization'
[ INFO] [1674812378.920694836]: Using planning request adapter 'Fix Workspace Bounds'
[ INFO] [1674812378.920732625]: Using planning request adapter 'Fix Start State Bounds'
[ INFO] [1674812378.920774423]: Using planning request adapter 'Fix Start State In Collision'
[ INFO] [1674812378.920820114]: Using planning request adapter 'Fix Start State Path Constraints'
[ INFO] [1674812378.922042981]: Forcing OpenGl version 0.
[INFO] [1674812379.068318]: Controller Spawner: Waiting for service controller_manager/load_controller
[ INFO] [1674812379.359125451]: Stereo is NOT SUPPORTED
[ INFO] [1674812379.359261255]: OpenGL device: Mesa Intel(R) HD Graphics 620 (KBL GT2)
[ INFO] [1674812379.359367437]: OpenGl version: 4.6 (GLSL 4.6) limited to GLSL 1.4 on Mesa system.
[ INFO] [1674812382.690787682]: Loading robot model 'a0509'...
[ INFO] [1674812382.690941669]: No root/virtual joint specified in SRDF. Assuming fixed joint
[ WARN] [1674812382.691338338]: Link base_0 has visual geometry but no collision geometry. Collision geometry will be left empty. Fix your URDF file by explicitly specifying collision geometry.
[ WARN] [1674812382.691590195]: Link link3 has visual geometry but no collision geometry. Collision geometry will be left empty. Fix your URDF file by explicitly specifying collision geometry.
[ WARN] [1674812382.691863317]: Link link6 has visual geometry but no collision geometry. Collision geometry will be left empty. Fix your URDF file by explicitly specifying collision geometry.
[ WARN] [1674812382.710910562]: Kinematics solver doesn't support #attempts anymore, but only a timeout.
Please remove the parameter '/dsr01a0509/rviz_anirban_X556UQK_6161_3195294438742091615/arm/kinematics_solver_attempts' from your configuration.
[ INFO] [1674812382.782024968]: Starting planning scene monitor
[ INFO] [1674812382.784485349]: Listening to '/dsr01a0509/move_group/monitored_planning_scene'
[ INFO] [1674812382.997369147]: waitForService: Service [/dsr01a0509/get_planning_scene] has not been advertised, waiting...
[ WARN] [1674812383.941784903]: Waiting for dsr_joint_trajectory_controller/follow_joint_trajectory to come up
[ INFO] [1674812388.011057199]: Failed to call service get_planning_scene, have you launched move_group or called psm.providePlanningSceneService()?
[ INFO] [1674812388.011613888]: Constructing new MoveGroup connection for group 'arm' in namespace ''
[ WARN] [1674812389.942170994]: Waiting for dsr_joint_trajectory_controller/follow_joint_trajectory to come up
[ERROR] [1674812395.942670551]: Action client not connected: dsr_joint_trajectory_controller/follow_joint_trajectory
[ INFO] [1674812395.960345668]: Returned 0 controllers in list
[ INFO] [1674812395.977766825]: Trajectory execution is managing controllers
[ INFO] [1674812395.977804800]: MoveGroup debug mode is ON
Loading 'move_group/ApplyPlanningSceneService'...
Loading 'move_group/ClearOctomapService'...
Loading 'move_group/MoveGroupCartesianPathService'...
Loading 'move_group/MoveGroupExecuteTrajectoryAction'...
Loading 'move_group/MoveGroupGetPlanningSceneService'...
Loading 'move_group/MoveGroupKinematicsService'...
Loading 'move_group/MoveGroupMoveAction'...
Loading 'move_group/MoveGroupPickPlaceAction'...
Loading 'move_group/MoveGroupPlanService'...
Loading 'move_group/MoveGroupQueryPlannersService'...
Loading 'move_group/MoveGroupStateValidationService'...
[ INFO] [1674812396.037792111]:
********************************************************
* MoveGroup using:
* - ApplyPlanningSceneService
* - ClearOctomapService
* - CartesianPathService
* - ExecuteTrajectoryAction
* - GetPlanningSceneService
* - KinematicsService
* - MoveAction
* - PickPlaceAction
* - MotionPlanService
* - QueryPlannersService
* - StateValidationService
********************************************************
[ INFO] [1674812396.038301816]: MoveGroup context using planning plugin ompl_interface/OMPLPlanner
[ INFO] [1674812396.038343971]: MoveGroup context initialization complete
You can start planning now!
[ INFO] [1674812397.207668856]: Ready to take commands for planning group arm.
[WARN] [1674812409.075185]: Controller Spawner couldn't find the expected controller_manager ROS interface.
[dsr01a0509/controller_spawner-2] process has finished cleanly
log file: /home/anirban/.ros/log/83c6d0ae-9e26-11ed-8965-8fa9bb3397d0/dsr01a0509-controller_spawner-2*.log
^C[dsr01a0509/rviz_anirban_X556UQK_6161_3195294438742091615-6] killing on exit
[dsr01a0509/move_group-5] killing on exit
[dsr01a0509/robot_state_publisher-4] killing on exit
[rosout-1] killing on exit
[master] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done
</code></pre>
<hr />
<p><a href="https://answers.ros.org/question/411605/error-when-connecting-doosan-robot-arm/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/134859/anirban/" rel="nofollow noreferrer">Anirban</a> on ROS Answers with karma: 23 on 2023-01-20</p>
<p>Post score: 1</p>
|
Error when Connecting Doosan robot arm
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>As far as my experience is, It does not make difference if you unregistered the pub/sub before terminating the node. As node terminates, it will stop publishing or subscribing to the topic until and unless there is another node publishing or subscribing to the same topic.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/73435/aarsh_t/" rel="nofollow noreferrer">aarsh_t</a> with karma: 328 on 2023-01-20</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 2</p>
|
102953
|
2023-01-20T07:47:05.000
|
|ros|rospy|roscpp|publisher|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hi everyone.</p>
<p>So my question is pretty much what the title is. Is it good practice or even necessary to unregister from ROS publishers or subscribers I used inside my ROS node before terminating the node from the script?</p>
<p>Is there any difference if my ROS node is written in python or c++?</p>
<p>Thanks in advance.</p>
<hr />
<p><a href="https://answers.ros.org/question/411610/should-i-unregister-from-publishers/subscribers-when-i-terminate-a-ros-node-by-exiting-the-script?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/70606/ifx13/" rel="nofollow noreferrer">Ifx13</a> on ROS Answers with karma: 54 on 2023-01-20</p>
<p>Post score: 0</p>
|
Should I unregister from Publishers/Subscribers when I terminate a ROS node by exiting the script?
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hello @reuge,</p>
<blockquote>
<p>Being new to Moveit, I am finding trouble to attach the gripper to the robot to be able to control it and plan accordingly.</p>
</blockquote>
<p>What I would suggest is to first create xacro /urdf and join the gripper init. Have a look at <a href="http://wiki.ros.org/urdf/Tutorials" rel="nofollow noreferrer">urdf tutorials</a> Have a look at the tutorials for creating and joining the link.</p>
<blockquote>
<p>Looking at the robot's URDF, there's a part that mentions "elfin_dummy_gripper", I am assuming this the part I should edit? Any help is appreciated.</p>
</blockquote>
<p>Yes, You are true you need to create and join the link with the end-effector.</p>
<blockquote>
<p>Being new to Moveit, I am finding trouble to attach the gripper to the robot to be able to control it and plan accordingly.</p>
</blockquote>
<p><a href="https://ros-planning.github.io/moveit_tutorials/doc/setup_assistant/setup_assistant_tutorial.html" rel="nofollow noreferrer">https://ros-planning.github.io/moveit_tutorials/doc/setup_assistant/setup_assistant_tutorial.html</a></p>
<p>You can have an option in move it while building the package in Add planning group.</p>
<p><a href="https://ros-planning.github.io/moveit_tutorials/doc/setup_assistant/setup_assistant_tutorial.html#step-4-add-planning-groups" rel="nofollow noreferrer">https://ros-planning.github.io/moveit_tutorials/doc/setup_assistant/setup_assistant_tutorial.html#step-4-add-planning-groups</a></p>
<p>feel free to drop a comment if any questions.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/63046/ranjit-kathiriya/" rel="nofollow noreferrer">Ranjit Kathiriya</a> with karma: 1622 on 2023-01-24</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
|
102955
|
2023-01-22T09:38:46.000
|
|simulation|manipulator|moveit|gripper|motionplanning|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hello! I am simulating for a university project, the Elfin 5 robot arm which package can be found <a href="https://github.com/hans-robot/elfin_robot/tree/noetic" rel="nofollow noreferrer">here</a> along with a gripper which package is found <a href="https://github.com/juandpenan/onrobot_2FG7_gripper_description" rel="nofollow noreferrer">here</a>.
Being new to Moveit, I am finding trouble to attach the gripper to the robot to be able to control it and plan accordingly.</p>
<p>Looking at the robot's <a href="https://github.com/hans-robot/elfin_robot/blob/noetic/elfin_description/urdf/elfin5.urdf.xacro" rel="nofollow noreferrer">URDF</a>, there's a part that mentions "elfin_dummy_gripper", I am assuming this the part I should edit? Any help is appreciated.</p>
<p>Thanks!</p>
<hr />
<p><a href="https://answers.ros.org/question/411677/how-to-add-gripper-to-robot-arm-and-plan-according-to-the-end-effector-on-moveit/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/135077/reuge/" rel="nofollow noreferrer">reuge</a> on ROS Answers with karma: 1 on 2023-01-22</p>
<p>Post score: 0</p>
|
How to add gripper to robot arm and plan according to the end effector on Moveit
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Almost definitely just a QoS issue. Maps are served over transient local connection types which are incompatible with reliable connection types. Just change the QoS profile in the rviz dropdown (or is properly served in our rviz configuration for Nav2).</p>
<p>If the file failed to load, you'd see something about it and the costmap layers would not be displaying the map.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/25940/stevemacenski/" rel="nofollow noreferrer">stevemacenski</a> with karma: 8272 on 2023-01-23</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 2</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/26871/billy/" rel="nofollow noreferrer">billy</a> on 2023-01-23</strong>:<br />
Thank you Steve.</p>
<p>I eventually got a stand alone map server working and it also didn't show up in RVIZ2 but I was able to confirm the map was on the map topic. So I moved on and started looking at QoS after finding this question: <a href="https://answers.ros.org/question/343724/how-can-i-visualize-a-map-on-rviz2-ros2-eloquent/" rel="nofollow noreferrer">https://answers.ros.org/question/343724/how-can-i-visualize-a-map-on-rviz2-ros2-eloquent/</a> where you mention QoS. I couldn't find where the QoS for map_server was listed, so set all the paramaters in RVIZ2 map topic to <code>'System Default'</code> and that corrected it.</p>
<p>For those wondering about CLI for map_server: <code>ros2 service call /map_server/load_map nav2_msgs/srv/LoadMap "{map_url: /home/path/map.yaml}"</code> which I found here: <a href="https://automaticaddison.com/how-to-load-a-new-map-for-multi-floor-navigation-using-ros-2/" rel="nofollow noreferrer">https://automaticaddison.com/how-to-load-a-new-map-for-multi-floor-navigation-using-ros-2/</a></p>
<p>Still not sure where to find the QoS settings but immediate issue solved.</p>
|
102957
|
2023-01-22T14:47:16.000
|
|ros2|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Ros2 Humble, new install of Ubuntu 22.04 on Intel desktop.</p>
<p>Working through NAV2 tutorials with real robot - custom.
Have successfully mapped the house multiple times using custom URDF and the following:</p>
<pre><code>ros2 launch robot_description display.launch.py
ros2 launch nav2_bringup navigation_launch.py
ros2 launch slam_toolbox online_async_launch.py
</code></pre>
<p>During the mapping, had zero issues with the map being built being served and and shown on RVIZ2.</p>
<p>With mapping done, attempting navigation the map server doesn't seem to work. The map frame is never issued and the map never shows on RVIZ, That attempt is using:</p>
<pre><code>ros2 launch nav2_bringup bringup_launch.py use_sim_time:=False autostart:=True map:='/home/b/map.yaml'
</code></pre>
<p>There is no issue with file path as the startup clearly finds and reads the map yaml and file:</p>
<pre><code>[component_container_isolated-1] [INFO] [1674403535.435682167] [map_server]: Configuring
[component_container_isolated-1] [INFO] [map_io]: Loading yaml file: /home/b/map.yaml
[component_container_isolated-1] [DEBUG] [map_io]: resolution: 0.05
[component_container_isolated-1] [DEBUG] [map_io]: origin[0]: -4.22
[component_container_isolated-1] [DEBUG] [map_io]: origin[1]: -4.81
[component_container_isolated-1] [DEBUG] [map_io]: origin[2]: 0
[component_container_isolated-1] [DEBUG] [map_io]: free_thresh: 0.25
[component_container_isolated-1] [DEBUG] [map_io]: occupied_thresh: 0.65
[component_container_isolated-1] [DEBUG] [map_io]: mode: trinary
[component_container_isolated-1] [DEBUG] [map_io]: negate: 0
[component_container_isolated-1] [INFO] [map_io]: Loading image_file: /home/b/map.pgm
[component_container_isolated-1] [INFO] [1674403535.438891662] [behavior_server]:
[component_container_isolated-1] behavior_server lifecycle node launched.
[component_container_isolated-1] Waiting on external lifecycle transitions to activate
[component_container_isolated-1] See https://design.ros2.org/articles/node_lifecycle.html for more information.
[component_container_isolated-1] [DEBUG] [map_io]: Read map /home/b/map.pgm: 266 X 230 map @ 0.05 m/cell
[component_container_isolated-1] [INFO] [1674403535.457025407] [map_server]: Activating
[component_container_isolated-1] [INFO] [1674403535.457180554] [amcl]: Received a 266 X 230 map @ 0.050 m/pix
[component_container_isolated-1] [INFO] [1674403535.457192287] [map_server]: Creating bond (map_server) to lifecycle manager.
[component_container_isolated-1] [INFO] [1674403535.570334635] [lifecycle_manager_localization]: Server map_server connected with bond.
[component_container_isolated-1] [INFO] [1674403535.587049624] [global_costmap.global_costmap]: Subscribing to the map topic (/map) with transient local durability
</code></pre>
<p>It looks like the costmap plugin gets the correct map:</p>
<pre><code>[component_container_isolated-1] [INFO] [1674403535.663900677] [global_costmap.global_costmap]: StaticLayer: Resizing costmap to 266 X 230 at 0.050000 m/pix
</code></pre>
<p>but eventually end up with repeating errors here complaining about 'map' frame not existing, and the map never shows up on the map topic. Looking at the TF frames there is also no 'map' frame shown.</p>
<pre><code>[component_container_isolated-1] [INFO] [1674403535.916757777] [global_costmap.global_costmap]: Timed out waiting for transform from base_link to map to become available, tf error: Invalid frame ID "map" passed to canTransform argument target_frame - frame does not exist
</code></pre>
<p>Things I've tried:</p>
<ul>
<li>I tried for hours to use a stand alone map server but never get past the configure stage with that.</li>
<li>Have remapped the house just in case the map file was corrupted, it looks fine in GIMP.</li>
<li>Have been careful to source everything.</li>
<li>The local cost map works and appears in RVIZ and can be seen updating as laser data changes.</li>
<li>I even tried adding a static transform from odom to map just to see if that was preventing the map from showing up on the 'map' topic.</li>
</ul>
<p>Really appreciate guidance with this.</p>
<hr />
<p><a href="https://answers.ros.org/question/411685/ros2-nav2-map-not-served---help-requested/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/26871/billy/" rel="nofollow noreferrer">billy</a> on ROS Answers with karma: 1850 on 2023-01-22</p>
<p>Post score: 0</p>
|
ROS2 NAV2 map not served - help requested
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hi there,
stderr is a common output in ROS2 when building. usually, it doesn't mean it hasn't built properly and is often related to displaying certain warnings and messages.
So, in most cases - you should be able to use whatever you built without any issues.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/57608/aibohphobia/" rel="nofollow noreferrer">AibohphobiA</a> with karma: 87 on 2023-01-23</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 2</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/135127/jonas_z/" rel="nofollow noreferrer">Jonas_Z</a> on 2023-01-23</strong>:<br />
Understood. Thank you so much for your answer!</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/57608/aibohphobia/" rel="nofollow noreferrer">AibohphobiA</a> on 2023-01-24</strong>:<br />
Would appreciate if you mark it answered. have a good one.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/135127/jonas_z/" rel="nofollow noreferrer">Jonas_Z</a> on 2023-01-24</strong>:<br />
Done. You too, have a good one!</p>
|
102959
|
2023-01-22T16:25:21.000
|
|ros2|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hi everyone,</p>
<p>I've been trying to build the workspace of MoveIt 2 with ROS 2 Humble. Following the tutorial, every time when I run <strong>colcon build --mixin release</strong> in the terminal, 2 packages always return the same error output, here is what I read in the shell:</p>
<pre><code>Starting >>> moveit_common
Starting >>> srdfdom
Starting >>> moveit_resources_panda_description
Starting >>> launch_param_builder
Starting >>> moveit_resources_fanuc_description
Starting >>> moveit_task_constructor_msgs
Starting >>> moveit_resources_pr2_description
Starting >>> moveit_resources_prbt_support
Starting >>> rosparam_shortcuts
Finished <<< moveit_common [0.27s]
Starting >>> rviz_marker_tools
Finished <<< moveit_resources_panda_description [0.29s]
Starting >>> moveit_resources_panda_moveit_config
Finished <<< moveit_resources_fanuc_description [0.30s]
Finished <<< moveit_resources_prbt_support [0.30s]
Finished <<< moveit_resources_pr2_description [0.31s]
Starting >>> moveit_resources_fanuc_moveit_config
Finished <<< rosparam_shortcuts [0.35s]
Finished <<< srdfdom [0.38s]
Finished <<< rviz_marker_tools [0.15s]
Finished <<< moveit_resources_panda_moveit_config [0.13s]
Starting >>> moveit_core
Finished <<< moveit_resources_fanuc_moveit_config [0.11s]
Starting >>> moveit_resources
Finished <<< moveit_resources [0.08s]
--- stderr: launch_param_builder
/usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
---
Finished <<< launch_param_builder [0.64s]
Starting >>> moveit_configs_utils
Finished <<< moveit_task_constructor_msgs [0.79s]
Finished <<< moveit_core [0.47s]
Starting >>> moveit_ros_occupancy_map_monitor
Starting >>> moveit_simple_controller_manager
Starting >>> moveit_resources_prbt_ikfast_manipulator_plugin
Starting >>> chomp_motion_planner
Starting >>> pilz_industrial_motion_planner_testutils
Finished <<< moveit_resources_prbt_ikfast_manipulator_plugin [0.12s]
Finished <<< moveit_simple_controller_manager [0.15s]
Finished <<< pilz_industrial_motion_planner_testutils [0.14s]
Starting >>> moveit_plugins
Starting >>> moveit_ros_control_interface
Finished <<< chomp_motion_planner [0.16s]
Finished <<< moveit_ros_occupancy_map_monitor [0.18s]
Starting >>> moveit_chomp_optimizer_adapter
Starting >>> moveit_planners_chomp
Starting >>> moveit_ros_planning
Finished <<< moveit_plugins [0.10s]
Finished <<< moveit_chomp_optimizer_adapter [0.13s]
Finished <<< moveit_ros_control_interface [0.18s]
Finished <<< moveit_planners_chomp [0.17s]
--- stderr: moveit_configs_utils
/usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
---
Finished <<< moveit_configs_utils [0.61s]
Finished <<< moveit_ros_planning [0.24s]
Starting >>> moveit_kinematics
Starting >>> moveit_ros_warehouse
Starting >>> moveit_ros_robot_interaction
Starting >>> moveit_planners_ompl
Starting >>> moveit_ros_perception
Starting >>> moveit_visual_tools
Finished <<< moveit_kinematics [0.18s]
Starting >>> moveit_ros_move_group
Finished <<< moveit_ros_robot_interaction [0.20s]
Finished <<< moveit_visual_tools [0.20s]
Finished <<< moveit_ros_warehouse [0.22s]
Starting >>> moveit_ros_benchmarks
Finished <<< moveit_ros_perception [0.23s]
Finished <<< moveit_planners_ompl [0.25s]
Finished <<< moveit_ros_benchmarks [0.14s]
Finished <<< moveit_ros_move_group [0.20s]
Starting >>> moveit_ros_planning_interface
Starting >>> moveit_resources_prbt_moveit_config
Finished <<< moveit_resources_prbt_moveit_config [0.07s]
Starting >>> moveit_resources_prbt_pg70_support
Finished <<< moveit_ros_planning_interface [0.14s]
Starting >>> moveit_ros_visualization
Starting >>> moveit_task_constructor_core
Starting >>> moveit_hybrid_planning
Starting >>> moveit_servo
Finished <<< moveit_resources_prbt_pg70_support [0.09s]
Starting >>> pilz_industrial_motion_planner
Finished <<< moveit_hybrid_planning [0.26s]
Finished <<< moveit_task_constructor_core [0.30s]
Starting >>> moveit_task_constructor_capabilities
Finished <<< moveit_servo [0.35s]
Finished <<< pilz_industrial_motion_planner [0.36s]
Starting >>> moveit_planners
Finished <<< moveit_task_constructor_capabilities [0.12s]
Starting >>> moveit_task_constructor_demo
Finished <<< moveit_ros_visualization [0.47s]
Starting >>> moveit_setup_framework
Starting >>> moveit_ros
Starting >>> moveit_task_constructor_visualization
Finished <<< moveit_planners [0.09s]
Starting >>> moveit_runtime
Finished <<< moveit_ros [0.11s]
Finished <<< moveit_runtime [0.10s]
Finished <<< moveit_task_constructor_demo [0.20s]
Finished <<< moveit_setup_framework [0.18s]
Starting >>> moveit_setup_app_plugins
Starting >>> moveit_setup_controllers
Starting >>> moveit_setup_core_plugins
Starting >>> moveit_setup_srdf_plugins
Finished <<< moveit_task_constructor_visualization [0.32s]
Finished <<< moveit_setup_core_plugins [0.20s]
Finished <<< moveit_setup_app_plugins [0.23s]
Finished <<< moveit_setup_controllers [0.28s]
Finished <<< moveit_setup_srdf_plugins [0.30s]
Starting >>> moveit_setup_assistant
Finished <<< moveit_setup_assistant [0.15s]
Starting >>> moveit
Finished <<< moveit [0.08s]
Starting >>> moveit2_tutorials
Finished <<< moveit2_tutorials [0.15s]
Summary: 55 packages finished [3.46s]
2 packages had stderr output: launch_param_builder moveit_configs_utils
</code></pre>
<p>Dose anyone know how to fix this?</p>
<p>Thanks a lot.</p>
<hr />
<p><a href="https://answers.ros.org/question/411686/error-building-workspace-of-moveit-2-(humble)/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/135127/jonas_z/" rel="nofollow noreferrer">Jonas_Z</a> on ROS Answers with karma: 5 on 2023-01-22</p>
<p>Post score: 0</p>
|
Error building workspace of MoveIt 2 (Humble)
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>No, this is not supported by Bloom at this time.</p>
<p>See <a href="https://discourse.ros.org/t/generating-dev-and-runtime-artefacts-from-ros-packages/12448" rel="nofollow noreferrer">Generating ‘dev’ and runtime artefacts from ROS packages</a> on ROS Discourse for a related discussion.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> with karma: 86574 on 2023-01-25</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
|
102961
|
2023-01-24T10:49:49.000
|
|ros|ros2|deb|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I have implemented a library with some functionalities. As an example, let's say <a href="https://bitbucket.org/apalomeriqua/library_cpp_package/src/master/" rel="nofollow noreferrer">this</a> is my library. Whenever I compile with:</p>
<pre><code>mkdir build
cmake ..
make
</code></pre>
<p>and install this library:</p>
<pre><code>sudo make install
</code></pre>
<p>another package can find it and use it.</p>
<p>Now I want to create Debian packages for this library. If I use the ROS approach (bloom) with:</p>
<pre><code>bloom-generate debian --os-name ubuntu --os-version jammy
fakeroot debian/rules binary
</code></pre>
<p>A binary package is created and if I install it everything looks ok. However, I want to create instead of one package, two, one for the runtime library and one for the development tools, in this way, clients that are not developing new apps on top of the library do not need to install all the headers, cmakes, etc.</p>
<p>Is there any way of doing such a thing? I would like to stick to ROS bloom as it simplifies a lot the packaging dependency (both runtime and build time).</p>
<hr />
<p><a href="https://answers.ros.org/question/411766/use-bloom-to-generate-a-deb-and-a--dev.deb-packages/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/1165/apalomer/" rel="nofollow noreferrer">apalomer</a> on ROS Answers with karma: 318 on 2023-01-24</p>
<p>Post score: 0</p>
|
Use bloom to generate a deb and a -dev.deb packages
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>You're executing a colcon operation in the root of the container's filesystem.</p>
<p>The default value for colcon's <code>--base-paths</code> argument is actually <code>.</code>, not <code>src</code>. This is why colcon marks the <code>build</code>, <code>install</code>, and <code>log</code> subdirectories of the workspace with <code>COLCON_IGNORE</code>.</p>
<p>You could modify the colcon invocation with <code>--base-paths src</code>, but it would be better to create an empty subdirectory in the container to to serve as the workspace rather than dumping all of these files directly in <code>/</code>.</p>
<p>To explain why this is failing, colcon is crawling the entire filesystem and finds things that look an awful lot like packages, and then it tries to build them and unsurprisingly fails to do so.</p>
<p><strong>EDIT:</strong> Here's the section of the installation instructions where a new directory is created for the workspace: <a href="https://docs.ros.org/en/rolling/Installation/Alternatives/Ubuntu-Development-Setup.html#get-ros-2-code" rel="nofollow noreferrer">https://docs.ros.org/en/rolling/Installation/Alternatives/Ubuntu-Development-Setup.html#get-ros-2-code</a></p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/3167/cottsay/" rel="nofollow noreferrer">cottsay</a> with karma: 311 on 2023-01-24</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/30659/achille/" rel="nofollow noreferrer">achille</a> on 2023-01-25</strong>:<br />
Great find, thanks! It's curious to me that the default isn't <code>src</code> but perhaps there's an explanation for that.</p>
|
102963
|
2023-01-24T14:22:18.000
|
|ros2|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I am trying to compile ROS2 from source on Docker (for development purposes) but am running into several issues while doing so. Any pointers at what might be wrong here?</p>
<ul>
<li>Operating System:
<ul>
<li>Ubuntu22.04 (Jammy)</li>
</ul>
</li>
<li>Installation type:
<ul>
<li>source</li>
</ul>
</li>
<li>Version or commit hash:
<ul>
<li><a href="https://github.com/ros2/ros2/commit/07c27c934a6a1269fec2828f4c1a4ff40430d44d" rel="nofollow noreferrer">ros2.repos commit</a></li>
</ul>
</li>
</ul>
<h4>Steps to reproduce issue</h4>
<p>Essentially follow the instructions at <a href="https://index.ros.org/doc/ros2/Installation/Rolling/Linux-Development-Setup/" rel="nofollow noreferrer">Linux Development Setup for Rolling</a>. I created a Dockerfile that executes these in <a href="https://gist.github.com/Achllle/e55a5f34c02720963898ef807ae396ac" rel="nofollow noreferrer">this gist</a></p>
<h4>Expected behavior</h4>
<p>Build completes and the example can be run inside the container</p>
<h4>Actual behavior</h4>
<p><code>colcon build --symlink-install</code> fails at <code>FortranCInterface</code> which seems to be a CMake dependency.</p>
<p>Before that, I get several variations of this error which seems unrelated:</p>
<pre><code>
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 10, in
import distutils.core
File "/usr/lib/python3/dist-packages/numpy/distutils/__init__.py", line 24, in
from . import ccompiler
File "/usr/lib/python3/dist-packages/numpy/distutils/ccompiler.py", line 9, in
from distutils.ccompiler import (
ImportError: cannot import name 'compiler_class' from partially initialized module 'distutils.ccompiler' (most likely due to a circular import) (/usr/lib/python3/dist-packages/numpy/distutils/ccompiler.py)
[1.143s] ERROR:colcon.colcon_core.package_identification:Exception in package identification extension 'python_setup_py' in 'lib/python3/dist-packages/numpy': Command '['/usr/bin/python3', '-c', "import sys;from setuptools.extern.packaging.specifiers import SpecifierSet;from distutils.core import run_setup;dist = run_setup( 'setup.py', script_args=('--dry-run',), stop_after='config');skip_keys = ('cmdclass', 'distclass', 'ext_modules', 'metadata');data = { key: value for key, value in dist.__dict__.items() if ( not key.startswith('_') and not callable(value) and key not in skip_keys and key not in dist.display_option_names )};data['metadata'] = { k: v for k, v in dist.metadata.__dict__.items() if k not in ('license_files', 'provides_extras')};sys.stdout.buffer.write(repr(data).encode('utf-8'))"]' returned non-zero exit status 1.
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/colcon_core/package_identification/__init__.py", line 142, in _identify
retval = extension.identify(_reused_descriptor_instance)
File "/usr/lib/python3/dist-packages/colcon_python_setup_py/package_identification/python_setup_py.py", line 48, in identify
config = get_setup_information(setup_py)
File "/usr/lib/python3/dist-packages/colcon_python_setup_py/package_identification/python_setup_py.py", line 241, in get_setup_information
_setup_information_cache[hashable_env] = _get_setup_information(
File "/usr/lib/python3/dist-packages/colcon_python_setup_py/package_identification/python_setup_py.py", line 281, in _get_setup_information
result = subprocess.run(
File "/usr/lib/python3.10/subprocess.py", line 524, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/usr/bin/python3', '-c', "import sys;from setuptools.extern.packaging.specifiers import SpecifierSet;from distutils.core import run_setup;dist = run_setup( 'setup.py', script_args=('--dry-run',), stop_after='config');skip_keys = ('cmdclass', 'distclass', 'ext_modules', 'metadata');data = { key: value for key, value in dist.__dict__.items() if ( not key.startswith('_') and not callable(value) and key not in skip_keys and key not in dist.display_option_names )};data['metadata'] = { k: v for k, v in dist.metadata.__dict__.items() if k not in ('license_files', 'provides_extras')};sys.stdout.buffer.write(repr(data).encode('utf-8'))"]' returned non-zero exit status 1.
</pre></code>
<p>Compilation finally fails with the following:</p>
<code>
Starting >>> IntelFortranImplicit
-- stderr: FortranCInterface
CMake Error at CMakeLists.txt:5 (project):
No CMAKE_Fortran_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment
variable "FC" or the CMake cache entry CMAKE_Fortran_COMPILER to the full
path to the compiler, or to the compiler name if it is in the PATH.
Failed </code>
<p>The same errors occur when using <code>humble</code> rather than <code>rolling</code>.</p>
<p>when I add <code>gfortran</code> to the <code>apt install</code> list, I get another error:</p>
<code>
Starting >>> lit
WARNING:colcon.colcon_cmake.task.cmake.build:Could not run installation step for package 'IntelFortranImplicit' because it has no 'install' target
Finished >> my-test-package
stderr: lit
CMake Warning (dev) in CMakeLists.txt: No project() command is present. The top-level CMakeLists.txt file must contain a literal, direct call to the project() command. Add a line of code such as project(ProjectName) near the top of the file, but after cmake_minimum_required(). CMake is pretending there is a "project(Project)" command on the first line.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Error at CMakeLists.txt:4 (configure_lit_site_cfg):
Unknown CMake command "configure_lit_site_cfg".
CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 3.22)
should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.
Failed </code>
<p>I don't know what <code>lit</code> or <code>my-test-package</code> are.</p>
<h4>Additional information</h4>
<ul>
<li>I couldn't determine what depends on Fortran with certainty and searching the <code>ros2</code> org didn't yield any results, so this issue might be elsewhere or with documentation.</li>
<li>I looked at the official docker images but they install the binary packages from <code>apt</code> rather than build from source.</li>
<li>question while I'm here: If I want to develop on one of the component libraries (say <code>rclpy</code>), is building everything from source the recommended approach? Is there a way to use the prebuilt docker images <code>ros:rolling</code> and then clone just <code>rclpy</code></li>
<li>related <a href="https://github.com/ros2/ros2/issues/1372" rel="nofollow noreferrer">issue on ros2 issue tracker</a></li>
</ul>
<hr />
<p><a href="https://answers.ros.org/question/411771/building-ros2-rolling-from-source:-issues-with-gfortran-/-lit/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/30659/achille/" rel="nofollow noreferrer">achille</a> on ROS Answers with karma: 464 on 2023-01-24</p>
<p>Post score: 0</p>
|
Building ROS2 Rolling from source: issues with gfortran / lit
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>This might be an open bug as per <a href="https://github.com/ros2/ros2cli/issues/672" rel="nofollow noreferrer">this issue</a>.</p>
<p>Try:</p>
<pre><code>ros2 daemon stop
ros2 daemon start
ros2 daemon status
</code></pre>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/30659/achille/" rel="nofollow noreferrer">achille</a> with karma: 464 on 2023-01-25</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/135348/harshahsrah/" rel="nofollow noreferrer">harshahsrah</a> on 2023-01-26</strong>:<br />
It works now, thank you</p>
|
102965
|
2023-01-25T06:29:29.000
|
|ros2|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I got this error while running "ros2 node list"</p>
<pre><code>File "/opt/ros/humble/bin/ros2", line 33, in <module>
sys.exit(load_entry_point('ros2cli==0.18.4', 'console_scripts', 'ros2')())
File "/opt/ros/humble/lib/python3.10/site-packages/ros2cli/cli.py", line 89, in main
rc = extension.main(parser=parser, args=args)
File "/opt/ros/humble/lib/python3.10/site-packages/ros2node/command/node.py", line 37, in main
return extension.main(args=args)
File "/opt/ros/humble/lib/python3.10/site-packages/ros2node/verb/list.py", line 38, in main
node_names = get_node_names(node=node, include_hidden_nodes=args.all)
File "/opt/ros/humble/lib/python3.10/site-packages/ros2node/api/__init__.py", line 60, in get_node_names
node_names_and_namespaces = node.get_node_names_and_namespaces()
File "/usr/lib/python3.10/xmlrpc/client.py", line 1122, in __call__
return self.__send(self.__name, args)
File "/usr/lib/python3.10/xmlrpc/client.py", line 1464, in __request
response = self.__transport.request(
File "/usr/lib/python3.10/xmlrpc/client.py", line 1166, in request
return self.single_request(host, handler, request_body, verbose)
File "/usr/lib/python3.10/xmlrpc/client.py", line 1182, in single_request
return self.parse_response(resp)
File "/usr/lib/python3.10/xmlrpc/client.py", line 1354, in parse_response
return u.close()
File "/usr/lib/python3.10/xmlrpc/client.py", line 668, in close
raise Fault(**self._stack[0])
xmlrpc.client.Fault: <Fault 1: "<class 'rclpy._rclpy_pybind11.InvalidHandle'>:cannot use Destroyable because destruction was requested">
</code></pre>
<hr />
<p><a href="https://answers.ros.org/question/411798/error-while-running-%27ros2-node-list%27/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/135348/harshahsrah/" rel="nofollow noreferrer">harshahsrah</a> on ROS Answers with karma: 3 on 2023-01-25</p>
<p>Post score: 0</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/30659/achille/" rel="nofollow noreferrer">achille</a> on 2023-01-25</strong>:<br />
welcome to ROS answers! Please consider formatting the error message (Ctrl-K) and specifying which version of ROS2 Humble you're running + how you installed (from source, debian package) and what platform you're one (e.g. Ubuntu Jammy). That way you can get faster and more specific help.</p>
|
error while running 'ros2 node list'
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Generally speaking, you should not put messages in the same package as the code using it as a best practice.</p>
<p>... but if you want to, you need to add a few extra lines <a href="https://github.com/cra-ros-pkg/robot_localization/blob/ros2/CMakeLists.txt#L77-L78" rel="nofollow noreferrer">https://github.com/cra-ros-pkg/robot_localization/blob/ros2/CMakeLists.txt#L77-L78</a> (so make sure to build the messages before the libraries).</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/25940/stevemacenski/" rel="nofollow noreferrer">stevemacenski</a> with karma: 8272 on 2023-01-26</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
|
102967
|
2023-01-26T07:45:34.000
|
|ros2|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hi there,
I am trying to integrate an existing functioning package with a custom message(so far it has been divided to two projects).</p>
<p>I am failing when trying to modify the CMakeLists with the following interface:</p>
<pre><code>rosidl_generate_interfaces(<span class="math-container">${PROJECT_NAME}
$</span>{msg_files}
)
</code></pre>
<p>I am getting the following error:</p>
<pre><code>CMake Error at /opt/ros/humble/share/rosidl_cmake/cmake/rosidl_generate_interfaces.cmake:213 (add_custom_target):
add_custom_target cannot create target "myPackage" because another target
with the same name already exists. The existing target is a shared library
created in source directory "/home/user/ros2_ws/src/inuros2". See
documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
CMakeLists.txt:110 (rosidl_generate_interfaces)
</code></pre>
<p>My Cmake up to that point is as follows:</p>
<pre><code>cmake_minimum_required(VERSION 3.8)
project(myPackage)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
find_package(ament_cmake REQUIRED)
find_package(cv_bridge REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_components REQUIRED)
find_package(rosidl_default_generators REQUIRED)
set (SOURCES
...
)
set (INCLUDES
...
)
add_library(<span class="math-container">${PROJECT_NAME} SHARED
$</span>{INCLUDES}
${SOURCES}
)
set(dependencies
cv_bridge
rclcpp
...
)
ament_target_dependencies(<span class="math-container">${PROJECT_NAME}
$</span>{dependencies}
)
rclcpp_components_register_node(${PROJECT_NAME}
PLUGIN "Class::NodeName"
EXECUTABLE MyPackageExecutable
)
set(msg_files
"msg/Features.msg"
)
rosidl_generate_interfaces(<span class="math-container">${PROJECT_NAME}
$</span>{msg_files}
)
</code></pre>
<p>Any help would be great.</p>
<p>Thanks!</p>
<hr />
<p><a href="https://answers.ros.org/question/411859/adding-custom-message-to-existing-package-(humble-+-ubuntu22)-fails/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/57608/aibohphobia/" rel="nofollow noreferrer">AibohphobiA</a> on ROS Answers with karma: 87 on 2023-01-26</p>
<p>Post score: 0</p>
|
Adding custom message to existing package (Humble + Ubuntu22) fails
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I think Meolodic uses Python2 but it looks like you might be using a mix of Python3 and Python2. Was that intentional? I'm not brave enough to even install Python3 on the machine I have that runs old ROS.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/26871/billy/" rel="nofollow noreferrer">billy</a> with karma: 1850 on 2023-01-27</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/135422/shreshtha/" rel="nofollow noreferrer">shreshtha</a> on 2023-01-27</strong>:<br />
Thank you for your response billy,actually I had to install python3 for another program that I was working and I think I messed up somewhere by installing it, are there any fixes available, shall I completely remove python3 from my system?</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/76788/brean/" rel="nofollow noreferrer">brean</a> on 2023-01-27</strong>:<br />
I am wondering how you managed to do this? I think you sourced a python3 environment into your python2 environment, so check your .bashrc-file as well as your path. If you just run "python -v" it should show you the python version that you use as default, that should be python2.
Both python versions should be fine next to each other if you installed python from your package manager (like apt).
But to help you uninstalling python3 might be the right fix you need, you probably also need to reinstall some python2 packages (at least the ones you installed after your python3 installation).</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/135422/shreshtha/" rel="nofollow noreferrer">shreshtha</a> on 2023-01-27</strong>:<br />
Thanks Brean, upon typing "python -v" it's showing python3.11, and I think that is what is causing problem, so I will then uninstall python3 completely and get back to you.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/135422/shreshtha/" rel="nofollow noreferrer">shreshtha</a> on 2023-01-28</strong>:<br />
Thank you both of you after completely removing python3.11, I was able to run the roscore command</p>
|
102969
|
2023-01-26T09:49:59.000
|
|ros-melodic|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I am very new to the field of ROS and have been following ROS tutorials to set environment and when I always run roscore it gets stuck at:
... logging to /home/shreshtha/.ros/log/6c27bb5a-9d87-11ed-ac12-9840bb3645e5/roslaunch-shreshtha-Vostro-4729.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt</p>
<p>and whenever I pess CTRL+C:</p>
<p>I get:
Traceback (most recent call last):
File "/opt/ros/melodic/bin/roscore", line 84, in
roslaunch.main(['roscore', '--core'] + sys.argv[1:])
File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/<strong>init</strong>.py", line 347, in main
p.start()
File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/parent.py", line 301, in start
self.logger.info("starting roslaunch parent run")
File "/usr/lib/python3.11/logging/<strong>init</strong>.py", line 1489, in info
self._log(INFO, msg, args, **kwargs)
File "/usr/lib/python3.11/logging/<strong>init</strong>.py", line 1622, in _log
fn, lno, func, sinfo = self.findCaller(stack_info, stacklevel)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/ros/melodic/lib/python2.7/dist-packages/rosgraph/roslogging.py", line 63, in findCaller
while hasattr(f, "f_code"):
^^^^^^^^^^^^^^^^^^^^
KeyboardInterrupt
^CException ignored in atexit callback: <function _ros_atexit at 0x7ff128b6ff60>
Traceback (most recent call last):
File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/core.py", line 615, in _ros_atexit
signal_shutdown('atexit')
File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/core.py", line 560, in signal_shutdown
_logger.info("signal_shutdown [%s]"%reason)
File "/usr/lib/python3.11/logging/<strong>init</strong>.py", line 1489, in info
self._log(INFO, msg, args, **kwargs)
File "/usr/lib/python3.11/logging/<strong>init</strong>.py", line 1622, in _log
fn, lno, func, sinfo = self.findCaller(stack_info, stacklevel)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/ros/melodic/lib/python2.7/dist-packages/rosgraph/roslogging.py", line 66, in findCaller
filename = os.path.normcase(co.co_filename)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 52, in normcase</p>
<hr />
<p><a href="https://answers.ros.org/question/411865/roscore-stuck-at-checking-logs-not-starting-server/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/135422/shreshtha/" rel="nofollow noreferrer">shreshtha</a> on ROS Answers with karma: 3 on 2023-01-26</p>
<p>Post score: 0</p>
|
roscore stuck at checking logs not starting server
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<blockquote>
<p>the listener will not receive any message. why is that?</p>
</blockquote>
<p>Because it takes time for publishers and subscribers to "find" each other.</p>
<p>Your loop does not give subscribers enough time to find the publishers, hence no messages can be exchanged.</p>
<p>(I'm hoping this is not an <code>xy-problem</code>)</p>
<p>And pedantic, but:</p>
<blockquote>
<p>Why cann't I define a publisher in a loop?</p>
</blockquote>
<p>it's perfectly possible to instantiate multiple <code>ros::Publisher</code>s in a loop. But destroying them in the same scope and then expecting subscribers to resubscribe the next iteration is not something you can do.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> with karma: 86574 on 2023-01-27</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 3</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/135463/robinvista/" rel="nofollow noreferrer">robinvista</a> on 2023-01-27</strong>:<br />
On my machine, the time for the receiver to find the publisher is about 250ms.</p>
|
102971
|
2023-01-26T21:57:23.000
|
|ros|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>This does not work, because the listener will not receive any message. why is that?</p>
<pre><code> while (ros::ok())
{
ros::Publisher chatter_pub = n.advertise<std_msgs::String>("chatter", 1000);
ros::spinOnce();
std_msgs::String msg;
std::stringstream ss;
ss << "hello world ";
msg.data = ss.str();
chatter_pub.publish(msg);
loop_rate.sleep();
}
</code></pre>
<hr />
<p><a href="https://answers.ros.org/question/411878/why-cann%27t-i-define-a-publisher-in-a-loop?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/135463/robinvista/" rel="nofollow noreferrer">robinvista</a> on ROS Answers with karma: 3 on 2023-01-26</p>
<p>Post score: 0</p>
|
Why cann't I define a publisher in a loop?
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>You'll want to use <a href="https://www.plotjuggler.io/" rel="nofollow noreferrer">PlotJuggler</a> instead.</p>
<p>I'd almost go as far as to write "forget about <code>rqt_plot</code>".</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> with karma: 86574 on 2023-01-29</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/135477/mohumohu-usagi/" rel="nofollow noreferrer">Mohumohu Usagi</a> on 2023-01-31</strong>:<br />
Thanks. I will search for PlotJuggler.</p>
|
102973
|
2023-01-27T07:47:50.000
|
|ros2|rqt|rqt-plot|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I want to check the data in topic with realtime plotting, and I know there was rqt_plot in ROS 1.
However, I could not found rqt_plot in ROS 2 humble.
Moreover, I could not use correctly rqt -> Plugins -> Visualization -> Plot.
How to use rqt_plot or similar app in ROS 2?</p>
<hr />
<p><a href="https://answers.ros.org/question/411898/rqt_plot-in-ros-2?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/135477/mohumohu-usagi/" rel="nofollow noreferrer">Mohumohu Usagi</a> on ROS Answers with karma: 3 on 2023-01-27</p>
<p>Post score: 0</p>
|
rqt_plot in ROS 2?
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Flashing Ubuntu 22, installing ROS2 Humble, and building tb3 humble from source works</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/95995/mrocw/" rel="nofollow noreferrer">MrOCW</a> with karma: 58 on 2023-04-10</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
|
102975
|
2023-01-27T11:16:52.000
|
|ros2|turtlebot|turtlebot3|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hi, I recently got a turtlebot3 burger and I only see instructions for installing foxy on it. I saw that the turtlebot3 GitHub page has humble support. Can I flash a regular Ubuntu 22 on the tb3 RPi and then build the turtlebot3 repo from source?</p>
<hr />
<p><a href="https://answers.ros.org/question/411908/running-humble-on-turtlebot3/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/95995/mrocw/" rel="nofollow noreferrer">MrOCW</a> on ROS Answers with karma: 58 on 2023-01-27</p>
<p>Post score: 2</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/142343/proto/" rel="nofollow noreferrer">proto</a> on 2023-03-18</strong>:<br />
Hey!
I am also trying to run ros2 humble on tb3, still confused what image to flash on the rpi4, as the available image is of ros foxy.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/3/tfoote/" rel="nofollow noreferrer">tfoote</a> on 2023-03-20</strong>:<br />
Please don't ask questions as an answer.</p>
|
Running humble on Turtlebot3
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>It affects only plan(). Somewhere in your moveit config is a file usually named <code>ompl_planning.yaml</code>. <code>setPlannerId()</code> is choosing one of the ompl planner configurations defined in that file.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> with karma: 4903 on 2023-01-29</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-01-29</strong>:<br />
<code>computeCartesianPath(..)</code> interpolates (linearly) between the provided (list of) poses. It doesn't use OMPL.</p>
<p><code>setPlannerId(..)</code> configures/requests OMPL to use a specific OMPL planner.</p>
<p>@Mike Scheutzow: could you clarify what you mean by "it affects both"?</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-01-29</strong>:<br />
@gvdhoorn The API documentation for <code>computeCartesianPath()</code> says that it supports collision avoidance. I assumed that it invokes the ompl planner to handle that situation, but I have not looked at the source code to confirm that. Do you have better knowledge of what the actual implementation is?</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-01-30</strong>:<br />
<code>computeCartesianPath(..)</code> does not use OMPL for collision detection. It's part of <code>robot_state</code> these days, and has moved to <code>CartesianInterpolator</code> (<a href="https://github.com/ros-planning/moveit/blob/f12306ca2dc7b3635c922dbc401a65e4bc84b03b/moveit_core/robot_state/src/cartesian_interpolator.cpp" rel="nofollow noreferrer">here</a>).</p>
<p>It uses <code>setFromIK(..)</code> to update an internal collision scene, and the loop basically exits as soon as that complains about a collision (<a href="https://github.com/ros-planning/moveit/blob/f12306ca2dc7b3635c922dbc401a65e4bc84b03b/moveit_core/robot_state/src/cartesian_interpolator.cpp#L162" rel="nofollow noreferrer">here</a>) -- or anything else for that matter.</p>
<p>I would also say/claim it doesn't <em>plan</em> as such. It's basically just a linear interpolation.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-01-30</strong>:<br />
Thanks for the insight. I updated my answer.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/135496/anonymous135496/" rel="nofollow noreferrer">anonymous135496</a> on 2023-01-30</strong>:<br />
Thanks, but arent there also multiple cartesian panners? <a href="https://picknik.ai/cartesian%20planners/moveit/motion%20planning/2021/01/07/guide-to-cartesian-planners-in-moveit.html" rel="nofollow noreferrer">https://picknik.ai/cartesian%20planners/moveit/motion%20planning/2021/01/07/guide-to-cartesian-planners-in-moveit.html</a></p>
<p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-01-31</strong>:<br />
There are -- although again: I would not call them planners. But <code>computeCartesianPath(..)</code> is not one of those. You cannot 'select' it using <code>setPlannerId(..)</code>. You can only call the function directly.</p>
<p>All the other entries in the table on the page you link are either IK plugins (which you can't "select" either), MoveIt request adapters (which are either part of the pipeline or not, so not directly configurable at runtime), full-blown "planners" (in quotes as it's MoveIt terminology) or unavailable to the general public (Bolt fi).</p>
<p>Only the planners could you use <code>setPlannerId(..)</code> for, but I'm not sure that works for the Pilz Planner (it's a sibling to OMPL, not a planner within OMPL). You'd have to look into the multi-planner support to make something work. That doesn't exist in Jade (which is the documentation you linked), but I'm assuming you're not actually using ROS Jade.</p>
|
102979
|
2023-01-27T13:24:25.000
|
|ros|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hey, I was wondering if setPlannerId
<a href="http://docs.ros.org/en/jade/api/moveit_ros_planning_interface/html/classmoveit_1_1planning__interface_1_1MoveGroup.html#a2516b6bd223faf5ce4031d766a51cb3d" rel="nofollow noreferrer">http://docs.ros.org/en/jade/api/moveit_ros_planning_interface/html/classmoveit_1_1planning__interface_1_1MoveGroup.html#a2516b6bd223faf5ce4031d766a51cb3d</a>
affects computeCartesianPath,
<a href="http://docs.ros.org/en/jade/api/moveit_ros_planning_interface/html/classmoveit_1_1planning__interface_1_1MoveGroup.html#ad6b02d15000d5b17c89b15a0f744b47c" rel="nofollow noreferrer">http://docs.ros.org/en/jade/api/moveit_ros_planning_interface/html/classmoveit_1_1planning__interface_1_1MoveGroup.html#ad6b02d15000d5b17c89b15a0f744b47c</a>
or does it only affect plan
<a href="http://docs.ros.org/en/jade/api/moveit_ros_planning_interface/html/classmoveit_1_1planning__interface_1_1MoveGroup.html#ac833bc31e734f7809f8409951586143f" rel="nofollow noreferrer">http://docs.ros.org/en/jade/api/moveit_ros_planning_interface/html/classmoveit_1_1planning__interface_1_1MoveGroup.html#ac833bc31e734f7809f8409951586143f</a></p>
<hr />
<p><a href="https://answers.ros.org/question/411915/set-planner-for-cartesian-path/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/135496/anonymous135496/" rel="nofollow noreferrer">anonymous135496</a> on ROS Answers with karma: 1 on 2023-01-27</p>
<p>Post score: 0</p>
|
Set planner for cartesian path
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Can you try to <code>sudo apt-get install ros-galactic-pcl-conversions ros-galactic-rqt-common-plugins ros-galactic-rviz-default-plugins ros-galactic-rviz2</code>?</p>
<p>It should give you more information about what is missing currently in your setup. Please share it with us.</p>
<p>Did you use <code>rosdep init</code> and <code>rosdep update</code> in your ROS2 workspace?</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/63587/ljaniec/" rel="nofollow noreferrer">ljaniec</a> with karma: 3064 on 2023-01-29</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/103946/sdu568/" rel="nofollow noreferrer">sdu568</a> on 2023-01-31</strong>:<br />
Hello, thank you for taking time to answer the question.</p>
<p>So before I saw this answer, I did the hard way, which is to reimage my Linux, and reinstalled ROS2 on the new system.</p>
<p>Thank you very much for your time!</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/63587/ljaniec/" rel="nofollow noreferrer">ljaniec</a> on 2023-02-01</strong>:<br />
@sdu568 Well, I'd be lying if I said I hadn't done the same myself a few times, haha!</p>
|
102981
|
2023-01-28T10:28:37.000
|
|ros2|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hello,
I am currently running Ubuntu 20.
However, when I was following the steps to install Ros2, I encounter a stranger error.
Does anyone know how to resolve the following error?</p>
<pre><code>shouyu@shouyu-Nitro-AN515-55:~$ sudo apt install ros-galactic-desktop
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
ros-galactic-desktop : Depends: ros-galactic-pcl-conversions but it is not going to be installed
Depends: ros-galactic-rqt-common-plugins but it is not going to be installed
Depends: ros-galactic-rviz-default-plugins but it is not going to be installed
Depends: ros-galactic-rviz2 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
</code></pre>
<hr />
<p><a href="https://answers.ros.org/question/411947/unable-to-install-galactic-due-to-umet-dependencies/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/103946/sdu568/" rel="nofollow noreferrer">sdu568</a> on ROS Answers with karma: 45 on 2023-01-28</p>
<p>Post score: 0</p>
|
Unable to install Galactic due to umet dependencies
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I solved the issue by downgrade by setuptools package in python to "65.7.0"</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/103946/sdu568/" rel="nofollow noreferrer">sdu568</a> with karma: 45 on 2023-01-29</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
|
102983
|
2023-01-28T17:54:34.000
|
|ros|ros2|colcon|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hello,</p>
<p>Currently, I am on Galactic, Ubuntu 20.4</p>
<p>Whenever I run colcon build, my process always fails and give the following reason.
After doing some research, I know is having an issue about the pip version.</p>
<p>Thus, I am wondering if there is a way I can solve it.
Thank you very much!</p>
<pre><code>/home/shouyu/.local/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
Traceback (most recent call last):
File "setup.py", line 5, in <module>
setup(
File "/home/shouyu/.local/lib/python3.8/site-packages/setuptools/__init__.py", line 108, in setup
return distutils.core.setup(**attrs)
File "/home/shouyu/.local/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 185, in setup
return run_commands(dist)
File "/home/shouyu/.local/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
dist.run_commands()
File "/home/shouyu/.local/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
self.run_command(cmd)
File "/home/shouyu/.local/lib/python3.8/site-packages/setuptools/dist.py", line 1213, in run_command
super().run_command(command)
File "/home/shouyu/.local/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
cmd_obj.ensure_finalized()
File "/home/shouyu/.local/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 111, in ensure_finalized
self.finalize_options()
File "/home/shouyu/.local/lib/python3.8/site-packages/setuptools/command/develop.py", line 52, in finalize_options
easy_install.finalize_options(self)
File "/home/shouyu/.local/lib/python3.8/site-packages/setuptools/command/easy_install.py", line 311, in finalize_options
self.local_index = Environment(self.shadow_path + sys.path)
File "/home/shouyu/.local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1044, in __init__
self.scan(search_path)
File "/home/shouyu/.local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1077, in scan
self.add(dist)
File "/home/shouyu/.local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1096, in add
dists.sort(key=operator.attrgetter('hashcmp'), reverse=True)
File "/home/shouyu/.local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2631, in hashcmp
self.parsed_version,
File "/home/shouyu/.local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2685, in parsed_version
raise packaging.version.InvalidVersion(f"{str(ex)} {info}") from None
pkg_resources.extern.packaging.version.InvalidVersion: Invalid version: '0.23ubuntu1' (package: distro-info)
</code></pre>
<hr />
<p><a href="https://answers.ros.org/question/411949/cannot-build-package-due-to-pkg_resources.extern.packaging.version.invalidversion/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/103946/sdu568/" rel="nofollow noreferrer">sdu568</a> on ROS Answers with karma: 45 on 2023-01-28</p>
<p>Post score: 1</p>
|
Cannot build package due to pkg_resources.extern.packaging.version.InvalidVersion
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I'm pretty sure its because you marked your method signature as <code>const</code> but are modifying a non-const member variable <code>robot</code>. You should remove the <code>void topic_callback(const std_msgs::msg::String &msg) **const**</code>.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/25940/stevemacenski/" rel="nofollow noreferrer">stevemacenski</a> with karma: 8272 on 2023-01-31</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/77786/iopoi97/" rel="nofollow noreferrer">iopoi97</a> on 2023-02-01</strong>:<br />
perfect, it worked!</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/25940/stevemacenski/" rel="nofollow noreferrer">stevemacenski</a> on 2023-02-01</strong>:<br />
Can you mark this as the right answer with the checkmark so it is removed from the unanswered questions queue?</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/77786/iopoi97/" rel="nofollow noreferrer">iopoi97</a> on 2023-02-02</strong>:<br />
Sorry for not having done this before!</p>
|
102985
|
2023-01-31T08:04:12.000
|
|ros2|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hello I'm having some issues in subscribing a topic containing <code>std_msgs::msg::string</code> on ros2 galactic. I have defined a <code>std::string</code> and want to subscribe the topic and do something like `string=msg.data. Here my code:</p>
<pre><code>#include <memory>
#include "rclcpp/rclcpp.hpp"
#include "std_msgs/msg/string.hpp"
#include "kdl_parser/kdl_parser.hpp"
using std::placeholders::_1;
class ROBOT_INVDYN : public rclcpp::Node{
public:
ROBOT_INVDYN() : Node("robot_invdyn"){
subscription_ = this->create_subscription<std_msgs::msg::String> ("robot_description", 10, std::bind(&ROBOT_INVDYN::topic_callback,this, _1));
}
private:
std::string robot;
void topic_callback(const std_msgs::msg::String &msg)const{
RCLCPP_INFO(this->get_logger(), "I heard: '%s'", msg.data.c_str());
robot=msg.data;
}
rclcpp::Subscription<std_msgs::msg::String>::SharedPtr subscription_;
};
int main(int argc, char * argv[]){
rclcpp::init(argc, argv);
auto robot_node = std::make_shared<ROBOT_INVDYN>();
rclcpp::spin(robot_node);
rclcpp::shutdown();
return 0;
}
</code></pre>
<p>but I keep on receiving errors on the operator <code>=</code>as:</p>
<pre><code>error: no match for ‘operator=’ (operand types are ‘const string’ {aka ‘const std::__cxx11::basic_string<char>’} and ‘const _data_type’ {aka ‘const std::__cxx11::basic_string<char>’})
17 | robot_desc_string = msg.data;
| ^~~~
</code></pre>
<p>Could you help me?</p>
<hr />
<p><a href="https://answers.ros.org/question/412066/%5Bsolved%5D-how-to-subscribe-a-std_msgs::msg::string-and-copy-in-a-std::string?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/77786/iopoi97/" rel="nofollow noreferrer">iopoi97</a> on ROS Answers with karma: 23 on 2023-01-31</p>
<p>Post score: 0</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/9486/bvbdort/" rel="nofollow noreferrer">bvbdort</a> on 2023-01-31</strong>:<br />
Please share your complete code</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/77786/iopoi97/" rel="nofollow noreferrer">iopoi97</a> on 2023-01-31</strong>:<br />
Yes, sure I will edit.</p>
|
[SOLVED] How to subscribe a std_msgs::msg::String and copy in a std::string?
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Yes my bad, I am going to correct the question. Anyway I realized the problem. Just forgot to add inside bt_navigator params plugin_lib_names those specific nodes.
Thanks for answearing</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/40719/mrmara/" rel="nofollow noreferrer">Mrmara</a> with karma: 71 on 2023-02-02</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
|
102987
|
2023-02-01T08:04:26.000
|
|ros2|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hi,</p>
<p>I recently decided to use the bt proposed by Nav2 from Humble, Navigate To Pose With Consistent Replanning And If Path Becomes Invalid.</p>
<p>When I start the bt the following error pops up.</p>
<pre><code>[bt_navigator-1] [ERROR] [bt_navigator]: Exception when loading BT: Error at line 13: -> Node not recognized: PathExpiringTimer
[bt_navigator-1] [ERROR] [bt_navigator]: Error loading XML file: config_nav2/bt_navigator.xml
</code></pre>
<p>This log regards PathExpirinTimer node but I obtain the same error aso for "GlobalUpdatedGoal" and "IsPathValid".</p>
<p>I suspect something related with <code>nav2_tree_nodes.xml</code> but cannot manage the error.</p>
<p>I currently have installed release 1.1.5 from DEB, which should be the last one.
I am usgin ROS2 humble and ubuntu 22.04</p>
<hr />
<p><a href="https://answers.ros.org/question/412095/%5Bros2%5D-bt_navigator-node-not-recognized/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/40719/mrmara/" rel="nofollow noreferrer">Mrmara</a> on ROS Answers with karma: 71 on 2023-02-01</p>
<p>Post score: 0</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/25940/stevemacenski/" rel="nofollow noreferrer">stevemacenski</a> on 2023-02-01</strong>:<br />
You didn't provide your error message.</p>
|
[ROS2] Bt_navigator Node not recognized
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Here is a basic approach to implementing a solution without using move_base:</p>
<p>"No map" implies you intend to do relative navigation in the robot's frame. For 2D navigation, this means that the goal information you have at each step is: "my goal is at this distance and at this yaw angle." Very important: these values are assumed to be in the <code>base_link</code> frame.</p>
<p>If your sensor reading gives you the goal is in some other frame, you need to transform that sensor-goal to your robot's <code>base_link</code> frame before you use it.</p>
<p>Then you calculate a Twist message which will move the robot closer to the goal, and publish the message to <code>/cmd_vel</code>. You repeat this whole cycle over and over until the robot is "close enough" (or until the robot can't move forward for some reason.)</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> with karma: 4903 on 2023-02-14</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/118101/alperenkeser/" rel="nofollow noreferrer">alperenkeser</a> on 2023-02-15</strong>:<br />
I understood the idea better now. But as far as I understand, your method is like a controller depending on the data coming from my goal's pose (distance and yaw). So it is like a visual servoing? I was hoping more like a trajectory planning kind of method because during the motion of my robot, aruco tag (my goal) could get out of the camera frame easily. But still, thank you very much for your guidance.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-02-16</strong>:<br />
If you want to pre-plan a path, then you must have a map. And to issue commands to follow a path, you must have some way to estimate your robot's position on that map.</p>
|
102989
|
2023-02-01T08:57:46.000
|
|ros|path-planning|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I am trying to calculate a trajectory based on the information I have:</p>
<ul>
<li>aruco_tag relative position and orientation (relative to <strong>camera_link</strong> of my robot)</li>
</ul>
<p>I don't want to use any information from <em>/map</em> and my fixed_frame should be <strong>base_footprint</strong> . Is it possible to do? Path planning without using any information from <em>/map</em> ?</p>
<hr />
<p><a href="https://answers.ros.org/question/412097/path-planning-without-move_base---just-using-aruco_tag-relative-pose/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/118101/alperenkeser/" rel="nofollow noreferrer">alperenkeser</a> on ROS Answers with karma: 3 on 2023-02-01</p>
<p>Post score: 0</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-02-11</strong>:<br />
Of course it "is possible". Are you trying to drop <code>move_base</code> completely, or only create your own planner for use inside move_base? Are we talking about a local_planner or a global_planner?</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/118101/alperenkeser/" rel="nofollow noreferrer">alperenkeser</a> on 2023-02-13</strong>:<br />
Thanks for the reply. I would like to do it without <em>move_base</em> if it's possible. I could not find any tutorials or examples for a path planning algorithm without move_base and with the goal pose is given relative to something like <em>camera_link</em> or <em>base_footprint</em>, not <em>map</em>. Because I am trying to do docking using a camera-aruco tag setup and I want to plan a precise path to my goal, aruco tag. If I take the aruco tag's pose with respect to map, it would be less accurate.</p>
<p>I tried to create my own planner also but I cannot understand how could one do so without using <em>move_base</em>. I believe I am talking about both global_planner and a local_planner because I want to create a path to my goal and then I want to navigate through that path BUT my priority is creating a path first. I could deal with navigating it later.</p>
<p>Again, usage of <em>move_base</em> is OK for me if it is going to be easier since I am not experienced in ROS :) Main issue is <strong>creating a path between camera_link and aruco_tag</strong>.</p>
|
Path planning without move_base - just using aruco_tag relative pose
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Thank you ljaniec for your answer. In case someone stumbles on a similar issue here is how I solved my problem.</p>
<p>After navigating the ROS2 documentation, I discovered the concept of lifecycle nodes. Here are a few links that helped me understand how to use it :</p>
<ul>
<li><strong>Lifecycle node state graph design</strong> : <a href="http://design.ros2.org/articles/node_lifecycle.html" rel="nofollow noreferrer">http://design.ros2.org/articles/node_lifecycle.html</a></li>
<li><strong>Lifecycle talker examples</strong>: <a href="https://github.com/ros2/demos/blob/humble/lifecycle_py/lifecycle_py/talker.py" rel="nofollow noreferrer">https://github.com/ros2/demos/blob/humble/lifecycle_py/lifecycle_py/talker.py</a></li>
<li><strong>Launch file examples integrating lifecycle nodes</strong>: <a href="https://github.com/ros2/launch_ros/tree/rolling/ros2launch/examples" rel="nofollow noreferrer">https://github.com/ros2/launch_ros/tree/rolling/ros2launch/examples</a></li>
<li><strong>Event handlers</strong> :
<a href="https://answers.ros.org/question/304370/ros2-launch-how-to-correctly-create-a-lifecycle-launch-file/" rel="nofollow noreferrer">https://answers.ros.org/question/304370/ros2-launch-how-to-correctly-create-a-lifecycle-launch-file/</a></li>
<li><strong>Callback groups</strong>: <a href="https://docs.ros.org/en/humble/How-To-Guides/Using-callback-groups.html" rel="nofollow noreferrer">https://docs.ros.org/en/humble/How-To-Guides/Using-callback-groups.html</a></li>
</ul>
<p>The main idea is to create a lifecycle node with different states. The <code>main_gui.py</code> script controls the states. And the talker lifecycle node will publish when it is in the <code>activate</code> state. And stop publishing in the <code>deactivate</code> state.</p>
<p><code>main_gui.py</code> - Adapted from : <a href="https://github.com/ros2/demos/blob/humble/lifecycle_py/lifecycle_py/talker.py" rel="nofollow noreferrer">https://github.com/ros2/demos/blob/humble/lifecycle_py/lifecycle_py/talker.py</a></p>
<pre><code>import rclpy
from rclpy.lifecycle import Node
from rclpy.lifecycle import State
from rclpy.lifecycle import TransitionCallbackReturn
from std_msgs.msg import String
class LifecycleTalker(Node):
def __init__(self):
super().__init__('play_button')
self.pub = None
self.timer = None
self._count = 0
def publish(self):
"""Publish a new message when enabled."""
msg = String()
msg.data = "Lifecycle HelloWorld #" + str(self._count)
self._count += 1
# Only if the publisher is in an active state, the message transfer is
# enabled and the message actually published.
if self.pub is not None:
self.pub.publish(msg)
self.get_logger().info(f'Lifecycle publisher is active. Published: [{msg.data}]')
def on_configure(self, state: State) -> TransitionCallbackReturn:
self.pub = self.create_lifecycle_publisher(String, "lifecycle_chatter", 10)
self.get_logger().info("on_configure() is called.")
return super().on_configure(state)
def on_activate(self, state: State) -> TransitionCallbackReturn:
# Log, only for demo purposes
self.get_logger().info("on_activate() is called.")
self.timer = self.create_timer(1.0, self.publish)
return super().on_activate(state)
def on_deactivate(self, state: State) -> TransitionCallbackReturn:
self.get_logger().info("on_deactivate() is called.")
self.destroy_timer(self.timer)
return super().on_deactivate(state)
def on_cleanup(self, state: State) -> TransitionCallbackReturn:
self.destroy_timer(self.timer)
self.destroy_publisher(self.pub)
self.get_logger().info('on_cleanup() is called.')
return super().on_cleanup(state)
def on_shutdown(self, state: State) -> TransitionCallbackReturn:
self.destroy_timer(self.timer)
self.destroy_publisher(self.pub)
self.get_logger().info('on_shutdown() is called.')
return super().on_shutdown(state)
def main():
rclpy.init()
executor = rclpy.executors.SingleThreadedExecutor()
lc_node = LifecycleTalker()
executor.add_node(lc_node)
try:
executor.spin()
except (KeyboardInterrupt, rclpy.executors.ExternalShutdownException):
lc_node.destroy_node()
if __name__ == '__main__':
main()
</code></pre>
<p><code>main_gui.py</code></p>
<pre><code>import PySimpleGUI as sg
import rclpy
from rclpy.node import Node
from rclpy.callback_groups import ReentrantCallbackGroup
from rclpy.executors import ExternalShutdownException
from lifecycle_msgs.srv import ChangeState
from lifecycle_msgs.msg import Transition
def minimal_layout():
layout = [[sg.Button('Talk'), sg.Button('Exit')]]
return layout
class MainGui(Node):
def __init__(self):
super().__init__('gui_client')
# Initialization of the GUI
self.layout = minimal_layout()
self.window = sg.Window('Lifecycle GUI', self.layout, location=(800, 400), finalize=True)
self.values, self.event = None, ''
# Initialization of the publisher
timer_period = 0.1
self.timer = self.create_timer(timer_period, self.gui_callback)
# Node's default callback group is mutually exclusive. This would prevent the client response
# from being processed until the timer callback finished, but the timer callback in this
# example is waiting for the client response
self.cb_group = ReentrantCallbackGroup()
# Initialize the change_state_client that will update the talker state
self.change_talking_state_cli = self.create_client(ChangeState, '/talker/change_state',
callback_group=self.cb_group)
# Transition to configured state
self.req = ChangeState.Request()
self.req.transition = Transition(label='configure')
# Call the on_configure state
future = self.change_talking_state_cli.call_async(self.req)
rclpy.spin_until_future_complete(self, future)
# Initialize the variable that will monitor the talker state
self.is_talking = False
async def gui_callback(self):
self.event, self.values = self.window.read(timeout=10)
if self.event in ('Exit', 'None'):
exit()
elif self.event == 'Talk':
###### Here start the talker like it would with `ros2 run py_pubsub talker`
# Update the transition according to current button state
next_talking_transition = 'activate' if not self.is_talking else 'deactivate'
# Create the change state object
self.req.transition = Transition(label=next_talking_transition)
# Call to the service
future_lifecycle = self.change_talking_state_cli.call_async(self.req)
result_change_state = await future_lifecycle
# If the request was successful, update the streaming status
if result_change_state.success:
self.is_talking = not self.is_talking
button_color = sg.theme_button_color() if not self.is_talking else 'red'
self.window['Talk'].update(button_color=button_color)
def main(args=None):
rclpy.init(args=args)
# Create the node
minimal_subscriber = MainGui()
try:
# Spin the node so the callback function is called.
rclpy.spin(minimal_subscriber)
except (KeyboardInterrupt, ExternalShutdownException):
# If the node receive a KeyboardInterrupt command
pass
finally:
# Destroy the node explicitly
# (optional - Done automatically when node is garbage collected)
minimal_subscriber.destroy_node()
rclpy.shutdown()
rclpy.shutdown()
if __name__ == '__main__':
main()
</code></pre>
<p><code>main.launch.py</code></p>
<pre><code>from launch import LaunchDescription
from launch.actions import EmitEvent
from launch.events import Shutdown
from launch_ros.actions import Node, LifecycleNode
def generate_launch_description():
ld = LaunchDescription()
gui_node = LifecycleNode(
package='minimal_examples',
executable='main_gui',
name='main_gui',
namespace='',
output='screen',
on_exit=EmitEvent(event=Shutdown(reason='Window closed'))
)
lifecycle_talker_node = LifecycleNode(
package='minimal_examples',
executable='lifecycle_talker',
name='talker',
namespace='',
output='screen'
)
ld.add_action(gui_node)
ld.add_action(lifecycle_talker_node)
return ld
</code></pre>
<p><code>setup.py</code></p>
<pre><code>import os
from glob import glob
from setuptools import setup
package_name = 'minimal_examples'
setup(
name=package_name,
version='0.0.0',
packages=[package_name],
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name]),
('share/' + package_name, ['package.xml']),
# Include all launch files.
(os.path.join('share', package_name), glob('launch/*launch.[pxy][yma]*'))
],
install_requires=['setuptools'],
zip_safe=True,
description='Packages that includes minimal example for the ROS forum',
license='Apache License 2.0',
tests_require=['pytest'],
entry_points={
'console_scripts': [
'main_gui = minimal_examples.main_gui:main',
'lifecycle_talker = minimal_examples.lifecycle_nodes:main'
],
},
)
</code></pre>
<p>If you want to monitor the topic, run : <code>ros2 topic echo /lifecycle_chatter</code></p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/136146/rmapsps/" rel="nofollow noreferrer">rmapsps</a> with karma: 21 on 2023-02-22</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/63587/ljaniec/" rel="nofollow noreferrer">ljaniec</a> on 2023-02-22</strong>:<br />
Really nice solution, I hadn't thought of Lifecycle Nodes but they fit perfectly there, well done!</p>
|
102991
|
2023-02-01T10:50:24.000
|
|ros2|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p><strong>Context</strong>: I am running a camera using ROS. To facilitate data collection I integrated a PySimpleGui graphical user interface inside a Node, so I can start streaming, recording or playing back data through a user-friendly interface.</p>
<p><strong>Expected behaviour</strong>: Therefore, my goal is to execute a Node, when the user clicks on a button. For instance, if the following minimal example, I want to start a publisher Node when the user clicks on the button 'Talk'. And I want to start a subscriber Node when the user clicks on 'Listen'.</p>
<p><strong>Platform</strong> : I run ROS2 humble on WSL2 - Ubuntu 22.04.1 LTS</p>
<p><strong>Code</strong>: Here is <code>GUI publisher</code>, which will publish a string corresponding to the button name to the topic \gui_command when the user clicks on a button.</p>
<pre><code>import PySimpleGUI as sg
import rclpy
from rclpy.node import Node
from std_msgs.msg import String
def generate_layout():
layout = [[sg.Button('Talk'), sg.Button('Listen'), sg.Button('Exit')]]
return layout
class MinimalGuiPublisher(Node):
def __init__(self):
super().__init__('gui')
# Initialization of the GUI
self.layout = generate_layout()
self.window = sg.Window('Camera recording', self.layout, location=(800, 400), finalize=True)
self.values, self.event = None, ''
# Initialization of the publisher
self.publisher_ = self.create_publisher(String, 'gui_command', 10)
timer_period = 0.2
self.timer = self.create_timer(timer_period, self.gui_callback)
def gui_callback(self):
msg = String()
# Check for any event
self.event, self.values = self.window.read()
print(self.event)
msg.data = str(self.event)
self.publisher_.publish(msg)
self.get_logger().info('Publishing: "%s"' % msg.data)
if self.event in ('Exit', None):
print('User clicked on Exit')
exit()
def main(args=None):
rclpy.init(args=args)
minimal_publisher = MinimalGuiServer()
rclpy.spin(minimal_publisher)
minimal_publisher.destroy_node()
rclpy.shutdown()
if __name__ == '__main__':
main()
</code></pre>
<p>Here is the <code>GUI subscriber</code> that listens to the command through subscription to the topic \gui_command.</p>
<pre><code>import rclpy
from rclpy.node import Node
from std_msgs.msg import String
class MinimalGuiClient(Node):
def __init__(self):
super().__init__('gui_client')
self.subscription = self.create_subscription(
String,
'gui_command',
self.listener_callback,
10)
self.subscription # prevent unused variable warning
def listener_callback(self, msg):
recorder = None
self.get_logger().info('User clicked on: "%s"' % msg.data)
if msg.data in ('Exit', 'None'):
exit()
elif msg.data == 'Talk':
###### Here start the talker like it would with
###### ros2 run py_pubsub talker
pass
elif msg.data == 'Listen':
###### Here start the talker like it would with
###### ros2 run py_pubsub listener
pass
def main(args=None):
rclpy.init(args=args)
minimal_subscriber = MinimalGuiClient()
rclpy.spin(minimal_subscriber)
minimal_subscriber.destroy_node()
rclpy.shutdown()
if __name__ == '__main__':
main()
</code></pre>
<p><strong>Question</strong> : Is it possible to program the execution of a Node from another Node? If yes, could you please indicate which is the correct way to do so?</p>
<p>I tried to read the doc, and thought about using <code>ros2launch</code> (edited). But it is not clear to me if and how a node or a launch can be triggered by user interaction. Your help would be very much appreciated !!</p>
<hr />
<p><a href="https://answers.ros.org/question/412104/%5Bros-2%5D-how-to-start-and-stop-a-node-from-a-python-script?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/136146/rmapsps/" rel="nofollow noreferrer">rmapsps</a> on ROS Answers with karma: 21 on 2023-02-01</p>
<p>Post score: 1</p>
|
[ROS 2] How to start and stop a node from a Python script?
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>In general tf2 does not rely on the current time. It only knows about the timestamps requested and the timestamps of published frame data. If you query it with the current time while providing simulation/logged data it will likely fail.</p>
<p>You will run into problems if different components of your system are on different timelines. This can happen if some are in world time, and some are in simulation time in which case queries might fail.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/3/tfoote/" rel="nofollow noreferrer">tfoote</a> with karma: 58457 on 2023-02-06</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/136267/oddbotwl/" rel="nofollow noreferrer">oddbotwl</a> on 2023-02-07</strong>:<br />
Ok thank you. It's unlikely we'll be using current time while providing simulation/logged data, since we're using the timestamps from that data. So then it should be fine. Thanks again for clarifying.</p>
|
102993
|
2023-02-02T05:51:50.000
|
|ros|ros2|tf2|use-sim-time|transform|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>We recorded some rosbags and now we want to play them for simulation. But Ros2 Foxy doesn't have a feature like Ros1's <code>use_sim_time</code> and we can't switch to a newer version. In order to use the rosbags we need to know whether our code relies only on time provided in message headers (as recorded in the rosbag), or also the current time. Since we're using tf2 as well, I'd like to know whether tf2 relies only on time provided in message headers, or also the current time. Anyone knows?</p>
<hr />
<p><a href="https://answers.ros.org/question/412136/does-tf2-rely-on-current-time?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/136267/oddbotwl/" rel="nofollow noreferrer">oddbotwl</a> on ROS Answers with karma: 3 on 2023-02-02</p>
<p>Post score: 0</p>
|
Does tf2 rely on current time?
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Changed:</p>
<pre><code>while rclpy.spin_until_future_complete(self, future, timeout_sec=1.0):
</code></pre>
<p>To:</p>
<pre><code>while self.executor.spin_until_future_complete(future, timeout_sec=1.0)
</code></pre>
<p>And it worked</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/37912/rezenders/" rel="nofollow noreferrer">rezenders</a> with karma: 122 on 2023-03-14</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
|
102995
|
2023-02-02T14:50:05.000
|
|ros2|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hello,</p>
<p>I have a node where I want to call an action with <code>send_async_goal</code> from within a service callback. I implemented it as shown below. It works, but only one time. When I call the service <code>/task/request</code> from the cmd line it returns the right result without a problem. But when I call the service a second time it does nothing, the service returns but the callback is not excuted.</p>
<p>I was trying to do something similar earlier but calling a service (async) inside another service, it was also working only one time, but in this situation the service was hanging instead of returning. I had to change the service call to be sync for it to work.</p>
<p>Any ideas?</p>
<pre><code>class TaskBridge(Node):
...
client_cb_group = MutuallyExclusiveCallbackGroup()
self.mros_action_client = ActionClient(
self, ControlQos, '/mros/objective',
callback_group=client_cb_group)
task_cb_group = MutuallyExclusiveCallbackGroup()
self.task_request_service = self.create_service(
Task,
'task/request',
self.task_request_cb,
callback_group=task_cb_group
)
def task_request_cb(self, req, res):
...
future = self.mros_action_client.send_goal_async(goal_msg, feedback_callback=self.feedback_callback)
while rclpy.spin_until_future_complete(self, future, timeout_sec=1.0):
self.get_logger().info("Waiting for future to complete")
return future.result().accepted
def main():
rclpy.init(args=sys.argv)
task_bridge_node = TaskBridge()
executor = MultiThreadedExecutor()
rclpy.spin(task_bridge_node, executor=executor)
task_bridge_node.destroy_node()
rclpy.shutdown()
</code></pre>
<hr />
<p><a href="https://answers.ros.org/question/412149/%5Bhumble%5D-service-call-does-nothing-after-second-call-when-calling-a-goal-from-the-callback/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/37912/rezenders/" rel="nofollow noreferrer">rezenders</a> on ROS Answers with karma: 122 on 2023-02-02</p>
<p>Post score: 0</p>
|
[Humble] Service call does nothing after second call when calling a goal from the callback
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Ignoring the "<code>rospy.sleep(..)</code> gives back control to ROS" comment, there is a general answer to your question:</p>
<blockquote>
<p>does it make sense, and is it allowed, to call rospy.sleep() or rospy.spin() or rospy.spinOnce() from inside a callback?</p>
</blockquote>
<p>No, I cannot think of any reason to call <code>rospy.spin()</code> in a callback. It would completely block the execution of the callback, and that part of your node would stop working (ie: no further messages processed, no other timer events handled, etc).</p>
<p>You <em>could</em> theoretically call <code>rospy.sleep(..)</code> in a callback. It would just introduce a delay, similar to what <code>time.sleep(..)</code> would do (but taking <code>use_sim_time</code> into account). Would that be useful? Depends on the rest of the code in the callback.</p>
<p>Would I recommend doing it? Probably not. If, in an event based system, you need to introduce an explicit <code>sleep(..)</code> somewhere, it's likely you should be using callbacks more/differently (ie: instead of <code>sleep(..)</code>ing to wait for something, register your interest in whatever it is you're waiting for and register a callback to be notified whenever what you're interested in happens).</p>
<p>(Note that <code>rospy.spinOnce()</code> does not exist)</p>
<p>Are you <em>allowed</em> to call those functions? Of course. In the sense that no one will prevent you from calling them, nor will <code>rospy</code> "complain".</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> with karma: 86574 on 2023-02-03</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 2</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/30692/pitosalas/" rel="nofollow noreferrer">pitosalas</a> on 2023-02-03</strong>:<br />
Ah @gvdhoorn, good to see you again!</p>
<p>I don't remember why I got that impression but I really did believe it! What I meant about "allowed" is, does it cause problems in the threading and dispatching of ROS, more than,it's just bad practice or ugly.</p>
<p>If sleep is a normal sleep, and rospy is multi threaded, then is the following true? If I use sleep () in a callback, then during the sleep, the callback could be called again at that point and lead to race conditions etc.?</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/30692/pitosalas/" rel="nofollow noreferrer">pitosalas</a> on 2023-02-04</strong>:<br />
Does anyone know of an article or post or documentation that explains the threading in rospy?</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-02-05</strong>:<br />
A number of off-site articles were written (on blogs fi), but I can't find those any more (just goes to show how brittle hosting content that way is).</p>
<p>There are a couple of Q&As here on ROS Answers as well. See #q9543 for a start. Note the alternative answers there. I also found <a href="https://medium.com/@TonyJacb/ros-and-thread-spinning-26f2fa73e79f" rel="nofollow noreferrer">this article on medium.com</a> which goes into some detail (it's not the article I remembered).</p>
|
102997
|
2023-02-02T17:09:20.000
|
|rospy|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>My understanding is that rospy.sleep() will return control to ROS so that it can schedule any other processes that need a turn, and also waith the designated time before it "returns". I put that in quotes because it looks like a simple call and return but actually control is returned to ROS who decides when to pop the stack and return control to the line after rospy.sleep().</p>
<p>Given that, does it make sense, and is it allowed, to call rospy.sleep() or rospy.spin() or rospy.spinOnce() from inside a callback?</p>
<hr />
<p><a href="https://answers.ros.org/question/412153/using-rospy.sleep-inside-a-callback/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/30692/pitosalas/" rel="nofollow noreferrer">pitosalas</a> on ROS Answers with karma: 628 on 2023-02-02</p>
<p>Post score: 0</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-02-03</strong>:\</p>
<blockquote>
<p>My understanding is that rospy.sleep() will return control to ROS so that it can schedule any other processes that need a turn [..]</p>
</blockquote>
<p>could you clarify what gave you that impression? Any documentation or articles you could link?</p>
<p><a href="https://github.com/ros/ros_comm/blob/1a1564e145c5a2346c35b6349a2f25e2cb5d9fa9/clients/rospy/src/rospy/timer.py#L116-L165" rel="nofollow noreferrer">This</a> is the source of <code>rospy.sleep(..)</code>.</p>
<p>At its core, <code>sleep(..)</code> basically just calls <code>time.sleep(..)</code> (a Python built-in) when <code>use_sim_time==False</code>, or does some more complicated things when <code>use_sim_time==True</code> (to deal with <code>Time(0)</code> and clock resets fi).</p>
<p>The Python client being multithreaded by default (as much as Python can be MT), there is no explicit scheduling of "giving control back to ROS". In fact, <code>rospy.spin()</code> does nothing but <code>sleep(..)</code> (<a href="https://github.com/ros/ros_comm/blob/1a1564e145c5a2346c35b6349a2f25e2cb5d9fa9/clients/rospy/src/rospy/client.py#L118-L132" rel="nofollow noreferrer">here</a>).</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/30692/pitosalas/" rel="nofollow noreferrer">pitosalas</a> on 2023-02-03</strong>:<br />
I don't remember why I got that impression but I really did believe it! Worse, I've explained it to other ROS programmers :) Now I am a new man! If ROS/Python is multi threaded, when and how does the cb dispatcher decide to do a callback? I assume it's not based on time slicing? I am going to look for doc on how the python threading works.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-02-04</strong>:\</p>
<blockquote>
<p>I don't remember why I got that impression but I really did believe it!</p>
</blockquote>
<p>Well technically you could argue that since <code>rospy.sleep(..)</code> calls <code>time.sleep(..)</code> (one of its variants) it does allow Python to suspend that thread and allow other threads to become active.</p>
<p>Again, technically, you could describe that as "other [ROS] threads can become active". Extrapolating a bit, you could claim it means it "allows ROS to do its thing".</p>
<p>What I responded to however was the implication there is some <em>special code</em> in <code>rospy.sleep(..)</code> which "allows ROS to do its thing". <em>That's</em> not true.</p>
<p><code>rospy.sleep(..)</code> just calls <code>time.sleep(..)</code>. If that ends up allowing other threads (including ROS' threads) to run, that'd be a side-effect, not the main functionality.</p>
|
Using rospy.sleep inside a callback
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>When the bag file was created, it recorded the /clock topic; this is a problem because I believe that the --clock option synthesizes (i.e. generates) a ros clock. So your play command is sending two different data streams to the /clock topic.</p>
<p>I would try specifying the topics you want rosbag to play back, and make sure not to publish the /clock topic from the bag file.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> with karma: 4903 on 2023-02-07</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
|
102999
|
2023-02-05T04:14:02.000
|
|rosbag|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I recorded a rosbag containing laser scans and while trying to play it back and visualize the output in <code>rviz</code> I get the following warning: Detected jump back in time of 1.0252e-05s. Clearing TF buffer.</p>
<p>The jump-back time just keeps increasing. I realize this problem has something to do with using the <code>--clock</code> option in <code>rosbag play</code> and using <code>use_sim_time</code>. Both of which are rightly done. I set at the very beginning of the launch file:</p>
<p><code><param name="/use_sim_time" type="bool" value="true"/></code></p>
<p>and pass the <code>--clock</code> option to <code>rosbag play</code>. I still get the warning.</p>
<p>The scans are being visualized in rviz, but every now and then there is a flicker in the screen and the scans go away and then come back. This is surely not how it's normally supposed to behave. (Additionally, when I feed the rosbag laser scans and other sensor data to a SLAM algorithm, it doesn't work. While in fact, the rosbag was recorded the first time with said algorithm, rtabmap).</p>
<p><strong>Edit</strong>: Adding the launch file and a snippet of what the rosbag file contains:</p>
<pre><code><launch>
<param name="/use_sim_time" type="bool" value="true"/>
<node pkg="rosbag" type="play" name="playback_vel_rtab"
args="--clock $(find my_pkg)/datacapture/bagname.bag">
<remap from="/scan" to="/fake_scan"/>
</node>
</launch>
</code></pre>
<p>And here is my bagfile:</p>
<pre><code>path: rtab_in_2023-01-27-10-05.bag
version: 2.0
duration: 2:22s (142s)
start: Jan 01 1970 01:00:00.29 (0.29)
end: Jan 01 1970 01:02:23.02 (143.02)
size: 6.2 GB
messages: 159462
compression: none [919/919 chunks]
types: nav_msgs/Odometry [cd5e73d190d741a2f92e81eda573aca7]
rosgraph_msgs/Clock [a9c97c1d230cfc112e270351a944ee47]
sensor_msgs/CameraInfo [c9a58c1b0b154e0e6da7578cb991d214]
sensor_msgs/Image [060021388200f6f0f447d0fcd9c64743]
sensor_msgs/LaserScan [90c7ef2dc6895d81024acba2ac42f369]
tf2_msgs/TFMessage [94810edda583a504dfda3829e70d7eec]
topics: /camera/depth/image_raw 459 msgs : sensor_msgs/Image
/camera/rgb/camera_info 459 msgs : sensor_msgs/CameraInfo
/camera/rgb/image_raw 459 msgs : sensor_msgs/Image
/clock 141763 msgs : rosgraph_msgs/Clock
/odom 4274 msgs : nav_msgs/Odometry
/scan 712 msgs : sensor_msgs/LaserScan
/tf 11335 msgs : tf2_msgs/TFMessage (3 connections)
/tf_static 1 msg : tf2_msgs/TFMessage
</code></pre>
<hr />
<p><a href="https://answers.ros.org/question/412194/right-way-to-replay-laser-scan-from-bag-file-and-visualize-in-rviz/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/104316/shrini96/" rel="nofollow noreferrer">shrini96</a> on ROS Answers with karma: 13 on 2023-02-05</p>
<p>Post score: 1</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-02-05</strong>:<br />
Is it possible you have two sources publishing to /clock topic? It won't work if both gazebo and rosbag are publishing the ros time.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/104316/shrini96/" rel="nofollow noreferrer">shrini96</a> on 2023-02-05</strong>:<br />
No, it is only the rosbag that is publishing. Let me update the question with my launch file and a snippet of my rosbag file^^</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-02-05</strong>:<br />
When the bag file was created, it recorded the /clock topic; this is a problem because I believe that the <code>--clock</code> option synthesizes (i.e. generates) a ros clock. So your play command is sending two different data streams to the /clock topic. I would try specifying the topics you want rosbag to play back, and make sure not to publish the /clock topic from the bag file.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/104316/shrini96/" rel="nofollow noreferrer">shrini96</a> on 2023-02-07</strong>:<br />
You are right. This works like a charm (with the exception of occasionally getting the <code>TF_REPEATED_DATA</code> warning, which i think is a different issue altogether).</p>
<p>Thanks a lot. You can write this as an answer and I will mark it as accepted.</p>
|
Right way to replay laser scan from bag file and visualize in rviz
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I debugged the launch file and found that joint_state_publisher was the cause.
I don't know why, but uninstalling and reinstalling joint_state_publisher solved this problem.
thanks.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/36059/takijo/" rel="nofollow noreferrer">takijo</a> with karma: 110 on 2023-02-06</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/75010/khinggan/" rel="nofollow noreferrer">khinggan</a> on 2023-06-30</strong>:<br />
I still have the problem even if I uninstall and reinstall the joint_state_publisher. Could you please provide more detail about this problem and how did you debug launch file?
My setup is Ubuntu 20.04 ROS2 foxy</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/168032/kaushal/" rel="nofollow noreferrer">Kaushal</a> on 2023-08-04</strong>:<br />
I am getting the same error while launching a launch file (unrelated to ros2_control). Could somebody fill me in as to why that is happening and how to solve it?</p>
|
103001
|
2023-02-06T09:15:52.000
|
|ros2|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hello</p>
<p>I am trying ros2_contro_demos.</p>
<p>Follow the tutorial,</p>
<pre><code>git clone -b galactic https://github.com/ros-controls/ros2_control
git clone -b galactic https://github.com/ros-controls/ros2_controllers
git clone -b galactic https://github.com/ros-controls/ros2_control_demos
</code></pre>
<p>and</p>
<pre><code> rosdep install --from-paths src --ignore-src -r -y
colcon build --symlink-install
</code></pre>
<p>I have finished to build with some additional packages.</p>
<p>But, I hit</p>
<pre><code>ros2 launch rrbot_description view_robot.launch.py
</code></pre>
<p>I get an error below</p>
<pre><code>raise SubstitutionFailure("executable '{}' not found on the PATH".format(self.name))
launch.substitutions.substitution_failure.SubstitutionFailure: executable '[<launch.substitutions.text_substitution.TextSubstitution object at 0x7f72314f7eb0>]' not found on the PATH
</code></pre>
<p>I have no idea what error this is.</p>
<p>Please help me.</p>
<p>thanks.</p>
<p>My setup is below.</p>
<p>Ubuntu20.04
ros2:galactic</p>
<hr />
<p><a href="https://answers.ros.org/question/412213/ros2-launch-gives-an-error-in-ros2_control_demos/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/36059/takijo/" rel="nofollow noreferrer">takijo</a> on ROS Answers with karma: 110 on 2023-02-06</p>
<p>Post score: 0</p>
|
Ros2 launch gives an error in ros2_control_demos
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Only the file <code>setup.cfg</code>. There you should replace the sign <code>-</code> with the sign <code>_</code></p>
<p>I had many packages implemented for Foxy. Now I have Humble. I didn't have any problem importing and compiling them.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/19675/andromeda/" rel="nofollow noreferrer">Andromeda</a> with karma: 893 on 2023-02-08</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
|
103003
|
2023-02-06T16:49:28.000
|
|ros|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I have a general question. We are using foxy and it seems that foxy will soon be EOL.</p>
<p>I am wondering if we should change and if so if our nodes which are written in python will still work as well.</p>
<p>So what do I need to consider when switching from foxy to humble?</p>
<hr />
<p><a href="https://answers.ros.org/question/412228/migrate-foxy-to-humble/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/136844/kadlu/" rel="nofollow noreferrer">Kadlu</a> on ROS Answers with karma: 1 on 2023-02-06</p>
<p>Post score: 0</p>
|
Migrate foxy to humble
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>This appears to be a C++ problem, not a ROS one.</p>
<p>Summarising:</p>
<ul>
<li><code>auto odom_pose = nav_msgs::msg::Odometry::SharedPtr()</code> initialises <code>odom_pose</code> as a shared pointer. Just a <em>pointer</em>. No storage is allocated for the actual object (or <em>pointed-to</em>)</li>
<li><code>auto odom_pose = nav_msgs::msg::Odometry()</code> actually initialises <code>odom_pose</code> to an instance of <code>nav_msgs::msg::Odometry</code>. So that's an instance (ie: an object) of the class <code>nav_msgs::msg::Odometry</code>. This allocates storage for the object</li>
</ul>
<p>In the first case (the problematic one), you have just a pointer pointing to nothing (either <code>0x0</code> or garbage). Dereferencing an invalid pointer typically leads to <code>SEGFAULT</code>s.</p>
<p>In other words: you cannot write anything to the fields of the object your smart pointer points to, as they don't "exist". And even that's not correct, as there is no "object your smart pointer points to".</p>
<p>In the second case (the working one), all of that is "solved", as there is actual memory reserved for your <code>nav_msgs::msg::Odometry</code> object, and all its fields are usable by you.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> with karma: 86574 on 2023-02-07</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 2</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/70396/wienans/" rel="nofollow noreferrer">wienans</a> on 2023-02-07</strong>:<br />
Hi @gvdhoorn
thank you now the <code>0x0</code> in the gdb message also does make sense.
Then</p>
<pre><code>auto odom_pose = std::make_shared<nav_msgs::msg::Odometry>();
</code></pre>
<p>instead of</p>
<pre><code>auto odom_pose = nav_msgs::msg::Odometry::SharedPtr();
</code></pre>
<p>should do the trick? :D</p>
|
103005
|
2023-02-07T02:50:23.000
|
|ros|ros2|std-msgs|header|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hi Community,</p>
<p>i am currently struggling with some segmentation fault which i don't understand while assigning the Frame ID to the header of a Odometry Message</p>
<pre><code>auto odom_pose = nav_msgs::msg::Odometry::SharedPtr();
// odom_pose->header.stamp = pose->header.stamp;
odom_pose->header.frame_id = std::string("map");
odom_pose->child_frame_id = "track_"+std::to_string(uuid_);
odom_pose->pose = pose->pose;
setCurrentOdomPose(odom_pose);
</code></pre>
<p>Does SegFault at the assignment of frame_id, but it also occured that it seg faulted at assigning the stamp or if i would assign directly the header of pose to my odom_pose.
I changed the code to create only the Odometry message and later create a shared pointer of it which does not seg fault at the assignment of the Header.</p>
<pre><code>auto odom_pose = nav_msgs::msg::Odometry();
// odom_pose->header.stamp = pose->header.stamp;
odom_pose.header.frame_id = std::string("map");
odom_pose.child_frame_id = "track_"+std::to_string(uuid_);
odom_pose.pose = pose->pose;
auto odom_pose_ptr = std::make_shared<nav_msgs::msg::Odometry>(odom_pose);
setCurrentOdomPose(odom_pose_ptr);
</code></pre>
<p>The backtrace didn't give any good information too, it only showed where the segfault occured and in case of assigning the header instead of directly the sub variables i got this additional frame on top.</p>
<pre><code>#0 0x00007f420c3c1904 in std_msgs::msg::Header_<std::allocator<void> >::operator= (
this=0x0)
at /opt/ros/humble/include/std_msgs/std_msgs/msg/detail/header__struct.hpp:36
</code></pre>
<hr />
<p><a href="https://answers.ros.org/question/412237/%5Bros2-humble%5D-segmentation-fault-for-assigning-header/frame-id-to-shared-pointer/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/70396/wienans/" rel="nofollow noreferrer">wienans</a> on ROS Answers with karma: 3 on 2023-02-07</p>
<p>Post score: 0</p>
|
[ROS2 Humble] Segmentation Fault for assigning Header/Frame ID to shared pointer
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Setting <code>LD_LIBRARY_PATH</code> will likely not do anything. That's a runtime setting.</p>
<p>This is purely a "CMake thing". According to the <a href="https://cmake.org/cmake/help/latest/module/FindBoost.html#hints" rel="nofollow noreferrer">FindBoost.cmake</a> documentation:</p>
<blockquote>
<p>This module reads hints about search locations from variables:</p>
<ul>
<li><p><code>BOOST_ROOT</code>, <code>BOOSTROOT</code></p>
<p>Preferred installation prefix.</p>
</li>
</ul>
</blockquote>
<p>You should be able to do something like:</p>
<pre><code>catkin_make [all your other args] --cmake-args -DBOOST_ROOT:PATHNAME=/path/to/your/boost
</code></pre>
<p>This might or might not work, depending on whether the package(s) you're trying to build are the first to look for Boost. If one of the dependencies have already done that, and the result gets cached or exported, your dependents will most likely not evaluate <code>FindBoost</code> again, leading to your <code>BOOST_ROOT</code> being ignored.</p>
<p><strong>But</strong> in all cases: please be aware that mixing different Boost versions is fraught with potential problems.</p>
<p>Mostly <code>SEGFAULT</code>s.</p>
<p>You cannot link a ROS node to multiple versions of Boost, which is what will happen when you link <code>abb_robot_driver</code>'s nodes against <code>roscpp</code> (which it must) and your custom Boost version.</p>
<p>Unless you've built the whole of your ROS Noetic from source with that specific Boost version, I wouldn't recommend doing what you're trying to do.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> with karma: 86574 on 2023-02-07</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 2</p>
|
103007
|
2023-02-07T09:48:56.000
|
|ros|catkin|boost|cmake|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I have installed latest Boost library <code>1.80.0</code> from source on Ubuntu <code>20.04</code>, then I tried to install the <a href="https://github.com/ros-industrial/abb_robot_driver" rel="nofollow noreferrer">abb_robot_driver</a>, but I have got this Error:</p>
<pre><code> Errors << abb_robot_cpp_utilities:make /home/belal/ros1_ws/pacbot_ws/logs/abb_robot_cpp_utilities/build.make.000.log
make[2]: *** No rule to make target '/usr/lib/x86_64-linux-gnu/libboost_chrono.so.1.71.0', needed by '/home/belal/ros1_ws/pacbot_ws/devel/.private/abb_robot_cpp_utilities/lib/libabb_robot_cpp_utilities.so'.
Stop.
</code></pre>
<p>Can you please tell me how can I tell CMake and Catkin that My Boost is <code>1.81.0</code> and not the default <code>1.71.0</code>, and my libraries folder is <code>/usr/local/lib/</code> and not <code>/usr/lib/x86_64-linux-gnu/</code>? thanks in advance.</p>
<p>Note that I have added <code>export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib </code> to my <code>~/.bashrc</code> and I have already done <code>$ sudo ldconfig</code>.</p>
<hr />
<p><a href="https://answers.ros.org/question/412255/why-cmake-is-looking-for-default-boost-version?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/71460/bhomaidan/" rel="nofollow noreferrer">bhomaidan</a> on ROS Answers with karma: 114 on 2023-02-07</p>
<p>Post score: 0</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-02-07</strong>:<br />
I've updated the title of your question, as this is a CMake question. Catkin is not involved.</p>
|
Why cmake is looking for default Boost version?
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>You'd have to handle your own exceptions that are thrown so that the ROS internal system isn't catching them for you (or not catching them). The exceptions you throw and don't catch in callbacks are being processed on the node executor thread.</p>
<p>Instead, you could have the callback simply buffer the data into an internal variable which you can call a function to interpret and process on a timer or in another thread which you can throw and catch your own exceptions while processing them in a context which you can do something contextually about.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/25940/stevemacenski/" rel="nofollow noreferrer">stevemacenski</a> with karma: 8272 on 2023-02-08</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
|
103009
|
2023-02-07T13:15:38.000
|
|rospy|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>ROS distribution: noetic, rospy</p>
<p>I want to raise specific exceptions depending on the data received from the rostopic. However, raising exceptions in the subscriber callback (user_callback) returns a bad callback error due to rospy callback exception handling:
<a href="https://github.com/ros/ros_comm/blob/c3d7c393fee534b7bbecbb495fba706196a06bcf/clients/rospy/src/rospy/topics.py#L736" rel="nofollow noreferrer">https://github.com/ros/ros_comm/blob/c3d7c393fee534b7bbecbb495fba706196a06bcf/clients/rospy/src/rospy/topics.py#L736</a></p>
<p>Is there a way to raise custom ROS exceptions in one node (user_command node) and handle it in another (control node)? Or is there another way to filter data from a subscribed topic and raise an exception accordingly?</p>
<p>For example:
I am subscribed to /user_commands. If a "t" is published I want to immediately exit the "scan" state while loop and switch to another state (track)</p>
<pre><code>class command_t(Exception):
pass
class command_h(Exception):
pass
class command_hv(Exception):
pass
class actions:
def __init__(self):
#initialize all my variables
#CALLBACKS
def user_callback(self,msg):
if (msg.data == 't'):
rospy.loginfo(msg.data)
raise command_t #BAD CALLBACK ERROR
if (msg.data == 'h'):
raise command_h
#STATES
def scan(self):
try:
rospy.loginfo("scan mode")
local_delta = 0
while (x0 + local_delta < x1):
self.waypoint(x0 + local_delta, y0, z)
self.waypoint(x0 + local_delta, y1, z)
local_delta = local_delta + self.delta
self.waypoint(x0 + local_delta, y1, z)
self.waypoint(x0 + local_delta, y0 , z)
local_delta = local_delta + self.delta
local_delta = 0
except command_t:
self.track()
except command_h:
self.home()
if __name__ == '__main__':
rospy.init_node("control")
action = actions()
user_sub = rospy.Subscriber("/user_commands", String, action.user_callback)
rate = rospy.Rate(100)
action.scan()
</code></pre>
<hr />
<p><a href="https://answers.ros.org/question/412263/raising-exceptions-in-subscriber-callbacks/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/136982/rhea/" rel="nofollow noreferrer">Rhea</a> on ROS Answers with karma: 3 on 2023-02-07</p>
<p>Post score: 0</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-02-08</strong>:<br />
Regardless of the technical implementation, and probably pedantic, but using exceptions for regular control flow seems like an abuse of the concept to me.</p>
<p>If you're happy, we're happy of course, but you might be trying to solve an xy-problem, or have other options which would follow best-practices more and don't rely on (potentially) incomplete implementations.</p>
|
Raising Exceptions in Subscriber Callbacks
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>There is a <code>pause</code> Launch Argument that you can set to <code>true</code> (<a href="https://github.com/ros-simulation/gazebo_ros_pkgs/blob/foxy/gazebo_ros/launch/gzserver.launch.py#L105" rel="nofollow noreferrer">defined here in the source</a>)</p>
<p>Your launch command could look something like this:</p>
<pre><code>import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource
def generate_launch_description():
ld = LaunchDescription()
gz_launch_path = os.path.join(get_package_share_directory('gazebo_ros'), 'launch', 'gazebo.launch.py')
ld.add_action(
IncludeLaunchDescription(
PythonLaunchDescriptionSource(gz_launch_path),
launch_arguments={'pause': 'true'}.items()
))
return ld
</code></pre>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/69938/shonigmann/" rel="nofollow noreferrer">shonigmann</a> with karma: 1567 on 2023-02-08</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/136990/nino/" rel="nofollow noreferrer">nino</a> on 2023-02-12</strong>:<br />
Thks for your support.
I have solved this by add this code in launch file</p>
<pre><code> load_gazebo= ExecuteProcess(
cmd=['gazebo', '-u', "-s","libgazebo_ros_factory.so"],
output='screen')
</code></pre>
<p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-02-14</strong>:<br />
@shonigmann: could you please not <em>close</em> questions when they have an accepted answer? Askbot displays those mostly as <code>[closed]</code>, which makes it look like there was no resolution. Accepting an answer already marks the question as answered, without needing to close it.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/69938/shonigmann/" rel="nofollow noreferrer">shonigmann</a> on 2023-02-14</strong>:<br />
I'm not familiar with Askbot, but my intent was always to help people coming to ROS Answers to <em>answer</em> questions more readily find questions that haven't yet been resolved. But if its making things less visible, I can certainly save myself that step and avoid closing questions. Thanks for the feedback</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-02-14</strong>:<br />
Askbot is the software platform behind ROS Answers.</p>
<blockquote>
<p>my intent was always to help people coming to ROS Answers to answer questions more readily find questions that haven't yet been resolved</p>
</blockquote>
<p>of course. I never doubted that.</p>
<p>But answered questions are already clearly marked as such, while closing them makes the "this is closed" part stand out more. So just accepting the correct answer would be enough.</p>
|
103011
|
2023-02-07T14:03:17.000
|
|gazebo|ros2|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Im want to start the simulation at pause state with the launch file. some one can help me? tks</p>
<hr />
<p><a href="https://answers.ros.org/question/412264/how-to-pause-gazebo-at-the-start-in-foxy?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/136990/nino/" rel="nofollow noreferrer">nino</a> on ROS Answers with karma: 1 on 2023-02-07</p>
<p>Post score: 0</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/19675/andromeda/" rel="nofollow noreferrer">Andromeda</a> on 2023-02-08</strong>:<br />
Probably you should provide with version of Gazebo are you using?</p>
|
How to pause gazebo at the start in foxy?
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>My guess is that you are meant to run mapping as a discrete process, and then used that generated map for navigation later on. I don't think they intended for you to run mapping while you are running the nav stack.</p>
<p>In any case, <code>tf</code> wouldn't allow them to run at the same time. You cannot have two parents for a given frame in ROS, so if the normal nav is publishing <code>odom->base_link</code> and the mapping is publishing <code>odom_gmapping->base_link</code>, tf will complain and won't function correctly. The only excaption there is if they are inverting the publication of the <code>odom_gmapping->base_link</code> transform and instead publishing the <code>base_link->odom_gmapping</code> transform. In that case, they might want to have independent state estimates in two frames.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/3384/tom-moore/" rel="nofollow noreferrer">Tom Moore</a> with karma: 13689 on 2023-06-05</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
|
103013
|
2023-02-07T23:07:54.000
|
|slam|navigation|ekf|gmapping|robot-localization|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I have a robot somewhat similar to the <a href="https://github.com/nickcharron/waypoint_nav" rel="nofollow noreferrer">clearpath husky</a> . In their gmapping launch file, they have their odom frame set to 'odom_gmapping'. config shown here:</p>
<pre><code><!-- Setting frames -->
<param name="odom_frame" value="odom_gmapping"/>
<param name="base_frame" value="base_link"/>
<param name="map_frame" value="map"/>
</code></pre>
<p>But in every other instance (costmaps, EKF, etc.) the odom frame is set to 'odom'. What is the point of having two split odom frames like that?</p>
<p>I know that if they used 'odom' in both, then the map-> odom ekf and gmapping would broadcast the same transform, but I am confused how this works</p>
<hr />
<p><a href="https://answers.ros.org/question/412276/what-is-the-purpose-of-splitting-slam-odom-and-ekf-odom-frames-in-waypoint_nav?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/115712/chased11/" rel="nofollow noreferrer">chased11</a> on ROS Answers with karma: 137 on 2023-02-07</p>
<p>Post score: 0</p>
|
What is the purpose of splitting SLAM odom and EKF odom frames in waypoint_nav?
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>It looks like you didn't fill in the ROS2 Distribution :-)</p>
<pre><code>../<ros2-distro>/...
</code></pre>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/25940/stevemacenski/" rel="nofollow noreferrer">stevemacenski</a> with karma: 8272 on 2023-02-08</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/37882/vini71/" rel="nofollow noreferrer">Vini71</a> on 2023-02-09</strong>:<br />
Hi Steve,</p>
<p>I fulfilled the export statement with "ros2-foxy" instead of "foxy".
In addition, I have installed additional pkg:</p>
<p>sudo apt-get install ros-foxy-turtlebot3-gazebo*
sudo apt-get install ros-foxy-robot-state-publisher*</p>
<p>Then it worked.
Steve, I checked <strong>your podcast with Ricardo</strong> and the NAV2 documentation.
I decided to use NAV2 for our research, which uses an autonomous truck for <strong>off-road</strong> monitoring applications. We were using Autoware.Universe, but we checked that it is "too much" for our simple scenario and decision-making needs. I checked that <strong>NAV2 works for Ackermann</strong> types, but <strong>even for a big truck</strong>?</p>
<p>I am also "afraid" about the localization pkg: The <strong>NDT-MCL</strong> localizer you mentioned on the podcast. We do have velodynes, but we're off-road, so we don't have a previous map with landmarks to match. Is this something impeditive to using NAV2 off-road?</p>
<p>What is <strong>your consideration</strong> in this regard? Do you have some success of-road cases to share a link?
Thanks</p>
|
103015
|
2023-02-08T02:04:06.000
|
|ros|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hi there,</p>
<p>I am running this tutorial <a href="https://navigation.ros.org/getting_started/index.html#installation" rel="nofollow noreferrer">https://navigation.ros.org/getting_started/index.html#installation</a>
I am using ROS2 Foxy in Ubuntu 20.04 and Gazebo 9</p>
<p>I have exported the models as the tutorial explains:</p>
<pre><code> source /opt/ros/<ros2-distro>/setup.bash
export TURTLEBOT3_MODEL=waffle
export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:/opt/ros/<ros2-distro>/share/turtlebot3_gazebo/models
</code></pre>
<p>However, Gazebo is not loading:</p>
<p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16758396542747366.png" alt="image description" /></p>
<p>I should have this behavior at the end when setting a 2D goal pose to the robot:</p>
<p><a href="https://navigation.ros.org/_images/navigation_with_recovery_behaviours.gif" rel="nofollow noreferrer">https://navigation.ros.org/_images/navigation_with_recovery_behaviours.gif</a></p>
<p>But I am not having success in localizing the robot...</p>
<hr />
<p><a href="https://answers.ros.org/question/412278/nav2---gazebo-does-not-load-model/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/37882/vini71/" rel="nofollow noreferrer">Vini71</a> on ROS Answers with karma: 266 on 2023-02-08</p>
<p>Post score: 0</p>
|
NAV2 - Gazebo does not load model
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>You have this:</p>
<blockquote>
<pre><code>catkin_package(
</code></pre>
</blockquote>
<pre><code> INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME}
CATKIN_DEPENDS roscpp
)
</code></pre>
<p>Note the <code>LIBRARIES ${PROJECT_NAME}</code> specifically.</p>
<p>This makes Catkin export a library target called <code>${PROJECT_NAME}</code> (in this case that would be equal to <code>utils</code>) to all your dependents.</p>
<p>This causes CMake, when parsing <code>utils/CMakeLists.txt</code> to expect a <code>utils</code> library target to exist (ie: be exported) by your <code>graph</code> project.</p>
<p>Since <code>utils</code> is header-only (according to you), there is no such <code>utils</code> library, hence the error message.</p>
<p>If you remove the <code>LIBRARIES ${PROJECT_NAME}</code>, things should start working (or at least: you shouldn't get <em>that</em> error any more).</p>
<p>PS: there are quite a few duplicates of this question here on ROS Answers. I've not looked them up this time, but please try to search before posting. Use Google, and append <code>site:answers.ros.org</code> to your query.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> with karma: 86574 on 2023-02-09</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/137155/milano/" rel="nofollow noreferrer">milano</a> on 2023-02-09</strong>:<br />
Now it works, thank you!
Sorry, I searched for similar issues, but none of the solutions I found worked.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-02-09</strong>:<br />
No need to apologise.</p>
|
103017
|
2023-02-08T12:00:18.000
|
|ros-melodic|catkin|cmake|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I have the following project structure:</p>
<pre><code>utils
include
image_utils.h
CMakelists.txt
package.xml
graph
src
graph.cpp
CMakelists.txt
package.xml
</code></pre>
<p>I am trying to use <code>image_utils.h</code> in <code>graph.cpp</code>.</p>
<p>The <code>CMakelists</code> inside utils looks like this:</p>
<pre><code>cmake_minimum_required(VERSION 3.0.2)
project(utils)
find_package(catkin REQUIRED COMPONENTS roscpp)
catkin_package(
INCLUDE_DIRS include
LIBRARIES <span class="math-container">${PROJECT_NAME}
CATKIN_DEPENDS roscpp
)
include_directories(
include
$</span>{catkin_INCLUDE_DIRS}
)
install(
DIRECTORY include/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
FILES_MATCHING PATTERN "*.h"
)
</code></pre>
<p>And in the <code>CMakelists</code> inside graph i call <code>find_package(catkin REQUIRED COMPONENTS roscpp utils)</code>.</p>
<p>My error message is:</p>
<pre><code> Project 'graph' tried to find library 'utils'. The library is neither
a target nor built/installed properly. Did you compile project 'utils'?
Did you find_package() it before the subdirectory containing its code is
included?
Call Stack (most recent call first):
/opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:76 (find_package)
CMakeLists.txt:7 (find_package)
</code></pre>
<p>Any idea what I am doing wrong here?</p>
<hr />
<p><a href="https://answers.ros.org/question/412299/unable-to-include-a-header-only-library/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/137155/milano/" rel="nofollow noreferrer">milano</a> on ROS Answers with karma: 3 on 2023-02-08</p>
<p>Post score: 0</p>
|
Unable to include a header-only library
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>There must be a delay. It takes time for the subscribers to be notified that the publisher has been created, and then more time for the subscriber to establish a network connection. The ros policy for a publisher that has no active subscribers is to simply discard the message. This policy makes sense because a subscriber may <em>never</em> connect.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> with karma: 4903 on 2023-02-09</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/137167/jtrubatch/" rel="nofollow noreferrer">jtrubatch</a> on 2023-02-09</strong>:<br />
Got it, thanks!</p>
|
103019
|
2023-02-08T15:31:33.000
|
|ros|rviz|ros-kinetic|ubuntu|markers|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Using the attached code for some reason the marker does not appear with the first call of publish() without a small delay inserted. If I echo the visualization_marker topic without the delay it does not display the msg associated with the first publish(), only the subsequent msgs. With the delay it displays all the msgs. Is there something in my code causing this or am I missing something as to why there would need to be a delay between setting the msg parameters and publishing it?</p>
<p>This is being run on a ubuntu 16.04.7, kernel 4.15.0-142 using VMWare 17, with ROS Kinetic</p>
<p>Thanks</p>
<pre><code>#include <ros/ros.h>
#include <visualization_msgs/Marker.h>
int main( int argc, char** argv )
{
ros::init(argc, argv, "add_markers");
ros::NodeHandle n;
visualization_msgs::Marker marker;
ros::Publisher marker_pub = n.advertise<visualization_msgs::Marker>("visualization_marker", 1);
uint32_t shape = visualization_msgs::Marker::CUBE;
marker.header.frame_id = "map";
marker.header.stamp = ros::Time::now();
marker.ns = "add_markers";
marker.id = 0;
marker.type = shape;
marker.action = visualization_msgs::Marker::ADD;
marker.pose.position.x = 4; // Pick Up position 4, 4
marker.pose.position.y = 4;
marker.pose.position.z = 0;
marker.pose.orientation.x = 0.0;
marker.pose.orientation.y = 0.0;
marker.pose.orientation.z = 0.0;
marker.pose.orientation.w = 1.0;
marker.scale.x = 0.25;
marker.scale.y = 0.25;
marker.scale.z = 0.25;
marker.color.r = 0.0f;
marker.color.g = 1.0f;
marker.color.b = 0.0f;
marker.color.a = 1.0;
marker.lifetime = ros::Duration();
ros::Duration(0.1).sleep(); // Why is this needed?
marker_pub.publish(marker);
ROS_INFO("Marker Placed");
ros::Duration(3.0).sleep();
marker.color.a = 0;
marker_pub.publish(marker);
ROS_INFO("Marker Hide");
ros::Duration(3.0).sleep();
marker.pose.position.x = 3.5;
marker.pose.position.y = -4;
marker.color.a = 1.0;
marker_pub.publish(marker);
ROS_INFO("Marker Reappear");
ros::Duration(2.0).sleep();
return 0;
}
</code></pre>
<hr />
<p><a href="https://answers.ros.org/question/412308/rviz-not-displaying-marker-on-first-call-of-publish(marker)/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/137167/jtrubatch/" rel="nofollow noreferrer">jtrubatch</a> on ROS Answers with karma: 3 on 2023-02-08</p>
<p>Post score: 0</p>
|
Rviz not displaying marker on first call of publish(marker)
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I solved this issue by turning off the Publish tf from odom to baselink in my controller node, since i am using arduino to directly publish velocity values instead of using differential drive controller. I have my own controller.cpp node to do it.
anyway the values don't jump around any more.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/56480/rahulwashere/" rel="nofollow noreferrer">Rahulwashere</a> with karma: 23 on 2023-03-01</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
|
103021
|
2023-02-09T03:54:06.000
|
|ros|ekf|ros-melodic|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hello, I have been trying to implement MPU 6050 imu sensor using, <a href="https://github.com/fsteinhardt/mpu6050_serial_to_imu" rel="nofollow noreferrer">MPU SERIAL NODE</a> , when i initially run the node, IMU values seem fine, for example, linear accelerations in x, y, z directions come to be ~0 , ~0 , ~ 9.8. orientation values of x,y,z,w seem to be fine as well, w ~ 1 rest ~ 0, However the moment i run my robot using teleop_twist, The values of these variables jump rapidly, i have attached a rosbag file to see how abrupt the jump occurs. also at the same time a warn message in console appears which is
WARN : TF to MSG quaternions not properly normalized !
due to this i am not able to use the robot localization package cause my wheel odometery is not good, i.e laser scans drift over time and amcl cannot match them with given odom. I hope to resolve this issue by sensor fusion.</p>
<p>can any one help to resolve this issue ?</p>
<hr />
<p><a href="https://answers.ros.org/question/412318/issue-in-using-imu-mpu-6050/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/56480/rahulwashere/" rel="nofollow noreferrer">Rahulwashere</a> on ROS Answers with karma: 23 on 2023-02-09</p>
<p>Post score: 0</p>
|
Issue in using IMU MPU 6050
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>There seems to be a mistake in the way the requestService is written.
I think the following will solve the problem.</p>
<pre><code>requestService = (params) => {
// let request = new ServiceRequest(params);
let request = new ServiceRequest({data : params});
return request;
};
</code></pre>
<p>ref : <a href="https://docs.ros.org/en/noetic/api/std_srvs/html/srv/SetBool.html" rel="nofollow noreferrer">https://docs.ros.org/en/noetic/api/std_srvs/html/srv/SetBool.html</a></p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/59801/miura/" rel="nofollow noreferrer">miura</a> with karma: 1908 on 2023-02-11</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
|
103023
|
2023-02-09T05:44:45.000
|
|ros|roslib|rosservice|roslibjs|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I 'm using this <strong>service server</strong> in <code>Python</code>:</p>
<pre><code>#! /usr/bin/env python3
import rospy
from std_srvs.srv import SetBool, SetBoolResponse
class StateController:
def __init__(self):
rospy.init_node("state_controller", anonymous=True)
rospy.Service("validate_vision_info", SetBool, self.validVision)
rospy.spin()
def validVision(self, req):
model_valid = req.data
rospy.logwarn("Vision Model Validation: {}".format(req.data))
return SetBoolResponse(success=True, message="")
if __name__ == "__main__":
try:
controller_ = StateController()
except rospy.ROSInterruptException:
logging.error("Error in the State Controller")
</code></pre>
<p>And this <strong>service client</strong> in <code>JavaScript</code>:</p>
<pre><code>import { Ros, Service, ServiceRequest } from "roslib";
class ROSInterface {
constructor() {
this.ros = new Ros({
url: "ws://localhost:9090",
});
}
createService = (service_name, service_type) => {
let service = new Service({
ros: this.ros,
name: service_name,
serviceType: service_type,
});
return service;
};
requestService = (params) => {
let request = new ServiceRequest(params);
return request;
};
}
function validate(val) {
const service_name = "/validate_vision_info";
const service_type = "std_srvs/SetBool";
const iface_ = new ROSInterface();
const srv = iface_.createService(service_name, service_type);
const req = iface_.requestService(val);
srv.callService(
req,
(result) => {
console.log(result);
},
(error) => {
console.log(error);
});
}
validate(true);
validate(false);
</code></pre>
<p><strong>My problem</strong> is that: always the service request data is <code>False</code> no matter what is the sent request <code>true</code> or <code>false</code>!</p>
<p>Can you please tell me how can I solve my problem? thanks in advance.</p>
<hr />
<p><a href="https://answers.ros.org/question/412329/datatype-issue-while-calling-setbool-service-from-js-client/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/71460/bhomaidan/" rel="nofollow noreferrer">bhomaidan</a> on ROS Answers with karma: 114 on 2023-02-09</p>
<p>Post score: 0</p>
|
Datatype issue while calling setBool service from JS client
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I think I found it: <a href="https://github.com/colcon/colcon-ros/blob/master/colcon_ros/task/ament_python/build.py" rel="nofollow noreferrer">https://github.com/colcon/colcon-ros/blob/master/colcon_ros/task/ament_python/build.py</a></p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/12141/ct2034/" rel="nofollow noreferrer">ct2034</a> with karma: 862 on 2023-02-10</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
|
103025
|
2023-02-09T10:12:18.000
|
|ros2|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I was trying to create some documentation for <code>ament_python</code>. But I don't even know where to start. It does not seem to be a package. There is no entry in <a href="https://index.ros.org/search/?term=ament_python&section=pkgs" rel="nofollow noreferrer">https://index.ros.org/search/?term=ament_python&section=pkgs</a>. There is this abandoned repo: <a href="https://github.com/ament/ament_python" rel="nofollow noreferrer">https://github.com/ament/ament_python</a> But it must be defined somewhere, because it can be defined as build_type, right?</p>
<hr />
<p><a href="https://answers.ros.org/question/412339/what-is-ament_python?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/12141/ct2034/" rel="nofollow noreferrer">ct2034</a> on ROS Answers with karma: 862 on 2023-02-09</p>
<p>Post score: 0</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/63587/ljaniec/" rel="nofollow noreferrer">ljaniec</a> on 2023-02-09</strong>:<br />
I found some entries for <code>ament_python</code> in the ROS2 GitHub: <a href="https://github.com/ament/ament_package" rel="nofollow noreferrer">https://github.com/ament/ament_package</a>, <a href="https://github.com/ament/ament_package/blob/rolling/package.xml" rel="nofollow noreferrer">https://github.com/ament/ament_package/blob/rolling/package.xml</a>, did you check it?</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/12141/ct2034/" rel="nofollow noreferrer">ct2034</a> on 2023-02-10</strong>:<br />
Yes, I found those too. But I think this is not relevant since ament is not used as build tool anymore.</p>
|
What is ament_python?
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<blockquote>
<p>I found their std_msgs headers are located in different folders as shown here.</p>
<p>The Ubuntu 22.04 has one more extra include layer for the std_msgs. Is this the expected behavior for different Ubuntu versions?</p>
</blockquote>
<p>I wouldn't call it <em>behaviour</em>, but: yes, this is expected. See <a href="https://github.com/ros2/ros2/issues/1150" rel="nofollow noreferrer">ros2/ros2#1150</a> for context.</p>
<p>Note: unless you're (planning to) manually manage your include paths, this change should not have any affect on your development workflow. CMake will take care of sorting things out for you.</p>
<blockquote>
<p>I have two clean installed Ubuntu, 20.04 and 22.04, and both of them are installed with ROS2 rolling.</p>
</blockquote>
<p>please note: Rolling on Focal (<code>20.04</code>) is no longer being updated. It saw its last <em>sync</em> on 2022-01-28, which is over a year ago. See the following discussions for context:</p>
<ul>
<li><a href="https://discourse.ros.org/t/preparing-ros-2-rolling-for-the-transition-to-ubuntu-22-04/23124" rel="nofollow noreferrer">Preparing ROS 2 Rolling for the transition to Ubuntu 22.04</a></li>
<li><a href="https://discourse.ros.org/t/preparing-for-final-rolling-sync-on-ubuntu-focal-2022-01-25/23920" rel="nofollow noreferrer">Preparing for final Rolling sync on Ubuntu Focal 2022-01-25</a></li>
<li><a href="https://discourse.ros.org/t/rolling-ridley-has-rolled-onto-ubuntu-jammy/24400" rel="nofollow noreferrer">Rolling Ridley has rolled onto Ubuntu Jammy</a></li>
<li><a href="https://discourse.ros.org/t/new-packages-for-ros-2-rolling-ridley-2022-01-28/24067" rel="nofollow noreferrer">New packages for ROS 2 Rolling Ridley 2022-01-28</a></li>
</ul>
<p>Basically: Rolling on Focal is very different from Rolling on Jammy.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> with karma: 86574 on 2023-02-11</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/59813/chris7462/" rel="nofollow noreferrer">Chris7462</a> on 2023-02-15</strong>:<br />
I see. Thank you for your reply. Really appreciate it.</p>
|
103030
|
2023-02-10T14:32:40.000
|
|ros|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I have two clean installed Ubuntu, 20.04 and 22.04, and both of them are installed with ROS2 rolling.
Somehow I found their std_msgs headers are located in different folders as shown <img src="https://imgur.com/a/YpcARzC" alt="here" />.</p>
<p>The Ubuntu 22.04 has one more extra include layer for the std_msgs. Is this the expected behavior for different Ubuntu versions?</p>
<p>Thanks!</p>
<hr />
<p><a href="https://answers.ros.org/question/412383/ros2-rolling-header-location-for-different-ubuntu-version/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/59813/chris7462/" rel="nofollow noreferrer">Chris7462</a> on ROS Answers with karma: 3 on 2023-02-10</p>
<p>Post score: 0</p>
|
ROS2 rolling header location for different Ubuntu version
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p><code>--ros-args</code> is always added to the commandline arguments, but at the end, after any arguments: <a href="https://github.com/ros2/launch_ros/blob/6daacbce4bade7ed40f86f16a30a08b4d7ee9272/launch_ros/launch_ros/actions/node.py#L209" rel="nofollow noreferrer">https://github.com/ros2/launch_ros/blob/6daacbce4bade7ed40f86f16a30a08b4d7ee9272/launch_ros/launch_ros/actions/node.py#L209</a>. If you write code to read these commandline arguments, you might need to filter it out.</p>
<p>You can also ask <code>rclcpp</code> to remove ROS arguments from the arguments vector (<code>argv</code>) when initializing. Then I imagine you wouldn't need to filter it out. See <code>rclcpp::init_and_remove_ros_arguments()</code>: <a href="https://github.com/ros2/rclcpp/blob/28e4b1bd738c23e3ede2c70bf35786ce829ae910/rclcpp/include/rclcpp/utilities.hpp#L140" rel="nofollow noreferrer">https://github.com/ros2/rclcpp/blob/28e4b1bd738c23e3ede2c70bf35786ce829ae910/rclcpp/include/rclcpp/utilities.hpp#L140</a></p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/29634/christophebedard/" rel="nofollow noreferrer">christophebedard</a> with karma: 641 on 2023-02-20</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
|
103032
|
2023-02-14T09:20:46.000
|
|ros2|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I am trying to launch a node that requires common command line arguments.
In my launch file, I added a Node() instance in my LaunchDescription which contains the <code>package</code>, <code>executable</code> and <code>arguments</code> attributes. However the launched program complains about not knowing about argument <code>--ros-args</code>.
I thought it was the <code>ros_arguments</code> attribute in the Node that added the <code>--ros-args</code> argument to the launch command so I don't understand why I am getting this error.</p>
<p>I am running Ubuntu 22.04 and ROS2 Humble.</p>
<p>How can we launch a program from a launch file without the launch file adding the <code>--ros-args</code> argument to the launch command ?</p>
<hr />
<p><a href="https://answers.ros.org/question/412486/--ros-args-argument-is-always-present-in-launched-node/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/108956/sam_prt/" rel="nofollow noreferrer">Sam_Prt</a> on ROS Answers with karma: 28 on 2023-02-14</p>
<p>Post score: 0</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/29634/christophebedard/" rel="nofollow noreferrer">christophebedard</a> on 2023-02-14</strong>:<br />
Can you share your launch file and the code that reads command line arguments?</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/29634/christophebedard/" rel="nofollow noreferrer">christophebedard</a> on 2023-02-14</strong>:<br />
Also, can you clarify what exactly is complaining about the <code>--ros-args</code>? Is it your own code, or is ROS 2 itself complaining about it?</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/29634/christophebedard/" rel="nofollow noreferrer">christophebedard</a> on 2023-02-14</strong>:<br />
In short, <code>--ros-args</code> is always added to the commandline arguments, but at the end after any <code>arguments</code>: <a href="https://github.com/ros2/launch_ros/blob/6daacbce4bade7ed40f86f16a30a08b4d7ee9272/launch_ros/launch_ros/actions/node.py#L209" rel="nofollow noreferrer">https://github.com/ros2/launch_ros/blob/6daacbce4bade7ed40f86f16a30a08b4d7ee9272/launch_ros/launch_ros/actions/node.py#L209</a>. If you write code to read these commandline arguments, you might need to filter it out.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/108956/sam_prt/" rel="nofollow noreferrer">Sam_Prt</a> on 2023-02-20</strong>:<br />
Oh ok, I thought it was more of an either/or logic. Thanks for your help ! Would you like to post an answer so I can accept it ?</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/29634/christophebedard/" rel="nofollow noreferrer">christophebedard</a> on 2023-02-20</strong>:<br />
sure, done!</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/29634/christophebedard/" rel="nofollow noreferrer">christophebedard</a> on 2023-02-21</strong>:<br />
Note that I edited my answer to mention <code>rclcpp::init_and_remove_ros_arguments()</code>. It just popped into my head.</p>
|
--ros-args argument is always present in launched Node
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Are you trying to start a <code>.launch</code> file which requires a usb camera on a PC which doesn't have the camera connected?</p>
<p>If that's the case, the problem would not be permissions, but the fact the camera is connected to the other device/PC.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> with karma: 86574 on 2023-02-15</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/97994/kozinovsky/" rel="nofollow noreferrer">kozinovsky</a> on 2023-02-15</strong>:<br />
Ops, that is exactly what I am trying to do. Thank you, I didn't know that this <strong>launch</strong> file can be run only locally (on ROS-master PC).
But then, how, using <strong>usb_cam</strong> package can I see a camera picture on the remote laptop which has access to the ROS-master PC with a connected USB camera to it?</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-02-15</strong>:<br />
Start <code>image_view</code> (or whatever you want to use to see the <code>sensor_msgs/Image</code> stream) on your laptop after starting the <code>.launch</code> file which starts <code>usb_cam</code> on the host <em>with</em> the camera?</p>
<p>ROS is networked/distributed by default. You just have to <a href="http://wiki.ros.org/ROS/Tutorials/MultipleMachines" rel="nofollow noreferrer">configure it correctly</a>.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/97994/kozinovsky/" rel="nofollow noreferrer">kozinovsky</a> on 2023-02-15</strong>:<br />
Thank you so much! That is what I was looking for. Just checked it on my setup - it works. Thanks again!</p>
|
103034
|
2023-02-14T13:17:41.000
|
|ros|ros-melodic|usb-camera|camera|usb-cam|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hello everyone!</p>
<p>My configuration is the following:</p>
<ol>
<li><p>ROS-master computer: Nvidia TX2 with Ubuntu 18.04, ROS melodic and package usb_cam installed on it
, and Logitech USB camera connected to it through the USB port</p>
</li>
<li><p>The computer which I try to start the command <code>roslaunch usb_cam usb_cam-test.launch</code> from:
Ubuntu 18.04</p>
</li>
</ol>
<p>I've found one similar question on this forum: #q284015.</p>
<p><strong>But</strong> my problem is a little bit different because my configuration includes <strong>2 computers</strong>.</p>
<p>Here is the situation:</p>
<p>I <code>ssh</code> on board computer (<strong>Nvidia TX2</strong> with Ubuntu 18.04 and ROS melodic) and start <code>roscore</code> on it
and after that start this command on my computer:</p>
<pre><code>roslaunch usb_cam usb_cam-test.launch
</code></pre>
<p>So, ROS-Master is different computer from the one where I start the command.
But I don't have any issues with connecting to ROS-master.
And <code>roslaunch usb_cam usb_cam-test.launch</code> works perfectly fine, when I do it locally, on <strong>Nvidia TX2</strong> which is ROS-master computer.</p>
<p>I have an error when I try to run it on my laptop which isn't ROS-master and after the following command:</p>
<pre><code>roslaunch usb_cam usb_cam-test.launch
</code></pre>
<p>I have this error message:</p>
<pre><code>[ERROR] [1676393342.653244327]: Cannot identify '/dev/video0': 2, No such file or directory
[usb_cam-1] process has died [pid 3741, exit code 1, cmd /opt/ros/melodic/lib/usb_cam/usb_cam_node __name:=usb_cam __log:=/....log
</code></pre>
<p>I can see <code>/dev/video0</code> device on my ROS-master computer, so, the device totally exists and, as I mentioned above, I can run this command locally on the ROS-master computer, the problem is only with running the command from the remote computer.</p>
<p>Looks like some problem with the permission of the remote user, but I don't understand how to add permission for the remote user:</p>
<blockquote>
<p>Try adding yourself to the user group</p>
<pre><code>sudo usermod -a -G dialout $USER
</code></pre>
</blockquote>
<p>Mean, this advice looks like something which can help me, but I don't understand how to apply it for the remote user/computer</p>
<p>Thanks in advance!</p>
<hr />
<p><a href="https://answers.ros.org/question/412501/using-usb_cam-from-remote-computer.-cannot-identify-%27/dev/video0%27:-2,-no-such-file-or-directory/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/97994/kozinovsky/" rel="nofollow noreferrer">kozinovsky</a> on ROS Answers with karma: 5 on 2023-02-14</p>
<p>Post score: 0</p>
|
using usb_cam from remote computer. Cannot identify '/dev/video0': 2, No such file or directory
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>You can use,</p>
<p>Kuka Youbot,</p>
<p><a href="https://github.com/ctruillet/youbot_description" rel="nofollow noreferrer">https://github.com/ctruillet/youbot_description</a></p>
<p>or you can use URDf and links from this <a href="https://github.com/zyjiao4728/Planning-on-VKC" rel="nofollow noreferrer">https://github.com/zyjiao4728/Planning-on-VKC</a></p>
<p>note on this you have to convert the Ros code to ROS2.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/63046/ranjit-kathiriya/" rel="nofollow noreferrer">Ranjit Kathiriya</a> with karma: 1622 on 2023-02-15</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
|
103036
|
2023-02-14T19:05:07.000
|
|ros|manipulator|mobile-base|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hello. Where can I find 6 DOF manipulator with a 4-wheel mobile base packages for gazebo?</p>
<p>Thanks.</p>
<hr />
<p><a href="https://answers.ros.org/question/412513/where-can-i-find-6-dof-manipulator-packages-for-gazebo?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/56714/nickros/" rel="nofollow noreferrer">NickRos</a> on ROS Answers with karma: 1 on 2023-02-14</p>
<p>Post score: 0</p>
|
Where can I find 6 DOF manipulator packages for gazebo?
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hello there,</p>
<p>I think you need to correct your <code>robot_core.xacro</code> file:</p>
<pre><code><color rgba="1 1 1 1"/ >
</code></pre>
<p>Ensure you are not keeping a space while closing the tag between <code>/</code> and <code>></code>. You need to change this to your full file.</p>
<blockquote>
<p>In your Link : chassis</p>
</blockquote>
<p>It would help if you closed <code><geometry></code> tag you can do so by <code></geometry></code>.</p>
<p>I think this should fix the error.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/63046/ranjit-kathiriya/" rel="nofollow noreferrer">Ranjit Kathiriya</a> with karma: 1622 on 2023-02-16</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
|
103038
|
2023-02-15T20:12:53.000
|
|ros2|roslaunch|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hi,
There is some error in launch file, could someone help me with this.</p>
<p>rsp.launch.py:</p>
<pre><code>import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.substitutions import LaunchConfiguration
from launch.actions import DeclareLaunchArgument
from launch_ros.actions import Node
import xacro
def generate_launch_description():
# Check if we're told to use sim time
use_sim_time = LaunchConfiguration('use_sim_time')
# Process the URDF file
pkg_path = os.path.join(get_package_share_directory('my_bot'))
xacro_file = os.path.join(pkg_path,'description','robot.urdf.xacro')
robot_description_config = xacro.process_file(xacro_file)
# Create a robot_state_publisher node
params = {'robot_description': robot_description_config.toxml(), 'use_sim_time': use_sim_time}
node_robot_state_publisher = Node(
package='robot_state_publisher',
executable='robot_state_publisher',
output='screen',
parameters=[params]
)
# Launch!
return LaunchDescription([
DeclareLaunchArgument(
'use_sim_time',
default_value='false',
description='Use sim time if true'),
node_robot_state_publisher
])
</code></pre>
<p>robot_core.xecro:</p>
<pre><code><?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" >
<material name="white">
<color rgba="1 1 1 1"/ >
</material>
<material name="orange">
<color rgba="1 0.3 0.1 1"/ >
</material>
<material name="blue">
<color rgba="0.2 0.2 1 1"/ >
</material>
<material name="black">
<color rgba="0 0 0 1"/ >
</material>
<link name="base_link">
</link>
<joint name="chassis_joint" type="fixed">
<parent link="base_link"/>
<child link="chassis"/>
<origin xyz="-0.1 0 0"/>
</joint>
<link name="chassis">
<visual>
<origin xyz="0.15 0 0.75"/>
<geometry>
<box size="0.3 0.3 0.15"/>
<geometry>
<material name="white"/>
</visual>
</link>
</robot>
</code></pre>
<p>robot.urdf.xecro file:</p>
<pre><code><?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="robot">
<xacro:include filename="robot_core.xacro" />
</robot>
</code></pre>
<hr />
<p><a href="https://answers.ros.org/question/412559/%5Berror%5D-%5Blaunch%5D:-caught-exception-in-launch-(see-debug-for-traceback):-caught-exception-when-trying-to-load-file-of-format-%5Bpy%5D:-not-well-formed-(invalid-token):-line-5,-column-30/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/138531/sumukha/" rel="nofollow noreferrer">Sumukha</a> on ROS Answers with karma: 1 on 2023-02-15</p>
<p>Post score: 0</p>
|
Exception in Launch: Invalid Token in File
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>if you are running out of RAM building it natively on the pi you can set up a swapfile on the sd card (a standard linux technique not ros specific to use persistent storage as additional RAM - it will be slow but it should enable to the process to complete</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/4160/nickw/" rel="nofollow noreferrer">nickw</a> with karma: 1504 on 2023-02-19</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/68917/wl/" rel="nofollow noreferrer">wl</a> on 2023-02-19</strong>:<br />
Thank you, it worked! Build of rclcpp took 73min, but it has finished, at least!</p>
|
103040
|
2023-02-18T10:07:48.000
|
|ros2|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I'm trying to cross-compile ROS2 Humble itself for Raspberry Pi 3 Model B.</p>
<p>My board is not new, it has 32-bit CPU and 1Gb of RAM.
I have installed Ubuntu 22.10 server on it.</p>
<p>I have failed to find binary ROS2 packages for it and now trying to build them from source.</p>
<p>However, building on the Raspberry directly often fails, because a compiler exhausts RAM and OS kills it.
I have installed ros_cross_compile tool and now trying to cross-compile ROS2 on my laptop.
However, this tool tries to download packages instead of building them and fails.</p>
<p>Commands</p>
<pre><code>mkdir -p ros2_humble/src
cd ros2_humble
vcs import --input https://raw.githubusercontent.com/ros2/ros2/humble/ros2.repos src
ros_cross_compile . --arch armhf --os ubuntu --rosdistro humble
</code></pre>
<p>Here is the tail of their output</p>
<pre><code>INFO:Docker Client:+ apt-get install -y cmake acl libacl1-dev libatomic1 python3-pytest python3-dev ros-humble-mimick-vendor libconsole-bridge-dev libeigen3-dev git uncrustify doxygen libignition-cmake2-dev libopencv-dev ros-humble-fastcdr libssl-dev libtinyxml2-dev libasio-dev libtinyxml-dev python3-numpy python3-yaml python3-pytest-timeout qtbase5-dev libspdlog-dev python3-pycodestyle python3-catkin-pkg-modules python3-empy python3-pkg-resources python3-minimal ros-humble-orocos-kdl-vendor libqt5core5a libqt5gui5 qt5-qmake libbenchmark-dev libqt5opengl5 libqt5widgets5 ros-humble-laser-geometry ros-humble-cv-bridge python3-mypy python3-pytest-mock libassimp-dev python3-importlib-metadata ros-humble-urdfdom-headers libfreetype6 libx11-dev libxaw7-dev libxrandr-dev libgl1-mesa-dev libglu1-mesa-dev pkg-config libfreetype6-dev python3-flake8 python3-lark libxml2-utils python3-psutil python3-rosdistro-modules openssl libcunit1-devros-humble-kdl-parser libsqlite3-dev python3-setuptools python3-argcomplete python3-netifaces python3-packaging graphviz libgtest-dev rti-connext-dds-6.0.1 pydocstyle clang-tidy python3-babeltrace libbullet-dev pyflakes3 python3-lxml python3-cryptography libzstd-dev libignition-math6-dev libcurl4-openssl-dev curl file pybind11-dev python3-nose clang-format libyaml-dev python3-pytest-cov google-mock python3-lttng cppcheck ros-humble-urdfdom libyaml-cpp-dev
INFO:Docker Client:Reading package lists...
INFO:Docker Client:Building dependency tree...
INFO:Docker Client:Reading state information...
INFO:Docker Client:E: Unable to locate package ros-humble-mimick-vendor
E: Unable to locate package ros-humble-fastcdr
E: Unable to locate package ros-humble-orocos-kdl-vendor
E: Unable to locate package ros-humble-laser-geometry
E: Unable to locate package ros-humble-cv-bridge
INFO:Docker Client:E: Unable to locate package ros-humble-urdfdom-headers
E: Unable to locate package ros-humble-kdl-parser
INFO:Docker Client:E: Unable to locate package ros-humble-urdfdom
</code></pre>
<p>It tries to install the packages with <code>apt</code> instead of building them.</p>
<p>This command is written in the file <code>cc_internals/armhf-ubuntu-humble/install_rosdeps.sh</code>. I've tried to edit it, however, ros_cross_compile tool overwrites it, and I cannot find how to make it to use my own file instead of generating it.</p>
<p>I have tried to submit my customized <code>install_rosdeps.sh</code> with <code>--custom-rosdep-script </code> flag, but it didn't help.</p>
<hr />
<p><a href="https://answers.ros.org/question/412639/cross-compilation-of-ros2-humble-for-raspberry-pi/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/68917/wl/" rel="nofollow noreferrer">wl</a> on ROS Answers with karma: 127 on 2023-02-18</p>
<p>Post score: 0</p>
|
Cross-compilation of ROS2 Humble for Raspberry PI
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>For posterity, I found a solution using the executable tag. Let's say you wanted to spawn a second turtle in turtlesim, the below will accomplish this:</p>
<pre><code><executable
cmd="/spawn turtlesim/srv/Spawn '{x: 1.0, y: 1.0, theta: 0, name: 'custom_turtle'}'"
cwd="/home"
launch-prefix="ros2 service call"
output="screen"
>
</executable>
</code></pre>
<p>I don't know what 'cwd' is used for but it should remain as "/home" or else this particular command won't work. You can also combine the launch-prefix and cmd if so desired.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/139551/ros_engineer/" rel="nofollow noreferrer">ROS_Engineer</a> with karma: 16 on 2023-02-20</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
|
103042
|
2023-02-19T16:04:36.000
|
|ros|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Is there an equivalent to rosservice from ROS1 in ROS2?
Much appreciated.</p>
<hr />
<p><a href="https://answers.ros.org/question/412657/how-to-call-a-service-from-xml-launch-file?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/139551/ros_engineer/" rel="nofollow noreferrer">ROS_Engineer</a> on ROS Answers with karma: 16 on 2023-02-19</p>
<p>Post score: 0</p>
|
How to call a service from XML launch file?
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Perhaps you could change the node name with <a href="https://wiki.ros.org/Nodes#Remapping_Arguments.Special_keys" rel="nofollow noreferrer">this keyword</a>?</p>
<blockquote>
<p><code>__name</code></p>
<pre><code>`__name` is a special reserved keyword for "the name of the node." It
</code></pre>
<p>lets you remap the node name without
having to know its actual name. It can
only be used if the program that is
being launched contains one node.</p>
</blockquote>
<p>I tried to find the relevant code snippet in the <code>rosbag</code> repository but could not find it, unfortunately. I would also like to see the answer to this question, it is interesting and a solution would be useful.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/63587/ljaniec/" rel="nofollow noreferrer">ljaniec</a> with karma: 3064 on 2023-02-21</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-02-22</strong>:<br />
You can specify the name of the rosbag ros node by using the option <code>__name:=myname</code> after the <code>play</code> keyword. In noetic, the <code>rosbag play</code> command is a python wrapper around compiled app <code>/opt/ros/noetic/lib/rosbag/play</code>.</p>
<p>A bag file does not record the publisher node name for a message, so if there was originally more than one publisher, it's not possible to recreate the original behavior using the bag file they have.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/109848/shouvik1984/" rel="nofollow noreferrer">shouvik1984</a> on 2023-02-23</strong>:<br />
Thank you. This appears to work. Multiple node is indeed a challenge.</p>
|
103044
|
2023-02-21T00:22:04.000
|
|rosbag|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Greetings</p>
<p>As a part of my application logic I have a single callback to obtain data from multiple topics from multiple nodes that are subscribed. Each topic has the same message type.</p>
<pre><code>void callBackName(
const ros::MessageEvent<geometry_msgs::PoseWithCovarianceStamped>& any_node)
</code></pre>
<p>I am disambiguating the node name inside the callback function using.</p>
<pre><code>const std::string& node_name = any_node.getPublisherName();
</code></pre>
<p>Sometimes we do unit test the application logic using recorded rosbags just by executing the subscriber node. However when we start playing rosbag, under the topic graph a random node name is created viz. <code>play_<timestamp of recording></code> and hence the callBackName logic fails as the node name does not match the publisher node name as it would appear for a fully integrated system where the publisher nodes are also executing.</p>
<p>Is there a way to impart a suitable node name while playing the rosbag so that the node name disambiguation logic works as it should in a fully integrated system.</p>
<hr />
<p><a href="https://answers.ros.org/question/412697/naming-a-node-while-playing-from-rosbag/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/109848/shouvik1984/" rel="nofollow noreferrer">shouvik1984</a> on ROS Answers with karma: 28 on 2023-02-21</p>
<p>Post score: 1</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-02-21</strong>:<br />
This is going to be super pedantic, for which I apologise, but for anyone reading this in the future: this is exactly one of those examples which shows why <em>anonymous</em> publish-subscribe should not be broken or circumvented by (trying to) write special logic for nodes with particular names.</p>
<p>This is not a critique directed at the OP, nor at the system he's working with. There are probably valid reasons why it was constructed the way it is constructed. Just make absolutely sure, when intending to create a similar setup, you <em>need</em> to know the name of the publisher -- instead of something like the location where sensor data was captured (for example). Those are different things, and there are other ways to get that sort of information (TF for instance).</p>
|
Naming a node while playing from rosbag
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>The names of the map topics do not appear to match.</p>
<p>The map topic that move_base is trying to subscribe to is /map.
In contrast, the map topic published by gmapping should be /tb3_1/map etc., not /map.</p>
<p>There is progress to be made in aligning them.
You could try removing <code><remap from="map" to="/map" /></code> from move_base.launch.</p>
<p>Before you do that, we recommend that you check the list of topics to see who the publisher and subscribers are.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/59801/miura/" rel="nofollow noreferrer">miura</a> with karma: 1908 on 2023-02-26</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/110678/hunterlineage1/" rel="nofollow noreferrer">hunterlineage1</a> on 2023-03-01</strong>:<br />
This helps. So previously my <code>move_base_simple/goal</code> for each turtlebot3 was being set on the global /map topic. This is undesired because the /map is a result of the combination of <code>/tb3_0/map, /tb3_1/map,</code> and <code>/tb3_2/map</code> using multirobot_map_merge package. When I removed <code><remap from="map" to="/map" /></code> the <code>move_base_simple/goal</code> for each turtlebot3 was sent to /tb3_0/map, /tb3_1/map,<code>and</code>/tb3_2/map<span class="math-container">`</span> respectively.</p>
|
103046
|
2023-02-21T01:32:47.000
|
|navigation|ros-melodic|move-base|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I am trying to run move_base nodes for each of 3 turtlebot3s in ROS melodic and gazebo9. My approach is taken mainly from the <a href="https://answers.ros.org/question/41433/multiple-robots-simulation-and-navigation/#41434" rel="nofollow noreferrer">"Multiple robots simulation and navigation"</a> answer which gives instructions on how to simulate multiple turtlebot3s (3 in my case) using AMCL package and the navigation stack. <a href="http://wiki.ros.org/amcl" rel="nofollow noreferrer">AMCL</a> package "track the pose of a robot against a known map" but in this case I am running gmapping SLAM on my 3 turtlebot3s. I am not using amcl package because I am using gmapping SLAM to do my localization and map building.</p>
<p>My objective is to run explore_lite on 3 turtlebot3s and using <a href="http://wiki.ros.org/multirobot_map_merge" rel="nofollow noreferrer">multirobot_map_merge</a> to merge their individual maps. For now, I am trying to run move_base for each of the 3 turtlebot3s and use '2D Nav Goal' for each of their /move_base_simple/goal topics. When I run my multi_move_base.launch file, I get the following error:</p>
<pre><code>[ WARN] [1676956640.385330213, 617.147000000]: Timed out waiting for transform from base_footprint to map to become available before running costmap, tf error: canTransform: source_frame base_footprint does not exist.. canTransform returned after 0.101 timeout was 0.1.
</code></pre>
<p>I am not able to solve this error. Here are my launch files:</p>
<pre><code>roslaunch turtlebot3_gazebo multi_MAIN_turtlebot3.launch
</code></pre>
<p>uses <code>multi_MAIN_turtlebot3.launch</code>:</p>
<pre><code><launch>
<!-- <param name="/use_sim_time" value="true"/> -->
<arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle, waffle_pi]"/>
<arg name="first_tb3" default="tb3_0"/>
<arg name="second_tb3" default="tb3_1"/>
<arg name="third_tb3" default="tb3_2"/>
<arg name="first_tb3_x_pos" default="-7.0"/>
<arg name="first_tb3_y_pos" default="-1.0"/>
<arg name="first_tb3_z_pos" default=" 0.0"/>
<arg name="first_tb3_yaw" default=" 1.57"/>
<arg name="second_tb3_x_pos" default=" 7.0"/>
<arg name="second_tb3_y_pos" default="-1.0"/>
<arg name="second_tb3_z_pos" default=" 0.0"/>
<arg name="second_tb3_yaw" default=" 1.57"/>
<arg name="third_tb3_x_pos" default=" 0.5"/>
<arg name="third_tb3_y_pos" default=" 3.0"/>
<arg name="third_tb3_z_pos" default=" 0.0"/>
<arg name="third_tb3_yaw" default=" 0.0"/>
<include file="<span class="math-container">$(find gazebo_ros)/launch/empty_world.launch">
<arg name="world_name" value="$</span>(find turtlebot3_gazebo)/worlds/turtlebot3_house.world"/>
<arg name="paused" value="false"/>
<arg name="use_sim_time" value="true"/>
<arg name="gui" value="true"/>
<arg name="headless" value="false"/>
<arg name="debug" value="false"/>
</include>
<group ns = "<span class="math-container">$(arg first_tb3)">
<param name="robot_description" command="$</span>(find xacro)/xacro <span class="math-container">$(find turtlebot3_description)/urdf/turtlebot3_$</span>(arg model).urdf.xacro" />
<node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" output="screen">
<param name="publish_frequency" type="double" value="50.0" />
<param name="tf_prefix" value="$(arg first_tb3)" />
</node>
<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-urdf -model <span class="math-container">$(arg first_tb3) -x $</span>(arg first_tb3_x_pos) -y <span class="math-container">$(arg first_tb3_y_pos) -z $</span>(arg first_tb3_z_pos) -Y $(arg first_tb3_yaw) -param robot_description" />
</group>
<group ns = "<span class="math-container">$(arg second_tb3)">
<param name="robot_description" command="$</span>(find xacro)/xacro <span class="math-container">$(find turtlebot3_description)/urdf/turtlebot3_$</span>(arg model).urdf.xacro" />
<node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" output="screen">
<param name="publish_frequency" type="double" value="50.0" />
<param name="tf_prefix" value="$(arg second_tb3)" />
</node>
<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-urdf -model <span class="math-container">$(arg second_tb3) -x $</span>(arg second_tb3_x_pos) -y <span class="math-container">$(arg second_tb3_y_pos) -z $</span>(arg second_tb3_z_pos) -Y $(arg second_tb3_yaw) -param robot_description" />
</group>
<group ns = "<span class="math-container">$(arg third_tb3)">
<param name="robot_description" command="$</span>(find xacro)/xacro <span class="math-container">$(find turtlebot3_description)/urdf/turtlebot3_$</span>(arg model).urdf.xacro" />
<node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" output="screen">
<param name="publish_frequency" type="double" value="50.0" />
<param name="tf_prefix" value="$(arg third_tb3)" />
</node>
<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-urdf -model <span class="math-container">$(arg third_tb3) -x $</span>(arg third_tb3_x_pos) -y <span class="math-container">$(arg third_tb3_y_pos) -z $</span>(arg third_tb3_z_pos) -Y $(arg third_tb3_yaw) -param robot_description" />
</group>
</launch>
</code></pre>
<p><code>roslaunch turtlebot3_slam multi_gmapping.launch</code></p>
<p>uses <code>multi_gmapping.launch</code>:</p>
<pre><code> <launch>
<arg name="open_rviz" default="true"/>
<param name="/use_sim_time" value="true"/>
<!-- Launch the gmapping node for Turtlebot 3 with custom namespace -->
<!-- <group ns="tb3_0"> -->
<include file="$(find turtlebot3_gazebo)/launch/multi_turtlebot3_slam.launch">
<arg name="ns" value="tb3_0"/>
</include>
<!-- </group> -->
<!-- <group ns="tb3_1"> -->
<include file="$(find turtlebot3_gazebo)/launch/multi_turtlebot3_slam.launch">
<arg name="ns" value="tb3_1"/>
</include>
<!-- </group> -->
<!-- <group ns="tb3_2"> -->
<include file="$(find turtlebot3_gazebo)/launch/multi_turtlebot3_slam.launch">
<arg name="ns" value="tb3_2"/>
</include>
<!-- </group> -->
<include file="$(find turtlebot3_gazebo)/launch/multi_map_merge.launch"></include>
<group if="<span class="math-container">$(arg open_rviz)">
<node pkg="rviz" type="rviz" name="rviz" required="true"
args="-d $</span>(find turtlebot3_gazebo)/rviz/multi_turtlebot3_slam_MB.rviz"/>
</group>
</launch>
</code></pre>
<p><code>multi_turtlebot3_slam.launch</code>:</p>
<pre><code><launch>
<arg name="ns" default="tb3_0"/>
<!-- Gmapping -->
<node pkg="gmapping" type="slam_gmapping" name="turtlebot3_slam_gmapping" output="screen" ns="<span class="math-container">$(arg ns)">
<param name="base_frame" value="$</span>(arg ns)/base_footprint"/>
<param name="odom_frame" value="<span class="math-container">$(arg ns)/odom"/>
<param name="map_frame" value="$</span>(arg ns)/map"/>
<param name="map_update_interval" value="2.0"/>
<param name="maxUrange" value="4.0"/>
<param name="minimumScore" value="100"/>
<param name="linearUpdate" value="0.2"/>
<param name="angularUpdate" value="0.2"/>
<param name="temporalUpdate" value="0.5"/>
<param name="delta" value="0.05"/>
<param name="lskip" value="0"/>
<param name="particles" value="120"/>
<param name="sigma" value="0.05"/>
<param name="kernelSize" value="1"/>
<param name="lstep" value="0.05"/>
<param name="astep" value="0.05"/>
<param name="iterations" value="5"/>
<param name="lsigma" value="0.075"/>
<param name="ogain" value="3.0"/>
<param name="srr" value="0.01"/>
<param name="srt" value="0.02"/>
<param name="str" value="0.01"/>
<param name="stt" value="0.02"/>
<param name="resampleThreshold" value="0.5"/>
<param name="xmin" value="-10.0"/>
<param name="ymin" value="-10.0"/>
<param name="xmax" value="10.0"/>
<param name="ymax" value="10.0"/>
<param name="llsamplerange" value="0.01"/>
<param name="llsamplestep" value="0.01"/>
<param name="lasamplerange" value="0.005"/>
<param name="lasamplestep" value="0.005"/>
</node>
</launch>
</code></pre>
<p><code>roslaunch turtlebot3_navigation multi_move_base.launch</code></p>
<p>uses <code>multi_move_base.launch</code>:</p>
<pre><code><launch>
<param name="/use_sim_time" value="true"/>
<!-- Launch the move_base node for Turtlebot 3 with custom namespace -->
<group ns="tb3_0">
<!-- <param name="tf_prefix" value="tb3_0" /> -->
<include file="$(find turtlebot3_navigation)/launch/move_base.launch">
<arg name="cmd_vel_topic" value="tb3_0/cmd_vel" />
<arg name="odom_topic" value="tb3_0/odom" />
<arg name="move_forward_only" value="false"/>
</include>
</group>
<group ns="tb3_1">
<!-- <param name="tf_prefix" value="tb3_1" /> -->
<include file="$(find turtlebot3_navigation)/launch/move_base.launch">
<arg name="cmd_vel_topic" value="tb3_1/cmd_vel" />
<arg name="odom_topic" value="tb3_1/odom" />
<arg name="move_forward_only" value="false"/>
</include>
</group>
<group ns="tb3_2">
<!-- <param name="tf_prefix" value="tb3_2" /> -->
<include file="$(find turtlebot3_navigation)/launch/move_base.launch">
<arg name="cmd_vel_topic" value="tb3_2/cmd_vel" />
<arg name="odom_topic" value="tb3_2/odom" />
<arg name="move_forward_only" value="false"/>
</include>
</group>
</launch>
</code></pre>
<p>and finally, my <code>move_base.launch</code>:</p>
<pre><code><launch>
<!-- Arguments -->
<arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle, waffle_pi]"/>
<arg name="cmd_vel_topic" default="/cmd_vel" />
<arg name="odom_topic" default="odom" />
<arg name="move_forward_only" default="false"/>
<!-- move_base -->
<node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
<param name="base_local_planner" value="dwa_local_planner/DWAPlannerROS" />
<rosparam file="<span class="math-container">$(find turtlebot3_navigation)/param/costmap_common_params_$</span>(arg model).yaml" command="load" ns="global_costmap" />
<rosparam file="<span class="math-container">$(find turtlebot3_navigation)/param/costmap_common_params_$</span>(arg model).yaml" command="load" ns="local_costmap" />
<rosparam file="<span class="math-container">$(find turtlebot3_navigation)/param/local_costmap_params.yaml" command="load" />
<rosparam file="$</span>(find turtlebot3_navigation)/param/global_costmap_params.yaml" command="load" />
<rosparam file="<span class="math-container">$(find turtlebot3_navigation)/param/move_base_params.yaml" command="load" />
<rosparam file="$</span>(find turtlebot3_navigation)/param/dwa_local_planner_params_<span class="math-container">$(arg model).yaml" command="load" />
<remap from="cmd_vel" to="$</span>(arg cmd_vel_topic)"/>
<remap from="odom" to="<span class="math-container">$(arg odom_topic)"/>
<remap from="map" to="/map" />
<remap from="base_footprint" to="/base_footprint" />
<param name="DWAPlannerROS/min_vel_x" value="0.0" if="$</span>(arg move_forward_only)" />
</node>
</launch>
</code></pre>
<hr />
<p><a href="https://answers.ros.org/question/412698/move_base-with-multiple-robots-running-gmapping-slam-on-turtlebot3/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/110678/hunterlineage1/" rel="nofollow noreferrer">hunterlineage1</a> on ROS Answers with karma: 24 on 2023-02-21</p>
<p>Post score: 0</p>
|
move_base with multiple robots running gmapping SLAM on turtlebot3
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hi @vultran1410</p>
<blockquote>
<p>.1. Does the callback-group-level executor concept apply in micro-ROS? I see that it has been merged into ROS2 rclcpp,
but since micro-ROS doesn't support rclcpp, I'm a bit confused.
No, the callback group-level Executor is only available in rclcpp, aka ROS 2. However, you don't need callback groups in micro-ROS (rclc): In ROS 2, you can only add nodes to an Executor, if you add multiple communication objects, like subscriptions, to a node, all subscriptions are added to the Executor. If you want to use different priorities for executing the callbacks WITHIN a node, this was not possible in ROS 2. Therefore, you can create a callback group and assign subscriptions to it. And then add a callback group to an Executor.</p>
</blockquote>
<p>In micro-ROS, there is no hierarchical structure of subscriptions, nodes, executor ... like in ROS 2:</p>
<pre><code>subscription0 --> node0 --> executor0
subscription1 --> node1
subscription2 --> node1
subscription1 --> callback_group1
subscription2 --> callback_group2
callback_group1 --> executor1
callback_group2 --> executor2
</code></pre>
<p>but it is flat, that is you can direclty add subscriptions to an Executor:</p>
<pre><code>subscription0 --> node0
subscription1 --> node1
subscription2 --> node1
subscription0 --> executor0
subscription1 --> executor1
subscription2 --> executor2
</code></pre>
<p>That is, you add directly subscriptions to executor. You don't need a callback-group in micro-ROS.
Of course, I agree it would make sense to have the same API in ROS 2 as well as in micro-ROS. I could think of a thin-API that would mimick a callback group, just to have the same API as in ROS 2, but essentially it would also just add all subscriptions of the callback group to the Executor.
(I will update the documentation in micro-ROS accordingly).</p>
<p>What would you prefer? Is it okay for you, if you could add subscriptions to an Executor directly?</p>
<blockquote>
<p>.2. In the rclc repo, it mentioned that "The software is not ready for production use. It has neither been developed nor tested for a specific use case.". Does that mean micro-ROS is also not ready for production use? Does rclc executor included in the releases of ROS2 Humble and Rolling version?</p>
</blockquote>
<p>This is rather a liability exclusion. It has been used in several commercial products. All unit tests are running successfully for Foxy, Humble, Rolling. We achieve <a href="https://github.com/ros2/rclc/blob/master/rclc/QUALITY_DECLARATION.md" rel="nofollow noreferrer">ROS 2 Quality Level 2</a> for the rclc library.</p>
<blockquote>
<p>Does rclc executor included in the releases of ROS2 Humble and Rolling version?</p>
</blockquote>
<p>the rclc-package is not part of the default ROS 2 distribution, but you can install the binary package like any other ROS 2 package with e.g. <code>sudo apt-get install ros-humble-rclc</code>. <a href="https://github.com/ros2/rclc/#bloom-release-status-of-code-repository-ros2rclc" rel="nofollow noreferrer">micro-ROS supports ROS 2 distrubutions: Foxy, Humble, Rolling</a></p>
<blockquote>
<p>.3. In the concept page, it mentioned that "Multi-threaded executor with assignment of scheduling policies of underlying operating system." is a future work with an open PR. Later, there was an announcement about micro-ROS multithreading support. Is it the same as the multi-threaded executor mentioned in the concept page? If not, what are the differences?</p>
</blockquote>
<p>No. These are different things. The multi-threaded Executor will support processing subscriptions in different threads (with different real-time priorities) via rclc-API.</p>
<p>I am currently working on a branch to re-structure the rclc-Executor, so that it can support single-threaded, multi-threaded (POSIX), and non-POSIX (AUTOSAR) operating systems. working branch: <a href="https://github.com/micro-ROS/rclc/tree/feature/restructured-exectutor" rel="nofollow noreferrer">restructured-rclc-executor</a>.</p>
<p>"micro-ROS multithreading support" revers to the fact, that the micro-ROS client (with its XRCE-DDS middleware) is thread-safe. That means, you can create multiple threads, in these threads create multiple micro-ROS clients (with e.g. subscription, executors, etc.). The multi-threading support is on the level of the middleware. On API level, you have only a "single-threaded" Executor. But you could create multiple "single-threaded Executors" in different threads.</p>
<blockquote>
<p>Can you use C++ user code on top of the rclc? (for both case of using rclc with ROS2 and rclc with Micro-ROS)</p>
</blockquote>
<p>Yes, you can always call a C function from C++ code. There are limitations regarding full C++ semantics for e.g. callback functions. But you can use a static C++ member class method as a callback function. See <a href="https://github.com/ros2/rclc/tree/master/rclc_examples#subscription-callback-with-c-class-method" rel="nofollow noreferrer">this example</a>. Additionally, you can <a href="https://github.com/ros2/rclc/blob/3b4ff9e46ad63ca08a1131760a86b0f42c2bba63/rclc/include/rclc/executor.h#L276" rel="nofollow noreferrer">add a context pointer to a subscription</a>. Then its callback function is called with the new message and has this pointer as a parameter.</p>
<p>See also the open <a href="https://github.com/ros2/rclc/issues/126" rel="nofollow noreferrer">issue#126</a> about a discussion to provide a C++ API for rclc.</p>
<p>You can use rclc from ROS 2 (using any DDS middleware) or as a micro-ROS client on a micro-controller (using XRCE-DDS middleware). the rclc-package depends only on the rcl layer and does not require anything specific from the underlying middleware.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/100928/janstaschulat/" rel="nofollow noreferrer">JanStaschulat</a> with karma: 81 on 2023-02-22</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/140040/vutran1410/" rel="nofollow noreferrer">vutran1410</a> on 2023-02-22</strong>:<br />
Thank you for your detailed answers!</p>
<p>"In micro-ROS, there is no hierarchical structure of subscriptions, nodes, executor ... like in ROS 2" --> Does that mean if I'm using rclc for ROS2, it will also have no hierarchical structure and I can add subscriptions directly to the executors?</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/100928/janstaschulat/" rel="nofollow noreferrer">JanStaschulat</a> on 2023-02-22</strong>:<br />
Yes. You can use rclc-package as an API for a normal ROS 2 application (using C programming language or some restricted C++ language). You can add subscriptions to the rclc-Executor directly (if you are using the rclc-package).</p>
|
103048
|
2023-02-21T06:16:21.000
|
|ros2|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hi all,</p>
<p>I have recently read into micro-ROS, ROS2 and learnt about its executor. I have a few questions about the current state of the executor in Micro-ROS and ROS2.</p>
<ol>
<li>Does the <a href="https://micro.ros.org/docs/concepts/client_library/execution_management/#callback-group-level-executor" rel="nofollow noreferrer">callback-group-level executor</a> concept apply in micro-ROS? I see that it has been merged into ROS2 rclcpp, but since micro-ROS doesn't support rclcpp, I'm a bit confused.</li>
<li>In the <a href="https://github.com/ros2/rclc" rel="nofollow noreferrer">rclc repo</a>, it mentioned that "The software is not ready for production use. It has neither been developed nor tested for a specific use case.". Does that mean micro-ROS is also not ready for production use? Does rclc executor included in the releases of ROS2 Humble and Rolling version?</li>
<li>In the <a href="https://micro.ros.org/docs/concepts/client_library/execution_management/#future-work" rel="nofollow noreferrer">concept page</a>, it mentioned that "Multi-threaded executor with assignment of scheduling policies of underlying operating system." is a future work with an open PR. Later, there was an <a href="https://micro.ros.org/blog/2021/07/07/multithreading/" rel="nofollow noreferrer">announcement</a> about micro-ROS multithreading support. Is it the same as the multi-threaded executor mentioned in the concept page? If not, what are the differences?</li>
<li>Can you use C++ user code on top of the rclc? (for both case of using rclc with ROS2 and rclc with Micro-ROS)</li>
</ol>
<p>Thank you</p>
<hr />
<p><a href="https://answers.ros.org/question/412704/executor-in-mirco-ros-and-ros2/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/140040/vutran1410/" rel="nofollow noreferrer">vutran1410</a> on ROS Answers with karma: 3 on 2023-02-21</p>
<p>Post score: 0</p>
|
Executor in Mirco-ROS and ROS2
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>the <code>gazebo_ros2_control</code> position control interface implementation sets joint positions directly. There's no underlying controller - no PID, no bang-bang. You give it a position, and it automagically sets the simulated joint to that position (<a href="https://github.com/ros-controls/gazebo_ros2_control/blob/humble/gazebo_ros2_control/src/gazebo_system.cpp#L597" rel="nofollow noreferrer">relevant code here</a>). This will disregard physics, joint limits whatever.</p>
<p>There are at least two approaches if you want a more reasonable "control response". You could either:</p>
<p>a) generate joint trajectories that follow a smooth path and look good, and continue to use the position interface. If you look carefully, the joint would still be "snapping" to each of the intermediate positions, but it would effectively animate the desired motion. You have the added benefit here that things should do exactly what you tell them to do; no controller tuning required, no overshoot, etc. This is probably the intended purpose of the <code>position</code> interface in gazebo - for kinematic simulation. There are a number of tools that can do trajectory generation for you (e.g. moveit, ruckig), or you can write your own for your own needs.</p>
<p>b) if you care about dynamics, you'll want to use the <code>velocity</code> or ideally <code>effort</code> command interface, and have a controller that is tuned to get the the response you're expecting. Like the <code>position</code> interface, the <code>velocity</code> and <code>effort</code> control interfaces are "naive" in that they don't care about higher order limits. The velocity interface doesn't care about acceleration/effort limits, and the effort interface won't care about jerk limits. I don't even think they respect their own limits (e.g. I don't believe anything stops you from setting a higher velocity than the specified joint velocity limit). Anyways, depending on the complexity of your simulated hardware this could be simple or quite involved. For instance, the Gazebo physics engine struggles a bit with serial chain manipulators and creating a <em>stable</em> controller for that might involve a fair bit of tuning gains and the physics settings. If you go this route, the <code>ros2_controllers</code> package has some controller templates that you might find useful for this (e.g. the <code>admittance controller</code> or the <a href="https://github.com/ros-controls/ros2_controllers/blob/humble/joint_trajectory_controller/src/joint_trajectory_controller.cpp" rel="nofollow noreferrer"><code>joint_trajectory_controller</code> which supports PID parameters to output velocity/effort</a>)</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/69938/shonigmann/" rel="nofollow noreferrer">shonigmann</a> with karma: 1567 on 2023-02-23</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 2</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/140056/adude/" rel="nofollow noreferrer">Adude</a> on 2023-02-23</strong>:<br />
Perfect, thanks</p>
|
103050
|
2023-02-21T11:45:40.000
|
|gazebo|ros2|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I have a revolute joint being controlled by a custom ros2 controller which is setting the joints position. When the position is set by the controller I would expect Gazebo to handle moving the joint to that position, obeying the velocity parameter in the <code>limit</code> tag of the joint URDF. If that were the case, then the joint would slowly move to the correct position, instead it instantaneously snaps to the desired position and none of the parameters (friction, damping, effort...) seem to make any difference to this.</p>
<p>Is this how it's supposed to work? Surely the controller just issues a command and the hardware interface is responsible for moving to that position? Or have I misunderstood entirely?</p>
<p>This is the joint</p>
<pre><code><joint name="lower_leg_joint" type="revolute">
<parent link="upper_leg"/>
<child link="lower_leg"/>
<origin xyz="0 0 0" rpy="0 0 0" />
<axis xyz="0 0 1"/>
<limit effort="1000.0" lower="<span class="math-container">${-pi/3}" upper="$</span>{pi/3}" velocity="0.1"/>
</joint>
</code></pre>
<p>and this is the ros2_control URDF</p>
<pre><code><ros2_control name="GazeboSystem" type="system">
<hardware>
<plugin>gazebo_ros2_control/GazeboSystem</plugin>
</hardware>
<joint name="lower_leg_joint">
<command_interface name="position"/>
<state_interface name="velocity"/>
<state_interface name="position"/>
</joint>
</ros2_control>
<gazebo>
<plugin name="gazebo_ros2_control" filename="libgazebo_ros2_control.so">
<parameters>./config/controllers.yaml</parameters>
</plugin>
</gazebo>
</code></pre>
<hr />
<p><a href="https://answers.ros.org/question/412712/revolute-joint-disobeying-limits-in-gazebo/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/140056/adude/" rel="nofollow noreferrer">Adude</a> on ROS Answers with karma: 53 on 2023-02-21</p>
<p>Post score: 0</p>
|
Revolute joint disobeying limits in Gazebo
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>It turns out that the callbacks that were not getting triggered are the ones expecting Lidar PointClouds which are too big for valgrind to load since it has a limited memory block for programs running on it. See their official <a href="https://valgrind.org/docs/manual/manual-core.html#manual-core.limits:%7E:text=On%20Linux%2C%20Valgrind%20determines,limit%20and%20recompile%20Valgrind." rel="nofollow noreferrer">documentation.</a> The callbacks getting triggered where the ones expecting a radar point cloud which is much more lightweight.</p>
<p>The only solution is to</p>
<blockquote>
<p>"change the 8 MB hardcoded limit and recompile Valgrind."</p>
</blockquote>
<p>If I had added the <code>-v</code> flag (verbose) to the prefix like so <code> prefix=['valgrind --tool=callgrind -v'],</code> in the launch file, I would have seen the error</p>
<pre><code>[profiling_node-1] ==56144== brk segment overflow in thread #1: can't grow to 0x48cd000
[profiling_node-1] ==56144== (see section Limitations in user manual)
</code></pre>
<p>Which would have saved me a lot of time to find the source of the problem.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/89124/samrodriguez/" rel="nofollow noreferrer">SamRodriguez</a> with karma: 61 on 2023-02-23</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 2</p>
|
103052
|
2023-02-22T05:28:12.000
|
|ros2|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I want to profile multiple nodes in my system, I've already profiled a few nodes successfully by adding the valgrind prefix like so:</p>
<pre><code>def generate_launch_description():
return LaunchDescription([
Node(
package="fov_filtering",
namespace='',
executable="fov_filtering_app",
name="fov_filtering_node",
output="screen",
prefix=['valgrind --tool=callgrind'],
</code></pre>
<p>The steps I follow are the following:</p>
<ol>
<li>Build relevant packages with Debug
flag</li>
<li>Run relevant rosbag with the
data that the callback subscribes to</li>
<li>Run the launch file with the
valgrind prefix</li>
<li>Stop nodes and
visualize the callgrind file in
kcachegrind</li>
</ol>
<p>I am printing out a message to the console everytime the callbacks get triggered as a sanity check. For some mysterious reason the callback of some nodes is not triggered. I am sure that all the parameters and topic names are correct because I am copy-pasting the regular launch file into a new one with the prefix "profiling_" which only differs in the prefix added.</p>
<p>For reference, this is the signature and binding of a callback which <em>is</em> getting triggered:</p>
<pre><code>subscriber_ = this->create_subscription<sensor_msgs::msg::PointCloud2>("/radar/input/cloud", 10,
std::bind(&RadarTrackingNode::callback, this, std::placeholders::_1));
...
void RadarTrackingNode::callback(const sensor_msgs::msg::PointCloud2::SharedPtr cloud)
</code></pre>
<p>And this is the signature and binding of a callback which <em>is not</em> getting triggered:</p>
<pre><code>subscription_ = this->create_subscription<sensor_msgs::msg::PointCloud2>(pointcloud_topic, 20, std::bind(&Main::_callback, this, std::placeholders::_1));
...
void Main::_callback(const sensor_msgs::msg::PointCloud2::SharedPtr sensor_point_cloud);
</code></pre>
<p>To be clear I can see the <code>callgrind</code> file, the problem is that since the callback is never triggered I don't see it in the call graph.
Any ideas of what can be the source of the problem or what can I try to solve it?</p>
<hr />
<p><a href="https://answers.ros.org/question/412735/callback-not-getting-triggered-when-running-with-valgrind/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/89124/samrodriguez/" rel="nofollow noreferrer">SamRodriguez</a> on ROS Answers with karma: 61 on 2023-02-22</p>
<p>Post score: 0</p>
|
Callback not getting triggered when running with valgrind
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hello there,</p>
<p>Thanks @gurselturkeri, for updating the launch file in the question, but I am sharing the details answer over here,</p>
<blockquote>
<p>As @gurselturkeri suggested to installed joint_trajectory_controller, joint_state_broadcaster, controller_manager, joint-state-publisher-gui library.</p>
</blockquote>
<p>I think you also need this below library to access gazebo controls. <code>sudo apt-get install ros-humble-gazebo-ros2-control</code></p>
<blockquote>
<p>About the Launch file, If you are using Ros2 Humble you need to correct</p>
</blockquote>
<p>Check Which command is working in your case After installing controller-manager hit this commands in terminal <code>ros2 run controller_manager spawner.py -h</code> or <code>ros2 run controller_manager spawner -h</code> - This command is working in my case if it is so then change spawner.py to spawner in <code>executable</code> node.</p>
<pre><code>Node(
package="controller_manager",
executable="spawner",
arguments=["joint_state_broadcaster", "--controller-manager", "/controller_manager"],
),
Node(
package="controller_manager",
executable="spawner",
arguments=["joint_trajectory_controller", "-c", "/controller_manager"],
)
</code></pre>
<blockquote>
<p>You can check every thing is working by executing the command into your terminal:</p>
</blockquote>
<pre><code>ros2 topic pub /joint_trajectory_controller/joint_trajectory trajectory_msgs/msg/JointTrajectory "header:
stamp:
sec: 0
nanosec: 0
frame_id: ''
joint_names: ['joint_1','joint_2','joint_4']
points: [ {"positions":[-1.57,-0.59,-1.2]} ]"
</code></pre>
<p>feel free to drop a comment in case it is not working.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/63046/ranjit-kathiriya/" rel="nofollow noreferrer">Ranjit Kathiriya</a> with karma: 1622 on 2023-02-28</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 4</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/99062/gurselturkeri/" rel="nofollow noreferrer">gurselturkeri</a> on 2023-02-28</strong>:<br />
thanks for answer it is also work clearly.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/63046/ranjit-kathiriya/" rel="nofollow noreferrer">Ranjit Kathiriya</a> on 2023-02-28</strong>:<br />
Tick the answer, so it can help others in the community.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/3527/rodbelafarin/" rel="nofollow noreferrer">RodBelaFarin</a> on 2023-03-09</strong>:<br />
Unfortunately exactly this is not working for me in ROS2 Humble.</p>
<p>I am ending in the exact same error as @gurselturkeri</p>
<p>It was working in Foxy, applied the changes mentioned by @ranjit kathiriya and installed all mentioned packages.</p>
<p>But it says controller manager not available.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/63046/ranjit-kathiriya/" rel="nofollow noreferrer">Ranjit Kathiriya</a> on 2023-03-09</strong>:<br />
Can you add your full error?</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/3527/rodbelafarin/" rel="nofollow noreferrer">RodBelaFarin</a> on 2023-03-09</strong>:<br />
[spawner-6] [INFO] [1678360335.484502457] [diff_drive_controller_spawner]: Waiting for '/controller_manager' node to exist
[spawner-5] [INFO] [1678360335.486055845] [joint_state_broadcaster_spawner]: Waiting for '/controller_manager' node to exist
[spawner-6] [ERROR] [1678360337.503889166] [diff_drive_controller_spawner]: Controller manager not available
[spawner-5] [ERROR] [1678360337.506222462] [joint_state_broadcaster_spawner]: Controller manager not available
[ERROR] [spawner-6]: process has died [pid 10538, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner diff_drive_controller --controller-manager /controller_manager --ros-args -r __node:=diff_drive_controller_spawner -r __ns:=/'].
[ERROR] [spawner-5]: process has died [pid 10536, exit code 1, cmd '/opt/ros/humble/lib/controller_manager/spawner joint_state_broadcaster --controller-manager /controller_manager --ros-args -r __node:=joint_state_broadcaster_spawner -r __ns:=/'].</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/63046/ranjit-kathiriya/" rel="nofollow noreferrer">Ranjit Kathiriya</a> on 2023-03-09</strong>:<br />
Is it possible for you to create new questions and upload your code output and the rest of other details?</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/3527/rodbelafarin/" rel="nofollow noreferrer">RodBelaFarin</a> on 2023-03-09</strong>:<br />
You can find the question right here:
<a href="https://answers.ros.org/question/413240/ros2-controller-manager-migration-from-foxy-to-humble-controller-manager-not-available/" rel="nofollow noreferrer">https://answers.ros.org/question/413240/ros2-controller-manager-migration-from-foxy-to-humble-controller-manager-not-available/</a></p>
|
103054
|
2023-02-22T07:43:00.000
|
|ros|gazebo|ros2|urdf|robot|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I can visualize my robot on gazebo but I get an error when launch file is starting like below. How can I fix that?</p>
<p><img src="https://i.ibb.co/vQmgL6m/Screenshot-from-2023-02-23-13-12-59.png" alt="robot_on_gazebo" /></p>
<p><strong>Error:</strong></p>
<pre><code>[spawn_entity.py-2] [INFO] [1677146674.436718834] [spawn_entity]: Calling service /spawn_entity
[spawn_entity.py-2] [INFO] [1677146674.546574796] [spawn_entity]: Spawn status: SpawnEntity: Successfully spawned entity [robotic_arm]
[spawn_entity.py-2] [INFO] [1677146674.546986992] [spawn_entity]: Waiting for shutdown to delete entity [robotic_arm]
[spawner.py-5] [INFO] [1677146675.487867687] [spawner_joint_state_broadcaster]: Waiting for /controller_manager services
[spawner.py-6] [INFO] [1677146675.520714798] [spawner_joint_trajectory_controller]: Waiting for /controller_manager services
[spawner.py-5] [INFO] [1677146677.503342629] [spawner_joint_state_broadcaster]: Waiting for /controller_manager services
[spawner.py-6] [INFO] [1677146677.535238788] [spawner_joint_trajectory_controller]: Waiting for /controller_manager services
[spawner.py-5] [INFO] [1677146679.521864875] [spawner_joint_state_broadcaster]: Waiting for /controller_manager services
[spawner.py-6] [INFO] [1677146679.554316012] [spawner_joint_trajectory_controller]: Waiting for /controller_manager services
[spawner.py-5] [INFO] [1677146681.537992430] [spawner_joint_state_broadcaster]: Waiting for /controller_manager services
[spawner.py-6] [INFO] [1677146681.572181275] [spawner_joint_trajectory_controller]: Waiting for /controller_manager services
[spawner.py-5] [ERROR] [1677146683.557500368] [spawner_joint_state_broadcaster]: Controller manager not available
[spawner.py-6] [ERROR] [1677146683.591099846] [spawner_joint_trajectory_controller]: Controller manager not available
[ERROR] [spawner.py-5]: process has died [pid 18233, exit code 1, cmd '/opt/ros/foxy/lib/controller_manager/spawner.py joint_state_broadcaster --controller-manager /controller_manager --ros-args'].
[ERROR] [spawner.py-6]: process has died [pid 18235, exit code 1, cmd '/opt/ros/foxy/lib/controller_manager/spawner.py joint_trajectory_controller -c /controller_manager --ros-args'].
</code></pre>
<p><strong>SOLVED:</strong> The problem was ROS2 version and changing in launch file. It works with <strong>Ubuntu 22.04 Humble</strong> and you should install all control package such as joint_trajectory_controller, joint_state_broadcaster, controller_manager, joint-state-publisher-gui then edit your launch file.</p>
<p><strong>New Launch File:</strong></p>
<pre><code>from launch import LaunchDescription
from launch.actions import ExecuteProcess, IncludeLaunchDescription, RegisterEventHandler
from launch.event_handlers import OnProcessExit
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import Command, FindExecutable, PathJoinSubstitution
from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare
def generate_launch_description():
robot_description_content = Command(
[
PathJoinSubstitution([FindExecutable(name='xacro')]),
' ',
PathJoinSubstitution(
[FindPackageShare(
'robotic_arm'),
'urdf',
'robotic_arm.urdf']
),
]
)
robot_description = {'robot_description': robot_description_content}
node_robot_state_publisher = Node(
package='robot_state_publisher',
executable='robot_state_publisher',
output='screen',
parameters=[robot_description]
)
gazebo = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
[FindPackageShare('gazebo_ros'), '/launch', '/gazebo.launch.py']
),
)
spawn_entity = Node(package='gazebo_ros', executable='spawn_entity.py',
arguments=['-topic', 'robot_description',
'-entity', 'joints'],
output='screen')
load_joint_state_controller = ExecuteProcess(
cmd=['ros2', 'control', 'load_controller', '--set-state', 'active',
'joint_state_broadcaster'],
output='screen'
)
load_trajectory_controller = ExecuteProcess(
cmd=['ros2', 'control', 'load_controller', '--set-state', 'active',
'joint_trajectory_controller'],
output='screen'
)
return LaunchDescription([
RegisterEventHandler(
event_handler=OnProcessExit(
target_action=spawn_entity,
on_exit=[load_joint_state_controller],
)
),
RegisterEventHandler(
event_handler=OnProcessExit(
target_action=load_joint_state_controller,
on_exit=[load_trajectory_controller],
)
),
gazebo,
node_robot_state_publisher,
spawn_entity,
])
</code></pre>
<hr />
<p><a href="https://answers.ros.org/question/412742/controller-manager-not-available-in-ros2/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/99062/gurselturkeri/" rel="nofollow noreferrer">gurselturkeri</a> on ROS Answers with karma: 25 on 2023-02-22</p>
<p>Post score: 2</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/63046/ranjit-kathiriya/" rel="nofollow noreferrer">Ranjit Kathiriya</a> on 2023-02-22</strong>:<br />
Hello,</p>
<p>You need to install controller manager, you can do so by executing below command in your terminal.</p>
<pre><code>sudo apt-get install ros-<Your-Distro>-controller-manager
</code></pre>
<p><strong>Comment by <a href="https://answers.ros.org/users/99062/gurselturkeri/" rel="nofollow noreferrer">gurselturkeri</a> on 2023-02-22</strong>:<br />
I have already installed this package.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/63046/ranjit-kathiriya/" rel="nofollow noreferrer">Ranjit Kathiriya</a> on 2023-02-22</strong>:<br />
Can you please, try running this command and share the output in the comment?</p>
<blockquote>
<p>gazebo --verbose -s libgazebo_ros_factory.so</p>
</blockquote>
<p><strong>Comment by <a href="https://answers.ros.org/users/99062/gurselturkeri/" rel="nofollow noreferrer">gurselturkeri</a> on 2023-02-22</strong>:<br />
Gazebo multi-robot simulator, version 11.11.0
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
<a href="http://gazebosim.org" rel="nofollow noreferrer">http://gazebosim.org</a></p>
<pre><code>[Msg] Waiting for master.
Gazebo multi-robot simulator, version 11.11.0
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org
[Msg] Waiting for master.
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 192.168.1.224
[Msg] Loading world file [/usr/share/gazebo-11/worlds/empty.world]
[INFO] [1677072233.288940555] [gazebo_ros_node]: ROS was initialized without arguments.
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 192.168.1.224
</code></pre>
<p><strong>Comment by <a href="https://answers.ros.org/users/99062/gurselturkeri/" rel="nofollow noreferrer">gurselturkeri</a> on 2023-02-22</strong>:<br />
[Err] [InsertModelWidget.cc:403] Missing model.config for model "/home/gursel/autoware/install/velodyne_description/share/ament_index"
[Err] [InsertModelWidget.cc:403] Missing model.config for model "/home/gursel/autoware/install/velodyne_description/share/colcon-core"
[Err] [InsertModelWidget.cc:403] Missing model.config for model "/home/gursel/autoware/install/velodyne_description/share/velodyne_description"
[Wrn] [Event.cc:61] Warning: Deleting a connection right after creation. Make sure to save the ConnectionPtr from a Connect call
[Wrn] [Publisher.cc:135] Queue limit reached for topic /gazebo/default/user_camera/pose, deleting message. This warning is printed only once.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/63046/ranjit-kathiriya/" rel="nofollow noreferrer">Ranjit Kathiriya</a> on 2023-02-22</strong>:<br />
try to install</p>
<blockquote>
<p>sudo apt-get install ros--gazebo-ros</p>
</blockquote>
<p><strong>Comment by <a href="https://answers.ros.org/users/99062/gurselturkeri/" rel="nofollow noreferrer">gurselturkeri</a> on 2023-02-22</strong>:<br />
already installed.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/63046/ranjit-kathiriya/" rel="nofollow noreferrer">Ranjit Kathiriya</a> on 2023-02-23</strong>:<br />
That missing model config has no effect on the simulation. Its just saying that some models on the .gazebo folder dont ave that config file ( sometimes because they are packages instead of modl folders ).</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/63046/ranjit-kathiriya/" rel="nofollow noreferrer">Ranjit Kathiriya</a> on 2023-02-23</strong>:<br />
please, share urdf and yaml file. and provide as much detail you can so to give proper answer.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/63046/ranjit-kathiriya/" rel="nofollow noreferrer">Ranjit Kathiriya</a> on 2023-02-24</strong>:\</p>
<blockquote>
<p>gazebo --verbose -s libgazebo_ros_factory.so</p>
</blockquote>
<p>are you able to open the gazebo?</p>
<pre><code>sudo apt-get install ros-foxy-robot-state-publisher
</code></pre>
<p>did you install robot state publisher?</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/54529/nihalar/" rel="nofollow noreferrer">nihalar</a> on 2023-02-28</strong>:<br />
I have this same error, any fix?</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/99062/gurselturkeri/" rel="nofollow noreferrer">gurselturkeri</a> on 2023-02-28</strong>:<br />
<strong>SOLVED:</strong> The problem was ROS2 version and changing in launch file. It works with <strong>Ubuntu 22.04 Humble</strong> and you should install all control package such as joint_trajectory_controller, joint_state_broadcaster, controller_manager, joint-state-publisher-gui then edit your launch file.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/54529/nihalar/" rel="nofollow noreferrer">nihalar</a> on 2023-02-28</strong>:<br />
Changing what in launch file?</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/99062/gurselturkeri/" rel="nofollow noreferrer">gurselturkeri</a> on 2023-02-28</strong>:<br />
I have updated in question.</p>
|
Controller manager not available in ROS2
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>You need to install the required targets. For more about this see this link: <a href="https://docs.ros.org/en/foxy/Tutorials/Beginner-Client-Libraries/Writing-A-Simple-Cpp-Publisher-And-Subscriber.html#cmakelists-txt" rel="nofollow noreferrer">https://docs.ros.org/en/foxy/Tutorials/Beginner-Client-Libraries/Writing-A-Simple-Cpp-Publisher-And-Subscriber.html#cmakelists-txt</a></p>
<pre><code>add_executable(helloWorld src/helloWorld.cpp)
ament_target_dependencies(helloWorld)
install(TARGETS
helloWorld
DESTINATION lib/${PROJECT_NAME})
</code></pre>
<p>should do the trick for your simple example</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/44912/georgno/" rel="nofollow noreferrer">GeorgNo</a> with karma: 183 on 2023-03-23</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
|
103056
|
2023-02-22T10:38:29.000
|
|ros|ros2|ament|cmake|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I am trying to get started with ROS2 Humble and when running colcon build no executable files are created.</p>
<p>My project structure looks like this:</p>
<pre><code>examples
├── CMakeLists.txt
├── package.xml
└── src
├── CMakeLists.txt
└── helloWorld.cpp
</code></pre>
<p>File contents:</p>
<p>examples/CMakeLists.txt:</p>
<pre><code>cmake_minimum_required(VERSION 3.25)
project(examples LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
find_package(ament_cmake REQUIRED)
add_subdirectory(src)
ament_package()
</code></pre>
<p>examples/src/CMakeLists.txt:</p>
<pre><code>add_executable(helloWorld helloWorld.cpp)
</code></pre>
<p>examples/helloWorld.cpp</p>
<pre><code>#include <iostream>
using std::cout;
using std::endl;
int main()
{
cout << "Hello World" << endl;
}
</code></pre>
<p>Running <code>colcon build</code> in my workspace root succeeds but no executable <code>helloWorld</code> is generated. However, when I edit examples/CMakeLists.txt like this, it DOES work:</p>
<pre><code>cmake_minimum_required(VERSION 3.25)
project(examples LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
find_package(ament_cmake REQUIRED)
#add_subdirectory(src)
add_executable(helloWorld "src/helloWorld.cpp") #add executable directly instead
ament_package()
</code></pre>
<p>This successfully generates the executable and works with <code>ros2 run</code>.</p>
<p>It looks like <code>add_subdirectory</code> doesn't work correctly... probably has to do something with ament... does anyone know how to do this correctly? I usually strcuture my CMake projects with <code>add_subdirectory</code> and want this to work with ROS as well.</p>
<hr />
<p><a href="https://answers.ros.org/question/412757/colcon-build-doesn%27t-generate-executables/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/140230/user334478/" rel="nofollow noreferrer">user334478</a> on ROS Answers with karma: 3 on 2023-02-22</p>
<p>Post score: 0</p>
|
colcon build doesn't generate executables
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I solved myself, still I'm not sure how. The thing I did was to close the terminal dedicated to the bridge and re-do all the <code>source</code> (Linux), on Windows I did nothing.
Other things I did previously was:</p>
<ul>
<li>to remove the firewall with <code>sudo ufw disable</code>, because I wasn't able to see ros2 topics</li>
<li>add <code>export ROS_MASTER_URI=http://localhost:11311</code> and <code>export ROS_IP=127.0.0.1</code> in <strong>.bashrc</strong>. (Maybe this changes were crucial, and I didn't reopen the terminal after them)</li>
</ul>
<p>Now everything works, tested also with a <code>PoseStamped</code> publisher/subscriber.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/93353/alberto/" rel="nofollow noreferrer">alberto</a> with karma: 100 on 2023-02-23</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/103873/davies-ogunsina/" rel="nofollow noreferrer">Davies Ogunsina</a> on 2023-02-24</strong>:<br />
Great,happy it was solved.</p>
|
103058
|
2023-02-22T12:42:26.000
|
|ros|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hi all,
I'm using ROS2 Foxy on Windows in one PC, and ROS1 Noetic on Linux in another machine. I want them to communicate.
I've compiled ros1_bridge following its <a href="https://github.com/ros2/ros1_bridge" rel="nofollow noreferrer">readme</a>, knowing that for the Foxy pkg I need to <a href="https://github.com/ros2/ros1_bridge/issues/385" rel="nofollow noreferrer">checkout</a> the correct branch.</p>
<ul>
<li>I managed to build ros1_bridge correctly.</li>
<li>The two machine are communicating in ROS2, which means I can see the topics and do the echo.</li>
<li>The machine on Windows (ROS2 ) is publishing, the other (ROS1 and ROS2) is subscribed, I want to read the topic in ROS1. (I'm literaly doing the <a href="https://github.com/ros2/ros1_bridge" rel="nofollow noreferrer">example 1b</a>)</li>
</ul>
<p>Now, the bridge starts but <strong>I get:</strong></p>
<pre><code>created 2to1 bridge for topic '/chatter' with ROS 2 type 'std_msgs/msg/String' and ROS 1 type ''
</code></pre>
<p>While I am expecting:</p>
<pre><code>created 2to1 bridge for topic '/chatter' with ROS 2 type 'std_msgs/msg/String' and ROS 1 type 'std_msgs/String'
</code></pre>
<p><strong>EDIT</strong>: I noticed that adding --bridge-all-topics, I get the correct type for ROS1, but still the listener node doesn't print anything.
After some minutes it says: <code>Failed to connect to xxx.yyy.local:49195</code></p>
<p>I did source ROS1 and ROS2 before the build, and if I do <code>rostopic type /chatter</code> I get <code>std_msgs/String</code>.</p>
<p>What am I doing wrong?</p>
<hr />
<p><a href="https://answers.ros.org/question/412760/ros1_bridge-doesn%27t-find-ros1-std_msgs/string-type-for-chatter-example/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/93353/alberto/" rel="nofollow noreferrer">alberto</a> on ROS Answers with karma: 100 on 2023-02-22</p>
<p>Post score: 0</p>
|
ros1_bridge doesn't find ROS1 std_msgs/String type for chatter example
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>are you sure your <code>humble</code> runs on <code>20.04</code>? but official suggests:</p>
<p><a href="https://docs.ros.org/en/humble/Installation/Alternatives/Ubuntu-Install-Binary.html#system-requirements" rel="nofollow noreferrer">https://docs.ros.org/en/humble/Installation/Alternatives/Ubuntu-Install-Binary.html#system-requirements</a></p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/108548/fury.nerd/" rel="nofollow noreferrer">fury.nerd</a> with karma: 78 on 2023-03-02</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
|
103060
|
2023-02-23T05:36:51.000
|
|ros2|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>i was following this <a href="https://docs.ros.org/en/foxy/Tutorials/Beginner-Client-Libraries/Creating-A-Workspace/Creating-A-Workspace.html" rel="nofollow noreferrer">official tutorial</a> with my raspberry pi 4. i was executing</p>
<pre><code>colcon build
</code></pre>
<p>but every time i execute that, i get:</p>
<pre><code> [1.935s] WARNING:colcon.colcon_core.package_selection:Some selected packages are already built in one or more underlay workspaces:
'turtlesim' is in: /opt/ros/humble
If a package in a merged underlay workspace is overridden and it installs headers, then all packages in the overlay must sort their include directories by workspace order. Failure to do so may result in build failures or undefined behavior at run time.
If the overridden package is used by another package in any underlay, then the overriding package in the overlay must be API and ABI compatible or undefined behavior at run time may occur.
If you understand the risks and want to override a package anyways, add the following to the command line:
--allow-overriding turtlesim
This may be promoted to an error in a future release of colcon-override-check.
Starting >>> turtlesim
[Processing: turtlesim]
[Processing: turtlesim]
[Processing: turtlesim]
[Processing: turtlesim]
--- stderr: turtlesim
CMake Deprecation Warning at /opt/ros/humble/share/rosidl_cmake/cmake/rosidl_target_interfaces.cmake:32 (message):
Use rosidl_get_typesupport_target() and target_link_libraries() instead of
rosidl_target_interfaces()
Call Stack (most recent call first):
CMakeLists.txt:51 (rosidl_target_interfaces)
CMake Deprecation Warning at /opt/ros/humble/share/rosidl_cmake/cmake/rosidl_target_interfaces.cmake:32 (message):
Use rosidl_get_typesupport_target() and target_link_libraries() instead of
rosidl_target_interfaces()
Call Stack (most recent call first):
CMakeLists.txt:55 (rosidl_target_interfaces)
CMake Deprecation Warning at /opt/ros/humble/share/rosidl_cmake/cmake/rosidl_target_interfaces.cmake:32 (message):
Use rosidl_get_typesupport_target() and target_link_libraries() instead of
rosidl_target_interfaces()
Call Stack (most recent call first):
CMakeLists.txt:58 (rosidl_target_interfaces)
CMake Deprecation Warning at /opt/ros/humble/share/rosidl_cmake/cmake/rosidl_target_interfaces.cmake:32 (message):
Use rosidl_get_typesupport_target() and target_link_libraries() instead of
rosidl_target_interfaces()
Call Stack (most recent call first):
CMakeLists.txt:61 (rosidl_target_interfaces)
/home/pi/ros2_ws/src/ros_tutorials/turtlesim/tutorials/teleop_turtle_key.cpp: In member function ‘void TeleopTurtle::sendGoal(float)’:
/home/pi/ros2_ws/src/ros_tutorials/turtlesim/tutorials/teleop_turtle_key.cpp:200:5: error: no match for ‘operator=’ (operand types are ‘rclcpp_action::Client<turtlesim::action::RotateAbsolute>::GoalResponseCallback’ {aka ‘std::function<void(std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> >)>’} and ‘TeleopTurtle::sendGoal(float)::<lambda(std::shared_future<std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> > >)>’)
200 | };
| ^
In file included from /usr/include/c++/11/future:47,
from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:18,
from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
from /home/pi/ros2_ws/src/ros_tutorials/turtlesim/tutorials/teleop_turtle_key.cpp:1:
/usr/include/c++/11/bits/std_function.h:530:9: note: candidate: ‘template<class _Functor> std::function<_Res(_ArgTypes ...)>::_Requires<std::function<_Res(_ArgTypes ...)>::_Callable<_Functor>, std::function<_Res(_ArgTypes ...)>&> std::function<_Res(_ArgTypes ...)>::operator=(_Functor&&) [with _Functor = _Functor; _Res = void; _ArgTypes = {std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> >}]’
530 | operator=(_Functor&& __f)
| ^~~~~~~~
/usr/include/c++/11/bits/std_function.h:530:9: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/11/bits/move.h:57,
from /usr/include/c++/11/bits/stl_pair.h:59,
from /usr/include/c++/11/bits/stl_algobase.h:64,
from /usr/include/c++/11/memory:63,
from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:153,
from /home/pi/ros2_ws/src/ros_tutorials/turtlesim/tutorials/teleop_turtle_key.cpp:1:
/usr/include/c++/11/type_traits: In substitution of ‘template<bool _Cond, class _Tp> using __enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = std::function<void(std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> >)>&]’:
/usr/include/c++/11/bits/std_function.h:353:8: required by substitution of ‘template<class _Res, class ... _ArgTypes> template<class _Cond, class _Tp> using _Requires = std::__enable_if_t<_Cond::value, _Tp> [with _Cond = std::function<void(std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> >)>::_Callable<TeleopTurtle::sendGoal(float)::<lambda(std::shared_future<std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> > >)>, TeleopTurtle::sendGoal(float)::<lambda(std::shared_future<std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> > >)>, std::__invoke_result<TeleopTurtle::sendGoal(float)::<lambda(std::shared_future<std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> > >)>&, std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> > > >; _Tp = std::function<void(std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> >)>&; _Res = void; _ArgTypes = {std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> >}]’
/usr/include/c++/11/bits/std_function.h:530:2: required by substitution of ‘template<class _Functor> std::function<void(std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> >)>::_Requires<std::function<void(std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> >)>::_Callable<_Functor, typename std::enable_if<(! std::is_same<typename std::remove_cv<typename std::remove_reference<_Tp>::type>::type, std::function<void(std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> >)> >::value), std::decay<_Tp> >::type::type, std::__invoke_result<typename std::enable_if<(! std::is_same<typename std::remove_cv<typename std::remove_reference<_Tp>::type>::type, std::function<void(std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> >)> >::value), std::decay<_Tp> >::type::type&, std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> > > >, std::function<void(std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> >)>&> std::function<void(std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> >)>::operator=<_Functor>(_Functor&&) [with _Functor = TeleopTurtle::sendGoal(float)::<lambda(std::shared_future<std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> > >)>]’
/home/pi/ros2_ws/src/ros_tutorials/turtlesim/tutorials/teleop_turtle_key.cpp:200:5: required from here
/usr/include/c++/11/type_traits:2211:11: error: no type named ‘type’ in ‘struct std::enable_if<false, std::function<void(std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> >)>&>’ 2211 | using __enable_if_t = typename enable_if<_Cond, _Tp>::type;
| ^~~~~~~~~~~~~
In file included from /usr/include/c++/11/future:47,
from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:18,
from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
from /home/pi/ros2_ws/src/ros_tutorials/turtlesim/tutorials/teleop_turtle_key.cpp:1:
/usr/include/c++/11/bits/std_function.h:540:9: note: candidate: ‘template<class _Functor> std::function<_Res(_ArgTypes ...)>& std::function<_Res(_ArgTypes ...)>::operator=(std::reference_wrapper<_Functor>) [with _Functor = _Functor; _Res = void; _ArgTypes = {std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> >}]’
540 | operator=(reference_wrapper<_Functor> __f) noexcept
| ^~~~~~~~
/usr/include/c++/11/bits/std_function.h:540:9: note: template argument deduction/substitution failed:
/home/pi/ros2_ws/src/ros_tutorials/turtlesim/tutorials/teleop_turtle_key.cpp:200:5: note: ‘TeleopTurtle::sendGoal(float)::<lambda(std::shared_future<std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> > >)>’ is not derived from ‘std::reference_wrapper<_Tp>’
200 | };
| ^
In file included from /usr/include/c++/11/future:47,
from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:18,
from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
from /home/pi/ros2_ws/src/ros_tutorials/turtlesim/tutorials/teleop_turtle_key.cpp:1:
/usr/include/c++/11/bits/std_function.h:469:7: note: candidate: ‘std::function<_Res(_ArgTypes ...)>& std::function<_Res(_ArgTypes ...)>::operator=(const std::function<_Res(_ArgTypes ...)>&) [with _Res = void; _ArgTypes = {std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> >}]’
469 | operator=(const function& __x)
| ^~~~~~~~
/usr/include/c++/11/bits/std_function.h:469:33: note: no known conversion for argument 1 from ‘TeleopTurtle::sendGoal(float)::<lambda(std::shared_future<std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> > >)>’ to ‘const std::function<void(std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> >)>&’
469 | operator=(const function& __x)
| ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/11/bits/std_function.h:487:7: note: candidate: ‘std::function<_Res(_ArgTypes ...)>& std::function<_Res(_ArgTypes ...)>::operator=(std::function<_Res(_ArgTypes ...)>&&) [with _Res = void; _ArgTypes = {std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> >}]’
487 | operator=(function&& __x) noexcept
| ^~~~~~~~
/usr/include/c++/11/bits/std_function.h:487:28: note: no known conversion for argument 1 from ‘TeleopTurtle::sendGoal(float)::<lambda(std::shared_future<std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> > >)>’ to ‘std::function<void(std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> >)>&&’
487 | operator=(function&& __x) noexcept
| ~~~~~~~~~~~^~~
/usr/include/c++/11/bits/std_function.h:501:7: note: candidate: ‘std::function<_Res(_ArgTypes ...)>& std::function<_Res(_ArgTypes ...)>::operator=(std::nullptr_t) [with _Res = void; _ArgTypes = {std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> >}; std::nullptr_t = std::nullptr_t]’
501 | operator=(nullptr_t) noexcept
| ^~~~~~~~
/usr/include/c++/11/bits/std_function.h:501:17: note: no known conversion for argument 1 from ‘TeleopTurtle::sendGoal(float)::<lambda(std::shared_future<std::shared_ptr<rclcpp_action::ClientGoalHandle<turtlesim::action::RotateAbsolute> > >)>’ to ‘std::nullptr_t’
501 | operator=(nullptr_t) noexcept
| ^~~~~~~~~
gmake[2]: *** [CMakeFiles/turtle_teleop_key.dir/build.make:76: CMakeFiles/turtle_teleop_key.dir/tutorials/teleop_turtle_key.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:628: CMakeFiles/turtle_teleop_key.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
gmake: *** [Makefile:146: all] Error 2
---
Failed <<< turtlesim [2min 29s, exited with code 2]
Summary: 0 packages finished [2min 30s]
1 package failed: turtlesim
1 package had stderr output: turtlesim
</code></pre>
<p>my ubuntu version is 20.04 LTS and my ROS version is humble. what should I do?</p>
<hr />
<p><a href="https://answers.ros.org/question/412774/colcon-build-failed-on-ros2/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/140428/redbeet1007/" rel="nofollow noreferrer">redbeet1007</a> on ROS Answers with karma: 1 on 2023-02-23</p>
<p>Post score: 0</p>
|
colcon build failed on ros2
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>You can find the decision-making package over here,</p>
<p><a href="https://github.com/cogniteam/decision_making" rel="nofollow noreferrer">https://github.com/cogniteam/decision_making</a></p>
<p>For installation you can use tutorials below.</p>
<p><a href="http://wiki.ros.org/decision_making" rel="nofollow noreferrer">http://wiki.ros.org/decision_making</a></p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/63046/ranjit-kathiriya/" rel="nofollow noreferrer">Ranjit Kathiriya</a> with karma: 1622 on 2023-02-23</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
|
103062
|
2023-02-23T09:29:32.000
|
|ros-melodic|rqt|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I was following this tutorial <a href="http://wiki.ros.org/decision_making/Tutorials/Runtime" rel="nofollow noreferrer">http://wiki.ros.org/decision_making/Tutorials/Runtime</a> and wasn't able to find the plugin under the plugins dropdown in rqt. Is it something I have to install or am I not looking in the right place?</p>
<hr />
<p><a href="https://answers.ros.org/question/412789/unable-to-find-decision-making-rqt-plugin/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/133965/rsankhye97/" rel="nofollow noreferrer">rsankhye97</a> on ROS Answers with karma: 1 on 2023-02-23</p>
<p>Post score: 0</p>
|
Unable to find Decision Making rqt plugin
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Include the following In your costmap_common_params file:</p>
<pre><code>observation_sources: laser_scan_sensor point_cloud_sensor
laser_scan_sensor: {sensor_frame: camera_link, data_type: LaserScan, topic: /scan, marking: true, clearing: true}
point_cloud_sensor: {
sensor_frame: camera_link,
data_type: PointCloud2,
topic: rtabmap/depth/color/ground,
expected_update_rate: 1.5,
marking: true,
clearing: true,
min_obstacle_height: -99999.0,
max_obstacle_height: 99999.0}
</code></pre>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/115712/chased11/" rel="nofollow noreferrer">chased11</a> with karma: 137 on 2023-02-23</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
|
103064
|
2023-02-23T15:06:51.000
|
|navigation|laserscan|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Good Day,</p>
<p>I have a depthimage camera with associated ros package to generate point cloud data on my/points topic and an Rplidar that generates laserscan data on the/scan topic. I have the nav stack working with the laserscan/scan topic but now I also want to use the forward facing depth camera. I review the navigation stack documentation, is it as simple as adding another obstacle layer to cosmap that uses the point cloud /points topic?</p>
<p>Regards,</p>
<hr />
<p><a href="https://answers.ros.org/question/412817/use-both-point-cloud--and-laserscan-with-navigation-stack/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/55617/chm007/" rel="nofollow noreferrer">chm007</a> on ROS Answers with karma: 34 on 2023-02-23</p>
<p>Post score: 0</p>
|
Use both point cloud and laserscan with navigation stack
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>The best is probably to have all these frames defined in a URDF. This is basically the model of your robot.</p>
<p><a href="http://wiki.ros.org/robot_state_publisher" rel="nofollow noreferrer">robot_state_publisher</a> can parse it and publish both the fixed and time-varying transforms.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/11856/olivier-kermorgant/" rel="nofollow noreferrer">Olivier Kermorgant</a> with karma: 280 on 2023-06-05</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 2</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/3384/tom-moore/" rel="nofollow noreferrer">Tom Moore</a> on 2023-06-05</strong>:<br />
Yes, this is the correct way to go, @peter_feng, and the EKF will still work with the transforms when they are defined this way.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/115712/chased11/" rel="nofollow noreferrer">chased11</a> on 2023-06-05</strong>:<br />
Does using the static transform publishers from base_link to imu_link and gps_link not suffice? (i.e. define base_link as COR and broadcast static transform between [-0.5,0,0] if IMU is 0.5 m behind the COR)</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/3384/tom-moore/" rel="nofollow noreferrer">Tom Moore</a> on 2023-06-06</strong>:<br />
Yes, using a <code>static_transform_publisher</code> is fine, and was my original suggestion, but putting together a URDF model for your bot is always a good idea.</p>
|
103066
|
2023-02-23T22:05:40.000
|
|ros|navigation|robot-localization|transform|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>My robot has a IMU sensor and a GPS.Now I want to use the package <code>robot_localization</code>.</p>
<p>How have I published the position transform?</p>
<p>For instance,I set the frame_id of IMU sensor to 'imu', set the frame_id of GPS to 'gps' and the robot's frame_id is 'base_link'.</p>
<p>So I publish the transform to the node <code>/tf</code>:</p>
<p>For IMU sensor,<code>frame_id</code> is 'base_link' and <code>child_frame_id</code> is 'imu', x:... y:... z:...</p>
<p>For GPS,<code>frame_id</code> is 'base_link' and <code>child_frame_id</code> is 'gps', x:... y:... z:...</p>
<p>Am I right?Will the robot_localization package automatically acquire these transforms when doing merging?</p>
<hr />
<p><a href="https://answers.ros.org/question/412829/does-the-package-robot_localization-need-the-position-transform-between-sensors?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/140466/peter_feng/" rel="nofollow noreferrer">peter_feng</a> on ROS Answers with karma: 3 on 2023-02-23</p>
<p>Post score: 0</p>
|
Does the package robot_localization need the position transform between sensors?
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I got the answer: the coordinate system in rviz is based on odom, which is an estimation of the robot's coordinate and it's not the "real" coordinate in Gazebo. There are many reasons these two coordinates don't fit: the wheels slip when you give a large velocity command; in this case, the robot doesn't move in "real" world, but in odom(the estimation of coordinate), the estimator "thinks" it moves forward already. What the laserscan returns are the relative coordinates of the point cloud wrt the cart, which is correct; only the cart's estimated coordinate wrt the world's origin is wrong. This is why the point cloud's relative position wrt to the cart is correct but the position wrt to the world's origin is wrong.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/140709/williamlinouo/" rel="nofollow noreferrer">WilliamLinOuO</a> with karma: 16 on 2023-02-27</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/103873/davies-ogunsina/" rel="nofollow noreferrer">Davies Ogunsina</a> on 2023-02-27</strong>:<br />
So the right fixed frame is odom.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/140709/williamlinouo/" rel="nofollow noreferrer">WilliamLinOuO</a> on 2023-02-27</strong>:<br />
Indeed, if the estimated states are accurate, the coordinates in Rviz would be the same as in Gazebo.</p>
|
103071
|
2023-02-24T16:01:26.000
|
|ros|gazebo|rviz|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hi community!</p>
<p>There is a pillar in my gazebo simulation world and a cart driving around, as shown below:</p>
<blockquote>
<p><a href="https://drive.google.com/file/d/1DKzFzQuhfnstqBMqZySwT_iA2Ue1EEUF/view?usp=sharing" rel="nofollow noreferrer">https://drive.google.com/file/d/1DKzFzQuhfnstqBMqZySwT_iA2Ue1EEUF/view?usp=sharing</a></p>
</blockquote>
<p>When the Rviz starts, the pillar is at the same location as in the gazebo world, with respect to the odom frame:</p>
<blockquote>
<p><a href="https://drive.google.com/file/d/1TJSSLlfdwrIELialTmtBYpUPelH-sPfs/view?usp=sharing" rel="nofollow noreferrer">https://drive.google.com/file/d/1TJSSLlfdwrIELialTmtBYpUPelH-sPfs/view?usp=sharing</a></p>
</blockquote>
<p>However, when the cart is moving, the pillar's location is strangely changing:</p>
<blockquote>
<p><a href="https://drive.google.com/file/d/1icZQgp5Dh-X6WpwHY5lkD0zPmc1vRr1S/view?usp=sharing" rel="nofollow noreferrer">https://drive.google.com/file/d/1icZQgp5Dh-X6WpwHY5lkD0zPmc1vRr1S/view?usp=sharing</a></p>
</blockquote>
<p>Why is it the case? And how could I fix it? Sorry I just joined the community and I could only post link with images. Thank you so much for your consideration and help!</p>
<p>Appreciatively,
William</p>
<p>PS: The tf trees is attached:</p>
<blockquote>
<p><a href="https://drive.google.com/file/d/1_Dby3Ofx_Pulx2YakEkmLIfy3jYDW20W/view?usp=sharing" rel="nofollow noreferrer">https://drive.google.com/file/d/1_Dby3Ofx_Pulx2YakEkmLIfy3jYDW20W/view?usp=sharing</a></p>
</blockquote>
<hr />
<p><a href="https://answers.ros.org/question/412852/static-object-in-gazebo-moves-in-rviz-with-respect-to-the-world-frame/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/140709/williamlinouo/" rel="nofollow noreferrer">WilliamLinOuO</a> on ROS Answers with karma: 16 on 2023-02-24</p>
<p>Post score: 0</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/103873/davies-ogunsina/" rel="nofollow noreferrer">Davies Ogunsina</a> on 2023-02-24</strong>:<br />
Can you set your fixed frame to base_link or your robot base frame and see if the pillar still moves while teleoperating your robot.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/140709/williamlinouo/" rel="nofollow noreferrer">WilliamLinOuO</a> on 2023-02-26</strong>:<br />
Hi Davies, thanks for your reply! I tried and it doesn't work, the pillar wrt odom is still moving as the cart moves, moreover, if I set the fixed frame to base_link the grid is moving with the cart now. What I would like to achieve is the grid of the world frame is fixed with odom, while the pillar is static as it's in the gazebo simulation.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/103873/davies-ogunsina/" rel="nofollow noreferrer">Davies Ogunsina</a> on 2023-02-26</strong>:<br />
If you set your fixed frame to odom , it tracks the pose of the robot ..tell you where the robot is when visualising with rviz .what is your tf tree like ?</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/140709/williamlinouo/" rel="nofollow noreferrer">WilliamLinOuO</a> on 2023-02-26</strong>:<br />
Hi Davies, the tree is shown on the left of the updated picture in the original question.</p>
|
Static object in Gazebo moves in RViz with respect to the world frame
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>There is no <code>catkin_make</code> in ROS 2.</p>
<p>The tutorial you link is from 2019, and was written for ROS Melodic, which is a ROS 1 version.</p>
<p>You'll have to either ask the author to update the tutorial (I don't expect that to happen), or find a tutorial which specifically supports ROS 2 Humble.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> with karma: 86574 on 2023-02-26</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/140757/sukarnajana/" rel="nofollow noreferrer">SukarnaJana</a> on 2023-02-28</strong>:<br />
Thanks for bringing this point under my notice, that Catkin is not there in ROS2</p>
|
103073
|
2023-02-26T00:56:10.000
|
|ros2|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<h3>Quick Glance:</h3>
<p>I am using <strong>ROS2 Humble</strong> on <strong>Ubuntu Jammy(22.04)</strong> and i was trying to integrate <strong>YDLidar</strong> by following this <a href="https://www.generationrobots.com/blog/en/lidar-integration-with-ros-quickstart-guide-and-projects-ideas/" rel="nofollow noreferrer">Guide</a> and in point we have to Run <code>catkin_make</code> but i am unable to use it.</p>
<h3>What i Did:</h3>
<p>I tried to run <code>sudo apt install catkin</code> and i got this error: <code>E: Unable to correct problems, you have held broken packages.</code></p>
<pre><code>Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
python3-catkin-pkg : Conflicts: catkin but 0.8.10-7 is to be installed
python3-catkin-pkg-modules : Conflicts: catkin but 0.8.10-7 is to be installed
E: Unable to correct problems, you have held broken packages.
</code></pre>
<p>I went though this <a href="http://docs.ros.org/en/melodic/api/catkin/html/user_guide/installation.html" rel="nofollow noreferrer">ROS page</a> unable to fix by changing the last command based on my ROS version but i got this error</p>
<pre><code>E: Package 'python-catkin-pkg' has no installation candidate
E: Package 'python-empy' has no installation candidate
E: Package 'python-nose' has no installation candidate
</code></pre>
<p>I tried <a href="https://answers.ros.org/question/350517/ros2-install-catkin/" rel="nofollow noreferrer">This</a> also, I too got same error.</p>
<p>So, please help me /
It will be really Great-full</p>
<hr />
<p><a href="https://answers.ros.org/question/412875/unable-to-run-%22catkin_make%22/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/140757/sukarnajana/" rel="nofollow noreferrer">SukarnaJana</a> on ROS Answers with karma: 3 on 2023-02-26</p>
<p>Post score: 0</p>
|
Unable to run "catkin_make"
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hi,</p>
<p>The problem is not related to the navigation stack. The problem is the launch_ros package, this commit fixes your issue: <a href="https://github.com/ros2/launch_ros/commit/3a309e5b7f802b2f4a36ba2bcdf91702df7fef12" rel="nofollow noreferrer">https://github.com/ros2/launch_ros/commit/3a309e5b7f802b2f4a36ba2bcdf91702df7fef12</a></p>
<p>Unfortunately, at the moment of writing this response, the apt installation of launch_ros still does not have this fix. What you can do is to clone the package to your workspace and build it locally. That will solve your problem.</p>
<pre><code>cd ~/your_ws/src
git clone -b humble https://github.com/ros2/launch_ros.git
colcon build
</code></pre>
<p>Hope that solves your issue.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/80925/filipe-cerveira/" rel="nofollow noreferrer">Filipe Cerveira</a> with karma: 16 on 2023-04-17</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
|
103075
|
2023-02-26T09:02:18.000
|
|ros2|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I have a ROS2 workspace with a package that is functioning properly. This package starts Nav2 using the bringup_launch script.</p>
<p>Now I want to start Nav2 with a given namespace. However, when I pass the namespace argument (as below), everything starts correctly but the Nav2 stack doesn't show any info in the command line and also shows up as unknown in RViz (It hasn't started). The other nodes being launched along with Nav2 start correctly with the namespace argument (ex. robot_state_publisher and robot_localization)</p>
<p>Nav2 is started as follows:</p>
<pre><code>nav2_launch = IncludeLaunchDescription(
PythonLaunchDescriptionSource(os.path.join(nav2_launch_dir, 'bringup_launch.py')),
launch_arguments = {'map': static_map_path,
'params_file': nav2_params_path,
'use_sim_time': LaunchConfiguration('use_sim_time'),
'autostart': 'true',
'namespace': 'abc',
'use_namespace': 'true'}.items()
)
</code></pre>
<p>Any Ideas why? Also, can someone please provide the correct way to launch Nav2 if the given approach is not correct?</p>
<p>For reference, the following comments show how the other nodes are started</p>
<pre><code>remappings = [('/tf', 'tf'),
('/tf_static', 'tf_static')]
robot_state_publisher_node = launch_ros.actions.Node(
package='robot_state_publisher',
executable='robot_state_publisher',
parameters=[{'robot_description': Command(['xacro ', LaunchConfiguration('model')]),
'use_sim_time': LaunchConfiguration('use_sim_time')}],
remappings=remappings,
namespace='abc',
)
map_odom_publisher = launch_ros.actions.Node(
package="tf2_ros",
executable="static_transform_publisher",
output="screen" ,
arguments=["--x", "0", "--y", "0", "--z", "0", "--roll", "0", "--pitch", "0", "--yaw", "0", "--frame-id", "map", "--child-frame-id", "odom"],
remappings=remappings,
namespace='abc',
)
robot_localization_node = launch_ros.actions.Node(
package='robot_localization',
executable='ekf_node',
name='ekf_filter_node',
output='screen',
parameters=[os.path.join(pkg_share, 'config', 'ekf.yaml'),
{'use_sim_time': LaunchConfiguration('use_sim_time')}],
remappings=remappings,
namespace='abc'
)
</code></pre>
<p>ROS2 Distribution: humble</p>
<hr />
<p><a href="https://answers.ros.org/question/412881/ros2-nav2-not-starting-with-namespace/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/140771/hussein_mo/" rel="nofollow noreferrer">hussein_mo</a> on ROS Answers with karma: 1 on 2023-02-26</p>
<p>Post score: 0</p>
|
ROS2 Nav2 Not Starting with namespace
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hi,</p>
<p>UWSim is more of a nice renderer that takes either your robot current pose or cmd_vel as an input.</p>
<p>In order to do path planning you have to get a representation of the robot and its surrounding environment in a dedicated planner.
How you fill this environment with information is up to you. UWSim can publish 3D point clouds but you could just use the ground truth when testing the planner itself.</p>
<p>To my point of view the resulting trajectory should be visualized in RViz and not UWSim.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/11856/olivier-kermorgant/" rel="nofollow noreferrer">Olivier Kermorgant</a> with karma: 280 on 2023-02-27</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/121802/marvelousluke/" rel="nofollow noreferrer">marvelousluke</a> on 2023-02-28</strong>:<br />
Thank you sir for your answer! I know RViz should do but I am looking for a way to generate some trajectory curve in UWSim which g500 can follow.(without considering control algorithm for now)
Question is that there is not much information about UWSim usage.So sir,could you please advise me how to learn it?</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/121802/marvelousluke/" rel="nofollow noreferrer">marvelousluke</a> on 2023-03-08</strong>:<br />
Hey I am back to Rviz now.And I came up with a new question here<a href="https://answers.ros.org/question/413194/could-gmapping-pkg-work-in-uwsim/" rel="nofollow noreferrer">link text</a> hopefully you could give me a little advice.Thanks!</p>
|
103077
|
2023-02-27T02:18:51.000
|
|ros|ros-melodic|pathplanning|uwsim|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Anyone knows about how to develop your code on the platform of UWSim?I want to test my path planning algorithm in UWSim,like planning a pratical path from a start point to a goal position with obstacle avoidance,but I have no idea where to start.How should I configure the map or mark the obstacle.How to generate the trajectory and virualize it in UWSim.These are confusing issues because UWSim has no API at all.So I am here for someone who has relavent experience in using UWSim.Just tell me the idea of how to do it and thanks!</p>
<hr />
<p><a href="https://answers.ros.org/question/412908/how-to-apply-a-path-planning-algorithm-in-uwsim/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/121802/marvelousluke/" rel="nofollow noreferrer">marvelousluke</a> on ROS Answers with karma: 20 on 2023-02-27</p>
<p>Post score: 0</p>
|
How to apply a path planning algorithm in UWSim
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hello @gurselturkeri,</p>
<blockquote>
<p>have added camera plugin in a .urdf file but then I could not added in a launch.py</p>
</blockquote>
<p>If you have added camera in urdf file then you don't need to add it to your launch file.</p>
<p>sudo apt-get install ros-humble-gazebo-plugins</p>
<p>Note: You need to add camera plugins for the gazebo also as you did in your urdf.</p>
<blockquote>
<p>but then I could not added in a launch.py file because of that image topic not published. Is my urdf file correct?</p>
</blockquote>
<p>I think you forgot to <a href="https://classic.gazebosim.org/tutorials?tut=ros_gzplugins" rel="nofollow noreferrer">add camera link</a> into your urdf which you have shared above.</p>
<pre><code><!-- Camera -->
<link name="camera_link">
<collision>
<origin xyz="0 0 0" rpy="0 0 0"/>
<geometry>
<box size="<span class="math-container">${camera_link} $</span>{camera_link} ${camera_link}"/>
</geometry>
</collision>
<visual>
<origin xyz="0 0 0" rpy="0 0 0"/>
<geometry>
<box size="<span class="math-container">${camera_link} $</span>{camera_link} ${camera_link}"/>
</geometry>
<material name="red"/>
</visual>
<inertial>
<mass value="1e-5" />
<origin xyz="0 0 0" rpy="0 0 0"/>
<inertia ixx="1e-6" ixy="0" ixz="0" iyy="1e-6" iyz="0" izz="1e-6" />
</inertial>
</link>
<joint name="camera_joint" type="fixed">
<axis xyz="0 1 0" />
<origin xyz="0 0 0" rpy="0 0 0"/>
<parent link="link_4"/>
<child link="camera_link"/>
</joint>
</code></pre>
<blockquote>
<p>And how can I added launch file to publish image topic?</p>
</blockquote>
<p>It will publish frames based on the gazebo settings you are doing in your plugin on camera_controller. In your case, it will be automatically published when the gazebo start based on your code</p>
<p>You can check this by opening rviz2 by hitting command in your terminal <code>ros2 run rviz2 rviz2</code>
or by <code>ros2 topic list</code></p>
<p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16775878771735333.png" alt="image description" /></p>
<p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16775879039435786.png" alt="image description" /></p>
<p>As you can see above image, you can see a boll and the robot base in the rviz image visualize.</p>
<p>Feel free to drop an comment if you have any question,</p>
<p>so, my full urdf file is below:</p>
<pre><code><?xml version="1.0"?>
<robot name="robot_1">
<link name="world"/>
<link name="base_link">
<visual>
<geometry>
<cylinder length="0.05" radius="0.2"/>
</geometry>
<material name="Black">
<color rgba="0 0 0 1"/>
</material>
<origin rpy="0 0 0" xyz="0 0 0.025"/>
</visual>
<collision>
<geometry>
<cylinder length="0.05" radius="0.2"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0 0.025"/>
</collision>
<inertial>
<origin rpy="0 0 0" xyz="0 0 0.025"/>
<mass value="5.0"/>
<inertia ixx="0.0135" ixy="0.0" ixz="0.0" iyy="0.0135" iyz="0.0" izz="0.05"/>
</inertial>
</link>
<joint name="fixed" type="fixed">
<parent link="world"/>
<child link="base_link"/>
<dynamics damping="10" friction="1.0"/>
</joint>
<link name="link_1">
<visual>
<geometry>
<cylinder length="0.5" radius="0.08"/>
</geometry>
<material name="blue">
<color rgba="0 0 0.8 1"/>
</material>
<origin rpy="0 0 0" xyz="0 0 0.25"/>
</visual>
<collision>
<geometry>
<cylinder length="0.5" radius="0.08"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0 0.25"/>
</collision>
<inertial>
<origin rpy="0 0 0" xyz="0 0 0.25"/>
<mass value="5.0"/>
<inertia ixx="0.107" ixy="0.0" ixz="0.0" iyy="0.107" iyz="0.0" izz="0.0125"/>
</inertial>
</link>
<joint name="joint_1" type="continuous">
<axis xyz="0 0 1"/>
<parent link="base_link"/>
<child link="link_1"/>
<origin rpy="0 0 0" xyz="0.0 0.0 0.05"/>
<dynamics damping="10" friction="1.0"/>
</joint>
<link name="link_2">
<inertial>
<origin rpy="0 0 0" xyz="0 0 0.2"/>
<mass value="2.0"/>
<inertia ixx="0.027" ixy="0.0" ixz="0.0" iyy="0.027" iyz="0.0" izz="0.0025"/>
</inertial>
<visual>
<geometry>
<cylinder length="0.1" radius="0.08"/>
</geometry>
<material name="Red">
<color rgba="1 0 0 1"/>
</material>
</visual>
<collision>
<geometry>
<cylinder length="0.1" radius="0.08"/>
</geometry>
</collision>
</link>
<joint name="joint_2" type="continuous">
<axis xyz="0 0 1"/>
<parent link="link_1"/>
<child link="link_2"/>
<origin rpy="0 1.5708 0" xyz="0.0 -0.005 0.58"/>
<limit lower="-0.25" upper="3.34" effort="10" velocity="0.5"/>
<dynamics damping="10" friction="1.0"/>
</joint>
<link name="link_3">
<inertial>
<origin rpy="0 0 0" xyz="0 0 0.2"/>
<mass value="0.01"/>
<inertia ixx="0.027" ixy="0.0" ixz="0.0" iyy="0.027" iyz="0.0" izz="0.0025"/>
</inertial>
<visual>
<geometry>
<cylinder length="0.4" radius="0.05"/>
</geometry>
<material name="blue">
<color rgba="0.5 0.5 0.5 1"/>
</material>
<!-- <origin rpy="0 0 0" xyz="0 0 0.2"/> -->
</visual>
<collision>
<geometry>
<cylinder length="0.4" radius="0.05"/>
</geometry>
</collision>
</link>
<joint name="joint_3" type="fixed">
<parent link="link_2"/>
<child link="link_3"/>
<origin rpy="1.57 0 0" xyz="0.0 0.2 0 "/>
<dynamics damping="10" friction="1.0"/>
</joint>
<link name="link_4">
<inertial>
<origin rpy="0 0 0" xyz="0 0 0.2"/>
<mass value="0.01"/>
<inertia ixx="0.027" ixy="0.0" ixz="0.0" iyy="0.027" iyz="0.0" izz="0.0025"/>
</inertial>
<visual>
<geometry>
<cylinder length="0.1" radius="0.06"/>
</geometry>
<material name="Red">
<color rgba="1 0 0 1"/>
</material>
</visual>
<collision>
<geometry>
<cylinder length="0.1" radius="0.06"/>
</geometry>
</collision>
</link>
<joint name="joint_4" type="continuous">
<parent link="link_3"/>
<child link="link_4"/>
<origin rpy="1.57 0 0" xyz=" 0 0 -0.25"/>
<axis xyz=" 0 0 1"/>
<limit lower="-1.92" upper="1.92" effort="10" velocity="0.5"/>
<dynamics damping="10" friction="1.0"/>
</joint>
<link name="link_5">
<inertial>
<origin rpy="0 0 0" xyz="0 0 0.2"/>
<mass value="0.01"/>
<inertia ixx="0.027" ixy="0.0" ixz="0.0" iyy="0.027" iyz="0.0" izz="0.0025"/>
</inertial>
<visual>
<geometry>
<cylinder length="0.3" radius="0.03"/>
</geometry>
<material name="yello">
<color rgba="0 1 0.5 1"/>
</material>
</visual>
<collision>
<geometry>
<cylinder length="0.3" radius="0.03"/>
</geometry>
<dynamics damping="0.0" friction="0.0"/>
</collision>
</link>
<joint name="joint_5" type="fixed">
<parent link="link_4"/>
<child link="link_5"/>
<origin rpy="1.57 0 0" xyz="0.0 -0.2 0 "/>
<dynamics damping="10" friction="1.0"/>
</joint>
<!-- Camera -->
<link name="camera_link">
<collision>
<origin xyz="0 0 0" rpy="0 0 0"/>
<geometry>
<box size="<span class="math-container">${camera_link} $</span>{camera_link} ${camera_link}"/>
</geometry>
</collision>
<visual>
<origin xyz="0 0 0" rpy="0 0 0"/>
<geometry>
<box size="<span class="math-container">${camera_link} $</span>{camera_link} ${camera_link}"/>
</geometry>
<material name="red"/>
</visual>
<inertial>
<mass value="1e-5" />
<origin xyz="0 0 0" rpy="0 0 0"/>
<inertia ixx="1e-6" ixy="0" ixz="0" iyy="1e-6" iyz="0" izz="1e-6" />
</inertial>
</link>
<joint name="camera_joint" type="fixed">
<axis xyz="0 1 0" />
<origin xyz="0 0 0" rpy="0 0 0"/>
<parent link="link_4"/>
<child link="camera_link"/>
</joint>
<gazebo reference="base_link">
<material>Gazebo/Black</material>
</gazebo>
<gazebo reference="link_1">
<material>Gazebo/Orange</material>
</gazebo>
<gazebo reference="link_3">
<material>Gazebo/Orange</material>
</gazebo>
<gazebo reference="link_2">
<material>Gazebo/Red</material>
</gazebo>
<gazebo reference="link_4">
<material>Gazebo/Red</material>
</gazebo>
<gazebo reference="link_5">
<material>Gazebo/Orange</material>
</gazebo>
<gazebo reference="camera_link">
<sensor type="camera" name="camera1">
<update_rate>30.0</update_rate>
<camera name="head">
<horizontal_fov>1.3962634</horizontal_fov>
<image>
<width>800</width>
<height>800</height>
<format>R8G8B8</format>
</image>
<clip>
<near>0.02</near>
<far>300</far>
</clip>
<noise>
<type>gaussian</type>
<!-- Noise is sampled independently per pixel on each frame.
That pixel's noise value is added to each of its color
channels, which at that point lie in the range [0,1]. -->
<mean>0.0</mean>
<stddev>0.007</stddev>
</noise>
</camera>
<plugin name="camera_controller" filename="libgazebo_ros_camera.so">
<alwaysOn>true</alwaysOn>
<updateRate>0.0</updateRate>
<cameraName>rrbot/camera1</cameraName>
<imageTopicName>image_raw</imageTopicName>
<cameraInfoTopicName>camera_info</cameraInfoTopicName>
<frameName>camera_link</frameName>
<hackBaseline>0.07</hackBaseline>
<distortionK1>0.0</distortionK1>
<distortionK2>0.0</distortionK2>
<distortionK3>0.0</distortionK3>
<distortionT1>0.0</distortionT1>
<distortionT2>0.0</distortionT2>
</plugin>
</sensor>
</gazebo>
<gazebo>
<plugin filename="libgazebo_ros2_control.so" name="gazebo_ros2_control">
<robot_sim_type>gazebo_ros2_control/GazeboSystem</robot_sim_type>
<parameters>/home/airobo/ros2_ws/src/big_bazu/config/jtc.yaml</parameters>
</plugin>
</gazebo>
<ros2_control name="GazeboSystem" type="system">
<hardware>
<plugin>gazebo_ros2_control/GazeboSystem</plugin>
</hardware>
<joint name="joint_1">
<command_interface name="position">
<param name="min">-3.14</param>
<param name="max">3.14</param>
</command_interface>
<state_interface name="position"/>
<param name="initial_position">0.0</param>
</joint>
<joint name="joint_2">
<command_interface name="position">
<param name="min">-3.14</param>
<param name="max">3.14</param>
</command_interface>
<state_interface name="position"/>
<param name="initial_position">-1.57</param>
</joint>
<joint name="joint_4">
<command_interface name="position">
<param name="min">-3.14</param>
<param name="max">3.14</param>
</command_interface>
<state_interface name="position"/>
<param name="initial_position">0.0</param>
</joint>
</ros2_control>
</robot>
</code></pre>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/63046/ranjit-kathiriya/" rel="nofollow noreferrer">Ranjit Kathiriya</a> with karma: 1622 on 2023-02-28</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
|
103079
|
2023-02-28T06:32:30.000
|
|ros|gazebo|ros2|camera|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hi, I have added camera plugin in a .urdf file but then I could not added in a launch.py file because of that image topic not published.
Is my urdf file correct? And how can I added launch file to publish image topic?</p>
<pre><code><joint name="camera_joint" type="fixed">
<parent link="link_3"/>
<child link="camera_link"/>
<origin rpy="0 0 0" xyz="0 0 0.4"/>
</joint>
<gazebo reference="camera_link">
<sensor type="camera" name="camera1">
<update_rate>30.0</update_rate>
<camera name="head">
<horizontal_fov>1.3962634</horizontal_fov>
<image>
<width>800</width>
<height>800</height>
<format>R8G8B8</format>
</image>
<clip>
<near>0.02</near>
<far>300</far>
</clip>
<noise>
<type>gaussian</type>
<!-- Noise is sampled independently per pixel on each frame.
That pixel's noise value is added to each of its color
channels, which at that point lie in the range [0,1]. -->
<mean>0.0</mean>
<stddev>0.007</stddev>
</noise>
</camera>
<plugin name="camera_controller" filename="libgazebo_ros_camera.so">
<alwaysOn>true</alwaysOn>
<updateRate>0.0</updateRate>
<cameraName>robotic_arm/camera1</cameraName>
<imageTopicName>image_raw</imageTopicName>
<cameraInfoTopicName>camera_info</cameraInfoTopicName>
<frameName>camera_link</frameName>
<hackBaseline>0.07</hackBaseline>
<distortionK1>0.0</distortionK1>
<distortionK2>0.0</distortionK2>
<distortionK3>0.0</distortionK3>
<distortionT1>0.0</distortionT1>
<distortionT2>0.0</distortionT2>
</plugin>
</sensor>
</gazebo>
</code></pre>
<hr />
<p><a href="https://answers.ros.org/question/412944/add-camera-plugin-in-gazebo/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/99062/gurselturkeri/" rel="nofollow noreferrer">gurselturkeri</a> on ROS Answers with karma: 25 on 2023-02-28</p>
<p>Post score: 0</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/63046/ranjit-kathiriya/" rel="nofollow noreferrer">Ranjit Kathiriya</a> on 2023-02-28</strong>:<br />
Hello @gurselturkeri,</p>
<p>Is it possible to share your code so I can have a look what's the issue? It can be either full code or git repo.</p>
<p>Thanks</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/99062/gurselturkeri/" rel="nofollow noreferrer">gurselturkeri</a> on 2023-02-28</strong>:<br />
Launch file is same as in this question: <a href="https://answers.ros.org/question/412742/controller-manager-not-available-in-ros2/" rel="nofollow noreferrer">https://answers.ros.org/question/412742/controller-manager-not-available-in-ros2/</a></p>
<p><strong>Comment by <a href="https://answers.ros.org/users/63046/ranjit-kathiriya/" rel="nofollow noreferrer">Ranjit Kathiriya</a> on 2023-02-28</strong>:<br />
Tick the answer if you think it is right so it can help others in the community.</p>
|
add camera plugin in gazebo
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Figured it out. Turns out it should be <odometry_source> not despite the latter being in the tutorial.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/123880/alna_perera/" rel="nofollow noreferrer">ALNA_Perera</a> with karma: 33 on 2023-03-01</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
|
103081
|
2023-02-28T22:03:53.000
|
|ros2|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hi!</p>
<p>I am trying to simulate a simple differential drive robot (based on examples given) and I need to simulate the kidnapped robot problem. I have set the odometry source to 0 (encoder), but every time I move the robot model in gazebo, the odometry resets to the actual position of the robot regardless.</p>
<p>I checked the joint states for the two wheel joints, and they don't reset when I move the robot, so I am not sure why the odometry resets.</p>
<p>The code for my differential drive controller is given below.</p>
<p>Thanks!</p>
<pre><code><plugin name="differential_drive_controller" filename="libgazebo_ros_diff_drive.so">
<update_rate>30</update_rate>
<!-- Wheel Information -->
<left_joint>left_wheel_joint</left_joint>
<right_joint>right_wheel_joint</right_joint>
<wheel_separation>0.35</wheel_separation>
<wheel_diameter>0.1</wheel_diameter>
<!-- Limits -->
<max_wheel_torque>200</max_wheel_torque>
<max_wheel_acceleration>10.0</max_wheel_acceleration>
<!-- Output -->
<odometry_frame>odom</odometry_frame>
<robot_base_frame>base_link</robot_base_frame>
<!-- Odometry source, 0 for ENCODER, 1 for WORLD, defaults to WORLD -->
<odometrySource>0</odometrySource>
<command_topic>cmd_vel</command_topic>
<publish_odom>true</publish_odom>
<publish_odom_tf>true</publish_odom_tf>
<publish_wheel_tf>true</publish_wheel_tf>
</plugin>
</code></pre>
<hr />
<p><a href="https://answers.ros.org/question/412965/odometry-source-not-changing-to-encoder-on-differential-drive-plugin/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/123880/alna_perera/" rel="nofollow noreferrer">ALNA_Perera</a> on ROS Answers with karma: 33 on 2023-02-28</p>
<p>Post score: 0</p>
|
Odometry source not changing to encoder on differential drive plugin
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>The <code>--inorder</code> warning message in the title to this question is not the actual problem here.</p>
<p>The error "No such file" indicates that your <code>UR3_sim/ur3_sim_description/urdf/ur3_sim.urdf.xacro</code> file is not compatible with the newest <code>universal_robot</code> ros package. You need to fix the file paths inside that file.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> with karma: 4903 on 2023-03-01</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
|
103083
|
2023-03-01T03:29:18.000
|
|ros|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p><a href="https://github.com/EuropeanRoverChallenge/ERC-Remote-Maintenance-Sim" rel="nofollow noreferrer">https://github.com/EuropeanRoverChallenge/ERC-Remote-Maintenance-Sim</a>
Using the link I wrote all commands which is given in "Install on the host system" section.</p>
<p>When I try this command:</p>
<pre><code>$ roslaunch ur3_sim simulation.launch
</code></pre>
<p>It gives error like this:</p>
<pre><code> ... logging to /home/ubuntu4/.ros/log/f2319ee2-b808-11ed-bb34-1be4f5885cab/roslaunch-ubuntu4-6223.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
xacro: in-order processing became default in ROS Melodic. You can drop the option.
No such file or directory: /home/ubuntu4/catkin_ws3/src/universal_robot/ur_description/urdf/common.gazebo.xacro [Errno 2] No such file or directory: '/home/ubuntu4/catkin_ws3/src/universal_robot/ur_description/urdf/common.gazebo.xacro'
when processing file: /home/ubuntu4/catkin_ws3/src/UR3_sim/ur3_sim_description/urdf/ur3_sim.urdf.xacro
RLException: while processing /home/ubuntu4/catkin_ws3/src/UR3_sim/ur3_sim_gazebo/launch/ur3_sim.launch:
while processing /home/ubuntu4/catkin_ws3/src/UR3_sim/ur3_sim_description/launch/ur3_sim_upload.launch:
Invalid <param> tag: Cannot load command parameter [robot_description]: command [['/opt/ros/noetic/lib/xacro/xacro', '--inorder', '/home/ubuntu4/catkin_ws3/src/UR3_sim/ur3_sim_description/urdf/ur3_sim.urdf.xacro', 'transmission_hw_interface:=hardware_interface/PositionJointInterface']] returned with code [2].
Param xml is <param name="robot_description" command="<span class="math-container">$(find xacro)/xacro --inorder '$</span>(find ur3_sim_description)/urdf/ur3_sim.urdf.xacro' transmission_hw_interface:=$(arg transmission_hw_interface)"/>
The traceback for the exception was written to the log file
</code></pre>
<hr />
<p><a href="https://answers.ros.org/question/412972/%22xacro:-in-order-processing-became-default-in-ros-melodic.-you-can-drop-the-option%22-error/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/135363/speedtail765/" rel="nofollow noreferrer">Speedtail765</a> on ROS Answers with karma: 3 on 2023-03-01</p>
<p>Post score: 0</p>
|
"xacro: in-order processing became default in ROS Melodic. You can drop the option" error
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>The inherited state_interfaces_ is not available until on_activate and that is based on if the correct state interfaces that are setup in state_interface_configuration which takes place after on_config.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/43257/neuromancer2701/" rel="nofollow noreferrer">neuromancer2701</a> with karma: 71 on 2023-03-01</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
|
103085
|
2023-03-01T14:48:56.000
|
|ros2|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I have created a simple state broadcasting controller, I used the joint state broadcaster as a template.
The inherited state_interfaces_ vector is empty in the controller when I try to validate the interfaces in on_config.</p>
<p>I have setup the interfaces in the ros2_control plugin and set the names in state_interface_configuration in the controller.
I have put debug trace in both the command and sate configuration functions but I don't see the trace running.</p>
<p>Any ideas?</p>
<hr />
<p><a href="https://answers.ros.org/question/413001/state_interfaces_-empty-in-custom-ros2_control-controller/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/43257/neuromancer2701/" rel="nofollow noreferrer">neuromancer2701</a> on ROS Answers with karma: 71 on 2023-03-01</p>
<p>Post score: 0</p>
|
state_interfaces_ empty in custom ros2_control controller
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>First, it is important to note that the <code>ros2_supervisor.py</code> controller should not be used as a robot controller. This node is a special node created and added to the simulation by the <code>webots_ros2</code> interface to provide ROS services that allow the user to interact with the simulation, such as spawning robots. It is not intended to be used as a controller for your own robots and should not be started manually.</p>
<p>Furthermore, the way to use the <code>ros2_supervisor.py</code> node has changed in the latest version of the <code>webots_ros2</code> package (version 2023.0.2), and the tutorial you referenced is not reflecting the current usage. We plan to add more advanced tutorials to the documentation in the near future.</p>
<p>It is correct and possible to have multiple robots, here is the way to do it:</p>
<ol>
<li><p>As you already did, the .wbt world should contain two robots with different names and the controller field set to <code><extern></code>.</p>
</li>
<li><p>If the robots are the same, it is possible to use the same URDF file, especially if they both should use the same controller plugin, like the obstacle avoider. You can use the exact URDF given in the tutorial for both robots, as it adds the <code>MyRobotDriver</code> plugin and the two distance sensors. See <a href="https://docs.ros.org/en/foxy/Tutorials/Advanced/Simulators/Webots.html#updating-my-robot-urdf" rel="nofollow noreferrer">this link</a>. The name given in the URDF is not important and won't influence the simulation and the connection.</p>
</li>
<li><p>The content of the URDF should be read into a variable <code>robot_description</code>, like shown in the tutorial.</p>
</li>
<li><p>Finally, to start an obstacle avoider for each robot, you should start the two following nodes:</p>
<pre><code>my_robot_driver1 = Node(
package='webots_ros2_driver',
executable='driver',
output='screen',
additional_env={'WEBOTS_CONTROLLER_URL': controller_url_prefix() + 'robot_name_1'},
parameters=[
{'robot_description': robot_description},
]
)
my_robot_driver2 = Node(
package='webots_ros2_driver',
executable='driver',
output='screen',
additional_env={'WEBOTS_CONTROLLER_URL': controller_url_prefix() + 'robot_name_2'},
parameters=[
{'robot_description': robot_description},
]
)
</code></pre>
</li>
</ol>
<p>It is the driver node that is responsible to start the plugins and connect to the robot with the name given in the <code>WEBOTS_CONTROLLER_URL</code> variable.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/110419/ygoumaz/" rel="nofollow noreferrer">ygoumaz</a> with karma: 76 on 2023-03-02</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 3</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/51434/smarn/" rel="nofollow noreferrer">smarn</a> on 2023-03-02</strong>:<br />
Thank you for the thorough explanation. I had indeed messed up in my head the role of the ros2_supervisor.py executable.</p>
<p>Thanks to your sample code I found another silly mistake I have done, I was indeed using the driver node for each robot but in the parameters of the second robot I had put in the key of the dictionary 'robot_desctiption2' so the second robot was never moving because the driver node was never alive.</p>
<p>Thanks again :)</p>
|
103087
|
2023-03-01T19:27:46.000
|
|ros2|simulation|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hello, I am trying to make a simple application of 2 robots moving around in the webots simulator using ROS2.
I am using the logic described in the tutorials <a href="https://docs.ros.org/en/foxy/Tutorials/Advanced/Simulators/Webots.html" rel="nofollow noreferrer">https://docs.ros.org/en/foxy/Tutorials/Advanced/Simulators/Webots.html</a> which dictates the following:</p>
<ol>
<li><p>A description for each robot in the .wbt world file</p>
</li>
<li><p>A URDF file for each robot with the connected devices and the plugin to the robot driver</p>
</li>
<li><p>An obstacle avoider node for each robot</p>
</li>
<li><p>And a controller node for each robot specified in the launch file.</p>
</li>
</ol>
<p>I think that this last part is the source of the problem. This is the part of the launch file where I call the controller:</p>
<pre><code>ros2_supervisor_robot1 = Node(
package='webots_ros2_driver',
executable='ros2_supervisor.py',
output='screen',
additional_env={'WEBOTS_CONTROLLER_URL': controller_url_prefix() + 'Ros2Supervisor'},
name='Ros2Supervisor')
ros2_supervisor_robot2 = Node(
package='webots_ros2_driver',
executable='ros2_supervisor.py',
output='screen',
additional_env={'WEBOTS_CONTROLLER_URL': controller_url_prefix() + 'Ros2Supervisor'},
name='Ros2Supervisor2')
</code></pre>
<p>In the tutorial this launcher for the Ros2Supervisor is used:</p>
<pre><code>ros2_supervisor_robot1 = webots_ros2_driver.webots_launcher.Ros2SupervisorLauncher()
</code></pre>
<p>In both cases, the first robot works properly like in the tutorial but the second robot does not because it try as well to connect to the same Ros2Supercisor node and thus the process dies.</p>
<p>I would also like to add that in the .wbt world file, I have left the "controller" field of each robot exactly the same as in the tutorial (controller "")</p>
<p>What is it that I miss? Is there a way to fix this issue?</p>
<p>Thank you</p>
<hr />
<p><a href="https://answers.ros.org/question/413011/is-it-possible-to-spawn-and-control-2-robots-in-webots-with-ros2?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/51434/smarn/" rel="nofollow noreferrer">smarn</a> on ROS Answers with karma: 54 on 2023-03-01</p>
<p>Post score: 3</p>
|
Is it possible to spawn and control 2 robots in webots with ROS2?
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>With octomap_server, you can feed it a point cloud from the sensor and its pose through TF, it should generate the octomap on its own. There is a minimal example here:</p>
<ul>
<li>ros1: <a href="https://github.com/OctoMap/octomap_mapping/blob/kinetic-devel/octomap_server/launch/octomap_mapping.launch" rel="nofollow noreferrer">https://github.com/OctoMap/octomap_mapping/blob/kinetic-devel/octomap_server/launch/octomap_mapping.launch</a></li>
<li>ros2: <a href="https://github.com/OctoMap/octomap_mapping/blob/ros2/octomap_server/launch/octomap_mapping.launch.xml" rel="nofollow noreferrer">https://github.com/OctoMap/octomap_mapping/blob/ros2/octomap_server/launch/octomap_mapping.launch.xml</a></li>
</ul>
<p>rtabmap integrated octomap library to generate octomap topics in same format than octomap_server (they can be visualized in RVIZ with octomap rviz plugins). When using rtabmap for octomap, you don't need octomap_server. The advantage of the integration in rtabmap is that on loop closure detection, the octomap will be updated accordingly. With octomap_server, it assumes non-drifting pose or if there is a correction of the pose, it won't re-update the previous cells seen so far.</p>
<p>cheers,<br/>
Mathieu</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/20914/matlabbe/" rel="nofollow noreferrer">matlabbe</a> with karma: 6409 on 2023-03-05</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
|
103089
|
2023-03-02T09:47:26.000
|
|slam|navigation|ros2|octomap|rtabmap|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hello,</p>
<p>Both octomap and octomap_ros are available on ros 2 humble, as debian packages. But the documentation linked is for ros noetic. Making some google searches on the subject I understood that there are no step-by-step tutorials on octomap ros 1 nor ros 2 - so I tried experimenting, and got some success but I have some questions.</p>
<ol>
<li><p>Can octomap_server take pointcloud2 data directly from sensor, such as zed2i's zed2i/zed_node/depth/depth_registered topic,
or does it have to rely on another mapper such as rtabmap? Can octomap work standalone, as a replacement to rtabmap, or it needs rtabmap or some other node to run and process the point cloud. zed2i's output is sensor_msgs/msg/PointCloud2 and this is what octomap expects but, for some reason it will not publish /octomap_binary nor /octomap_full</p>
</li>
<li><p>instead of zed2i's point cloud data, I have feeded in /voxel_cloud from rtabmap, and octomap then somewhat works. there is nothing about this in the documentation</p>
</li>
<li><p>at the beginning octomap prints a warning about not being able to opening a path. in the source code:</p>
</li>
</ol>
<p>const auto filename = declare_parameter("octomap_path", "");
if (!openFile(filename)) {
RCLCPP_WARN(get_logger(), "Could not open file %s", filename.c_str());
}</p>
<p>Does octomap expect a .bt file always, or can it operate without a bt file</p>
<p>Best regards,
Can Altineller</p>
<p>[edit]</p>
<p>on further inspection, i found out that rtabmap also publishes octomap topics under /rtabmap/octomap ...
is this embedded to rtabmap now, and we use octomap to just save produced map?</p>
<hr />
<p><a href="https://answers.ros.org/question/413030/octomap_ros-on-ros-2-humble/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/26115/wintermute/" rel="nofollow noreferrer">wintermute</a> on ROS Answers with karma: 180 on 2023-03-02</p>
<p>Post score: 0</p>
|
octomap_ros on ros 2 humble
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hi!</p>
<p>To run the nodes in a virtual environment of your choice, you should change the <a href="https://en.wikipedia.org/wiki/Shebang_(Unix)" rel="nofollow noreferrer">shebang</a> (i.e. the very first line in your script which should look something like <code>#!/usr/bin/env python</code>) of your scripts so to point to the Python interpreter of the virtual environment.</p>
<p>As an example, if your virtual environment name is <code>venv</code> the first line in the script should be <code>#!/path/to/venv/bin/python3</code>. This is of course not so portable, as you are hardcoding the path in each and every script. A more flexible solution I have recently started to use is to set the virtual environment from the launch file with</p>
<pre><code> <arg name="venv" value="/path/to/venv/bin/python3" />
<node> pkg="pkg" type="node.py" name="node" launch-prefix = "$(arg venv)" />
</code></pre>
<p>so if you migrate the venv, you just have to adapt the path to the interpreter in one place (i.e. the launch file).</p>
<p>As for the</p>
<blockquote>
<p>ModuleNotFoundError: No module named "rospkg"</p>
</blockquote>
<p>you should be able to solve by simply activating your virtual environment and installing <code>rospkg</code> into it with <code>pip install rospkg</code>.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/69377/bluegiraffe-sc/" rel="nofollow noreferrer">bluegiraffe-sc</a> with karma: 221 on 2023-03-03</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 2</p>
|
103091
|
2023-03-02T15:06:28.000
|
|ros|python3|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I installed ROS noetic on my ubuntu machine using apt command. It uses root python installation (python3.8) like <code>/usr/bin/python3</code>. All ROS related python modules like <code>rospkg, rospy, cv_bridge</code> have been installed for this interpretor. Now, as I work on other big projects, I need to install many python modules and even different python versions. So, I use conda or python venv environment for that. <strong>How can I run those projects in ROS since it uses the root installation interpretor?</strong> If I activate a virtual env, the ROS node does not run and shows error like</p>
<blockquote>
<p>ModuleNotFoundError: No module named "rospkg"</p>
</blockquote>
<p>What is the best way to handle different python environments along with ROS?</p>
<hr />
<p><a href="https://answers.ros.org/question/413037/ros-with-python-virtual-environment/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/109467/zrahman/" rel="nofollow noreferrer">zrahman</a> on ROS Answers with karma: 25 on 2023-03-02</p>
<p>Post score: 0</p>
|
ROS with python virtual environment
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>After trying out various tools, I really like using PDAL for quick conversions and downsizing of your pointcloud.</p>
<p>Cloudcompare has been very helpful for almost everything else and can do most of what PDAL does. <strong>HIGHLY recommend.</strong></p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/71426/xparr45/" rel="nofollow noreferrer">xparr45</a> with karma: 13 on 2023-03-06</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
|
103093
|
2023-03-02T20:20:05.000
|
|ros|ros2|lidar|3dslam|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hello,</p>
<p>Are there open source tools you like to use for manipulating and analyzing LiDAR data (.pcd, .las, .laz)? Generally the problems I am trying to solve are related to robotics.</p>
<p>Here's a list of features I am looking for preferably also having a GUI as an interface.</p>
<ul>
<li><p>Labeling pointcloud data and their classes</p>
</li>
<li><p><a href="https://scale.com/robotics" rel="nofollow noreferrer">Scale.ai</a> (Commercial)</p>
</li>
<li><p><a href="https://segments.ai/point-cloud-labeling" rel="nofollow noreferrer">Segments.ai</a> (Commercial)</p>
</li>
<li><p><a href="https://learn.labelbox.com/labelbox-vs-scale-ai/?utm_medium=paid-search&utm_source=google&utm_campaign=Core-Competitor&utm_term=scale%20ai%20labeling&utm_device=c&_bt=649130842505&_bm=p&_bn=g&gclid=CjwKCAiAr4GgBhBFEiwAgwORre309A0HO5JX8ZmnnBbID7jRaMBW8_weNSbFf9H067moAdUosR15KRoCgc4QAvD_BwE" rel="nofollow noreferrer">Labelbox</a> (Commercial)</p>
</li>
<li><p><a href="https://github.com/ch-sa/labelCloud" rel="nofollow noreferrer">Label Cloud</a></p>
</li>
<li><p>Manually adjusting LiDAR frames/entire sections (translations, rotations) with visualization/tools. Not just applying transformations via script.</p>
</li>
<li><p>Viewing the pointcloud data and in different modes (intensity, RGB, distance, etc.)</p>
</li>
<li><p>RVIZ</p>
</li>
<li><p>pcl_viewer</p>
</li>
<li><p><a href="https://www.danielgm.net/cc/" rel="nofollow noreferrer">Cloud compare</a></p>
</li>
<li><p>Projecting LiDAR points onto an image or plane for creating 2D Vector maps</p>
</li>
<li><p><a href="https://tools.tier4.jp/feature/vector_map_builder/" rel="nofollow noreferrer">Tier IV</a></p>
</li>
<li><p>Tools to assist in auto-stitching lidar frames together to create a map</p>
</li>
<li><p>Converting between point cloud formats</p>
</li>
<li><p><a href="https://pdal.io/en/latest/" rel="nofollow noreferrer">PDAL</a></p>
</li>
<li><p>Comparing point cloud data files</p>
</li>
<li><p><a href="https://rapidlasso.com/lastools/" rel="nofollow noreferrer">LAStools</a></p>
</li>
<li><p><a href="https://www.danielgm.net/cc/" rel="nofollow noreferrer">Cloud compare</a></p>
</li>
<li><p>General filtering, outlier removal, and manipulation</p>
</li>
<li><p><a href="https://rapidlasso.com/lastools/" rel="nofollow noreferrer">LAStools</a></p>
</li>
<li><p>pcl library</p>
</li>
</ul>
<p>I'm sure I am missing other useful features and undervaluing some tools I listed above (pcl_library, LAStools, CloudCompare). I am a LiDAR newbie looking to deep dive into all that is wonderful with LiDARs and robotics!</p>
<hr />
<p><a href="https://answers.ros.org/question/413043/what-tools-do-you-like-to-use-for-lidar-point-cloud-analysis-and-manipulation?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/71426/xparr45/" rel="nofollow noreferrer">xparr45</a> on ROS Answers with karma: 13 on 2023-03-02</p>
<p>Post score: 0</p>
|
What tools do you like to use for LiDAR Point Cloud Analysis and Manipulation?
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Bullseye is not an officially supported distribution for ROS Noetic as from #q405670</p>
<p>I suggest downgrading your Raspberry Pi OS is a Debian buster.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/63046/ranjit-kathiriya/" rel="nofollow noreferrer">Ranjit Kathiriya</a> with karma: 1622 on 2023-03-10</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
|
103095
|
2023-03-03T14:57:10.000
|
|ros|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>ros can be installed on raspberry pi 4 Bullseye</p>
<hr />
<p><a href="https://answers.ros.org/question/413058/how-to-install-ros-in-raspberry-pi-4-bullseye/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/141110/carlossortiz/" rel="nofollow noreferrer">carlossortiz</a> on ROS Answers with karma: 1 on 2023-03-03</p>
<p>Post score: 0</p>
|
How to install ROS in raspberry pi 4 Bullseye
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>The issue is likely one of <em>units</em>.</p>
<p>The units of "all" ROS messages containing distance measurements are <em>metres</em> (see <a href="https://www.ros.org/reps/rep-0103.html#units" rel="nofollow noreferrer">REP 103</a>). This is also mentioned in the <a href="http://docs.ros.org/en/melodic/api/sensor_msgs/html/msg/Range.html" rel="nofollow noreferrer">sensor_msgs/Range documentation</a>.</p>
<p>The message you show has a current <code>range: 2491.0</code>, or just about 2.5 Km. Max range is set to 4 Km.</p>
<p>RViz uses metres as well.</p>
<p>The grid you see in your RViz screenshot measures 10 x 10 <em>metres</em>. Depending on zoom factors, that's about a 200 times smaller than the range currently reported by your sensor driver node. So RViz probably visualises your sensor data correctly, it's just not visible with your current view settings.</p>
<p>The solution would be to convert your sensor measurements to the correct units (being: metres). I expect everything to start working as you expect it to.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> with karma: 86574 on 2023-03-07</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/128222/dinoj/" rel="nofollow noreferrer">Dinoj</a> on 2023-03-07</strong>:<br />
Thank you very much for the info. The sensor values in the /tof2 are in mm. I will change the values to meters. I was able to visualize the sensor reading after adding a tf. But it shows a very big cone shape. I think that happened because the values are not in meters.
Once again thank you very much for your information it was really helpful.</p>
|
103097
|
2023-03-07T04:51:16.000
|
|ros|rviz|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hello, I'm trying to visualize the Time of Flight sensor data reading on Rviz.
The first image shows the echo of data received from my sensor /tof2,</p>
https://ibb.co/0DyMyjp
<p>this is the Rviz view. As you can see the sensor is properly detected under "Range" but it is not visualized in Rviz. what seems to be the issue here and how can I resolve it?
Im using ROS Noetic
<a href="https://ibb.co/MCPJqr4" rel="nofollow noreferrer">https://ibb.co/MCPJqr4</a></p>
<p>Thank you in advance!</p>
<hr />
<p><a href="https://answers.ros.org/question/413155/ir-range-sensor-data-not-visualizing-in-rviz/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/128222/dinoj/" rel="nofollow noreferrer">Dinoj</a> on ROS Answers with karma: 3 on 2023-03-07</p>
<p>Post score: 0</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-03-07</strong>:<br />
I'm sorry to have to do this for something seemingly minor, but please don't post screenshots of terminal text or source code in question on ROS Answers. It's all text, so there is no need. Just copy-paste the text from the terminal or the source into your question text. Do make sure to format it properly by selecting the text and pressing <code>ctrl+k</code> (or clicking the <em>Preformatted Text</em> button (the one with <code>101010</code> on it)).</p>
<p>You don't need to post a new question, just edit your curent one. You can use the <code>edit</code> button/link for this.</p>
<p>After you replace the screenshot with the error message itself, we can re-open your question.</p>
|
IR Range sensor data not visualizing in RViz
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Solution to spawning a robot from a URDF file into a Gazebo instance provided above. Hope it helped.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/139551/ros_engineer/" rel="nofollow noreferrer">ROS_Engineer</a> with karma: 16 on 2023-03-07</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
|
103099
|
2023-03-07T14:34:34.000
|
|ros|sdf|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>This is something I struggled with for a few hours today and I wanted to post this for posterity. If you have a URDF file and want to launch Gazebo with the robot spawned then this will get you there:</p>
<pre><code>launch_gazebo_arg = IncludeLaunchDescription(
PythonLaunchDescriptionSource([get_package_share_directory('ros_ign_gazebo'), '/launch', '/ign_gazebo.launch.py']),
launch_arguments={
'ign_args' : #Add path to World File if so desired
}.items(),
)
spawn_robot_arg = Node(
package='ros_ign_gazebo',
executable='create',
output='screen',
arguments=["-file", "<path_to_urdf>/robot.urdf"]
)
return LaunchDescription([
launch_gazebo_arg,
spawn_robot_arg
])
</code></pre>
<hr />
<p><a href="https://answers.ros.org/question/413178/spawning-a-robot-in-gazebo-using-python-launch-file/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/139551/ros_engineer/" rel="nofollow noreferrer">ROS_Engineer</a> on ROS Answers with karma: 16 on 2023-03-07</p>
<p>Post score: 0</p>
|
Spawning a Robot in Gazebo using Python Launch File
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>As far as I know Gmapping is designed for 2D occupancy grids, but your robot probably moves in 3D.</p>
<p>You need another SLAM tool to build 3D maps (e.g. octomaps), and again probably some dedicated tools to do path planning in such maps.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/11856/olivier-kermorgant/" rel="nofollow noreferrer">Olivier Kermorgant</a> with karma: 280 on 2023-03-17</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/121802/marvelousluke/" rel="nofollow noreferrer">marvelousluke</a> on 2023-04-07</strong>:<br />
Thank you so much!</p>
|
103104
|
2023-03-08T03:28:13.000
|
|ros|navigation|ros-melodic|uwsim|gmapping|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hey guys,I am trying to do path planning using UWSim + RViz.And now there's something wrong with mapping.I followed some tutorials which is implemented by Gazebo+RViz and I also get the necessary lidar data through UWSim ROSInterfaces.However the map just won't come up.
<img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/1678263648622572.png" alt="image description" /></p>
<p>Here is the tf tree of the current master:
<img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16782639896688046.png" alt="image description" /></p>
<p>Anyone know how I can fix this?Any answer would be of help!Thanks!</p>
<hr />
<p><a href="https://answers.ros.org/question/413194/could-gmapping-pkg-work-in-uwsim?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/121802/marvelousluke/" rel="nofollow noreferrer">marvelousluke</a> on ROS Answers with karma: 20 on 2023-03-08</p>
<p>Post score: 0</p>
|
could gmapping pkg work in UWSim?
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>To achieve your query, you can do a <code>lookupTransform</code> and then check the resultant (latest) transform's timestamp is in your query window.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/3/tfoote/" rel="nofollow noreferrer">tfoote</a> with karma: 58457 on 2023-03-08</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/103641/labude/" rel="nofollow noreferrer">labude</a> on 2023-03-11</strong>:<br />
That's a good idea, thanks.</p>
|
103106
|
2023-03-08T05:02:54.000
|
|ros|tf2-ros|timestamp|transform|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hello!
I want to check if the tf2_ros::Buffer received a valid transform from A to B in the last x seconds (to throw an error in case of time out). So something like <code>buffer.canTransform(A, B, ros::Time(0))</code> with an additional argument for how far in the past the transform can be.</p>
<p>Is there a way to get the timestamp of the last available transform so that I can compare it to the current time?
This sounds like a pretty common use case to me, but I could not find anything suitable.</p>
<p>Thanks a lot!</p>
<hr />
<p><a href="https://answers.ros.org/question/413199/tf-get-the-time-of-last-transform/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/103641/labude/" rel="nofollow noreferrer">labude</a> on ROS Answers with karma: 98 on 2023-03-08</p>
<p>Post score: 0</p>
|
TF get the time of last transform
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I found the fix. "file://" needs to be prefixed before the absolute path for validateURL and loadCameraInfo.
here is the updated code</p>
<pre><code>camera_info_->setCameraName("my_cam");
if (access(camera_calibration_file_param_.c_str(), F_OK) != -1)
{
if (camera_info_->validateURL("file://" + camera_calibration_file_param_))
{
camera_info_->loadCameraInfo("file://" + camera_calibration_file_param_);
}
else
{
ROS_WARN("Current Camera is Uncalibrated");
}
}
else
{
ROS_WARN("Camera Calibration file not found");
}
</code></pre>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/109848/shouvik1984/" rel="nofollow noreferrer">shouvik1984</a> with karma: 28 on 2023-03-08</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
|
103108
|
2023-03-08T07:18:02.000
|
|calibration|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Dear Experts,</p>
<p>I have been trying to use CameraInfoManager::validateURL function with the following code snippet</p>
<pre><code>camera_info_->setCameraName("my_cam");
if (access(camera_calibration_file_param_.c_str(), F_OK) != -1)
{
if (camera_info_->validateURL(camera_calibration_file_param_))
{
camera_info_->loadCameraInfo(camera_calibration_file_param_);
}
else
{
ROS_WARN("Current Camera is Uncalibrated");
}
}
else
{
ROS_WARN("Camera Calibration file not found");
}
</code></pre>
<p>I have been continuously getting <code>"Current Camera is Uncalibrated"</code> warning. The file is found but some parsing error may be. I have ensured that the EOL for the file is LF.</p>
<p>The following is the content of the calibration yaml file that is passed using <code>camera_calibration_file_param_</code> object copied verbatim from the file itself.</p>
<pre><code>image_width: 640
image_height: 480
camera_name: "my_cam"
camera_matrix:
rows: 3
cols: 3
data: [968.62926614, 0, 348.38163923, 0, 967.56611892, 252.45327611, 0, 0, 1]
distortion_model: plumb_bob
distortion_coefficients:
rows: 1
cols: 5
data: [-0.02834676, 0.00984921, -0.00135589, 0.00352077, 0.10641544]
rectification_matrix:
rows: 3
cols: 3
data: [1, 0, 0, 0, 1, 0, 0, 0, 1]
projection_matrix:
rows: 3
cols: 4
data: [491.0, 0, 233.0, 0, 0, 564.0, 97.0, 0, 0, 0, 1, 0]
</code></pre>
<p>I am unable to find the root cause of this issue. Kindly help</p>
<p>Regards
Shouvik</p>
<hr />
<p><a href="https://answers.ros.org/question/413205/validateurl-failing-even-when-a-proper-file-is-present./" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/109848/shouvik1984/" rel="nofollow noreferrer">shouvik1984</a> on ROS Answers with karma: 28 on 2023-03-08</p>
<p>Post score: 0</p>
|
validateURL failing even when a proper file is present
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<blockquote>
<p><link_n_box name="base_link" origin_rpy="0 0 0" origin_xyz="0 0 0" size="1 1 1" /></p>
</blockquote>
<p>You are not using the correct synax to create an instance of a macro. The correct way is:</p>
<pre><code><xacro:link_n_box name=... />
</code></pre>
<p>Edit: I think this syntax change happened quite a few years ago.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> with karma: 4903 on 2023-03-10</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/141452/jaeeunkim/" rel="nofollow noreferrer">jaeeunkim</a> on 2023-03-12</strong>:<br />
It was a very basic part. Thank you. That was the best answer. Thank you very much.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</p>
|
103110
|
2023-03-10T06:50:28.000
|
|ros|xacro|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hello, everyone!</p>
<p>An error occurred while configuring the robot arm as an xacro file.
The current simple model looks like this:</p>
<pre><code><?xml version="1.0" ?>
<robot name="manipulator" xmlns:xacro="http://www.ros.org/wiki/xacro">
<!-- Begin include -->
<xacro:include filename="$(find manipulator_description)/urdf/links_joints.xacro" />
<!-- END include -->
<!--Begin robot description -->
<link_n_box name="base_link"
origin_rpy="0 0 0" origin_xyz="0 0 0"
size="1 1 1" />
<joint name="joint_01" type="revolute">
<axis xyz="0 1 0"/>
<limit effort="1000.0" lower="-3.14" upper="3.14" velocity="0.5"/>
<origin rpy="0 0 0" xyz="0 0 0.5"/>
<parent link="base_link"/>
<child link="link_01"/>
</joint>
<link name="link_01">
<visual>
<origin rpy="0 0 0" xyz="0 0 0.2" />
<geometry>
<cylinder radius="0.35" length="0.4"/>
</geometry>
</visual>
</link>
<joint name="joint_02" type="revolute">
<axis xyz="0 1 0"/>
<limit effort="1000.0" lower="-3.14" upper="3.14" velocity="0.5"/>
<origin rpy="0 0 0" xyz="0 0 0.4"/>
<parent link="link_01"/>
<child link="link_02"/>
</joint>
<link name="link_02">
<visual>
<origin rpy="0 0 0" xyz="0 0 0.4" />
<geometry>
<cylinder radius="0.15" length="0.8"/>
</geometry>
</visual>
</link>
<joint name="joint_03" type="revolute">
<axis xyz="0 1 0"/>
<limit effort="1000.0" lower="-3.14" upper="3.14" velocity="0.5"/>
<origin rpy="0 0 0" xyz="0 0 0.8"/>
<parent link="link_02"/>
<child link="link_03"/>
</joint>
<link name="link_03">
<visual>
<origin rpy="0 0 0" xyz="0 0 0.4" />
<geometry>
<cylinder radius="0.15" length="0.8"/>
</geometry>
</visual>
</link>
<joint name="joint_04" type="revolute">
<axis xyz="0 1 0"/>
<limit effort="1000.0" lower="-3.14" upper="3.14" velocity="0.5"/>
<origin rpy="0 0 0" xyz="0 0 0.8"/>
<parent link="link_03"/>
<child link="link_04"/>
</joint>
<link name="link_04">
<visual>
<origin rpy="0 0 0" xyz="0 0 0.4" />
<geometry>
<cylinder radius="0.15" length="0.8"/>
</geometry>
</visual>
</link>
<joint name="joint_05" type="revolute">
<axis xyz="0 0 1"/>
<limit effort="1000.0" lower="-3.14" upper="3.14" velocity="0.5"/>
<origin rpy="0 0 0" xyz="0 0 0.8"/>
<parent link="link_04"/>
<child link="link_05"/>
</joint>
<link name="link_05">
<visual>
<origin rpy="0 0 0" xyz="0 0 0.125" />
<geometry>
<cylinder radius="0.15" length="0.25"/>
</geometry>
</visual>
</link>
<!--END robot description -->
</robot>
</code></pre>
<p>The macro files to be linked are as follows:</p>
<pre><code><?xml version="1.0" ?>
<robot name="manipulator" xmlns:xacro="http://www.ros.org/wiki/xacro">
<xacro:macro name="link_n_box" params="name origin_rpy origin_xyz size">
<link name="<span class="math-container">${name}">
<visual>
<origin rpy="$</span>{origin_rpy}" xyz="<span class="math-container">${origin_xyz}" />
<geometry>
<box size="$</span>{size}" />
</geometry>
</visual>
</link>
</xacro:macro>
<xacro:macro name="joint_n" params="name type axis_xyz origin_rpy origin_xyz parent child">
<joint name="<span class="math-container">${name}" type="$</span>{type}">
<axis xyz="<span class="math-container">${axis_xyz}" />
<limit effort="1000.0" lower="-3.14" upper="3.14" velocity="0.5" />
<origin rpy="$</span>{origin_rpy}" xyz="<span class="math-container">${origin_xyz}" />
<parent link="$</span>{parent}" />
<child link="${child}" />
</joint>
</xacro:macro>
<xacro:macro name="link_n_cylinder" params="name origin_xyz origin_rpy radius length">
<link name="<span class="math-container">${name}">
<visual>
<origin rpy="$</span>{origin_rpy}" xyz="<span class="math-container">${origin_xyz}" />
<geometry>
<cylinder radius="$</span>{radius}" length="${length}" />
</geometry>
</visual>
</link>
</xacro:macro>
</robot>
</code></pre>
<p>This is the launch file used for this.</p>
<pre><code> <!-- arg setting -->
<arg name="model" default="<span class="math-container">$(find robot_arm_description)/urdf/robot_arm.xacro"/>
<arg name="gui" default="true"/>
<arg name="rvizconfig" default="$</span>(find robot_arm_description)/launch/config.rviz"/>
<!-- select model -->
<param name="robot_description" command="<span class="math-container">$(find xacro)/xacro $</span>(arg model)"/>
<!-- Combine joint values -->
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"/>
<!-- Show in Rviz -->
<node name="rviz" pkg="rviz" type="rviz"/>
<!-- send joint values-->
<node name="joint_state_publisher_gui" pkg="joint_state_publisher_gui" type="joint_state_publisher_gui">
</node>
</launch>
</code></pre>
<p>Problems arising from robots are invisible in the rviz environment. That is, the interworking of xacro is considered a problem.</p>
<p>If the file is used without interworking, it works normally. As a result, only the base_link is in the macro state as soon as it is linked with the xacro file, this xacro file. What am I doing wrong now?</p>
<p>The example I am referring to now is this.
<a href="https://www.youtube.com/watch?v=2lfwBpH-Ty8&t=492s" rel="nofollow noreferrer">https://www.youtube.com/watch?v=2lfwBpH-Ty8&t=492s</a> "The Construct"</p>
<p>Help me.</p>
<hr />
<p><a href="https://answers.ros.org/question/413303/the-xacro-files-don%27t-seem-to-work-with-each-other.-(ubuntu-20.04-noetic)-r/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/141452/jaeeunkim/" rel="nofollow noreferrer">jaeeunkim</a> on ROS Answers with karma: 3 on 2023-03-10</p>
<p>Post score: 0</p>
|
The xacro files don't seem to work with each other. (ubuntu 20.04 noetic) R
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>You appear to be looking at the wrong overload.</p>
<p>The <code>subscribe(..)</code> call you show is the one for <em>member functions</em>, and the last argument is the <em>object</em> (not the class) on which the member function is defined (or: the instance of the class to pass to the member function when it is invoked).</p>
<p>As the subscriber is created for the current object, that reference would be <code>this</code>.</p>
<p>If it was some other object, it would not be <code>this</code>, but the name of the variable referring the object.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> with karma: 86574 on 2023-03-10</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 2</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/91591/robotguy/" rel="nofollow noreferrer">robotguy</a> on 2023-03-10</strong>:<br />
Ok thank you for the clarification! And can you please tell me what does this argument add compared to a call to subscribe() without the fourth argument? Is it an "insurance" as I wrote in my question?</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-03-11</strong>:<br />
@robotguy No, not insurance. Calling the method of a class requires an actual object (instance of the class), and the 4th argument provides that. For your example, ros will call <code>this->imuCallback(...)</code>.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/91591/robotguy/" rel="nofollow noreferrer">robotguy</a> on 2023-03-11</strong>:<br />
Oh ok. I just realized with your comment that it's the equivalent of the <code>self</code> in python OOP. Somehow it didn't seem obvious at first but now, it is clear. Thank you guys!</p>
|
103112
|
2023-03-10T09:19:24.000
|
|ros|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hi everyone,</p>
<p>I found some code which is using 4 arguments to define a subscriber, such as in the following code:</p>
<pre><code>#include "ros/ros.h"
#include <stdio.h>
#include <stdlib.h>
#include <sensor_msgs/Imu.h>
#include <vector>
#include <string>
using namespace std;
class ClassFoo
{
public:
ClassFoo(string rname){
guest_name = rname;
imu_sub = nm.subscribe("/imu", 1, &ClassFoo::imuCallback, this);
}
void imuCallback(const sensor_msgs::Imu & msg)
{
lowState.imu.quaternion[0] = msg.orientation.w;
lowState.imu.quaternion[1] = msg.orientation.x;
lowState.imu.quaternion[2] = msg.orientation.y;
lowState.imu.quaternion[3] = msg.orientation.z;
lowState.imu.gyroscope[0] = msg.angular_velocity.x;
lowState.imu.gyroscope[1] = msg.angular_velocity.y;
lowState.imu.gyroscope[2] = msg.angular_velocity.z;
lowState.imu.accelerometer[0] = msg.linear_acceleration.x;
lowState.imu.accelerometer[1] = msg.linear_acceleration.y;
lowState.imu.accelerometer[2] = msg.linear_acceleration.z;
}
private:
ros::NodeHandle nm;
ros::Subscriber imu_sub;
string guest_name;
};
int main(int argc, char **argv)
{
ros::init(argc, argv, "node_test");
string guest_name;
ros::param::get("/guest_name", guest_name);
ClassFoo listen_publish_obj(guest_name);
ros::AsyncSpinner spinner(1); // one threads
spinner.start();
usleep(1000000); // must wait 1s
ros::NodeHandle n;
while (ros::ok()){
// Do something
cout << "I did nothing!" << endl;
}
return 0;
}
</code></pre>
<p>The part I do not understand is the line: <code>imu_sub = nm.subscribe("/imu", 1, &ClassFoo::imuCallback, this);</code> : what is the fourth argument for? I know it's a pointer to the class ClassFoo, but I do not get what the purpose of this argument is. When I go to the <a href="https://docs.ros.org/en/api/roscpp/html/classros_1_1NodeHandle.html#a4949b10581fa875a2b55af93ced811ec" rel="nofollow noreferrer">documentation</a> , it says:</p>
<blockquote>
<p><code>\param tracked_object</code> A shared
pointer to an object to track for
these callbacks. If set, the a
<code>weak_ptr</code> will be created to this
object, and if the reference count
goes to 0 the subscriber callbacks
will not get called. Note that
setting this will cause a new
reference to be added to the object
before the callback, and for it to go
out of scope (and potentially be
deleted) in the code path (and
therefore thread) that the callback
is invoked from.</p>
</blockquote>
<p>So does it mean that the fourth argument is some sort of "insurance" that if the ClassFoo object dies for any reason, the callback is not called? But if the object dies, the callback would be dead anyway, no?</p>
<p>Thank you in advance!</p>
<hr />
<p><a href="https://answers.ros.org/question/413311/fourth-argument-when-defining-a-subscriber/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/91591/robotguy/" rel="nofollow noreferrer">robotguy</a> on ROS Answers with karma: 13 on 2023-03-10</p>
<p>Post score: 1</p>
|
Fourth argument when defining a subscriber
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Solved. not displayed "Planning Scene" in RViz2.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/133389/jaye/" rel="nofollow noreferrer">Jaye</a> with karma: 16 on 2023-03-12</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
|
103114
|
2023-03-12T22:25:07.000
|
|ros2|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hello, everyone.</p>
<p>I want to add the BOX in the world, and added the box(by getKnownObjectNames())
But, they are invisible, so I can see they fron RViz2.</p>
<ul>
<li>Ubuntu 22.04.2 LTS</li>
<li>ROS2 Humble</li>
</ul>
<p>Mesh files from xacro/stl is visible... I cannot understand why BOX is invisible.</p>
<pre><code>moveit_msgs::msg::CollisionObject obj;
obj.header.frame_id = mg->getPlanningFrame();
obj.id = "BOX";
shape_msgs::msg::SolidPrimitive prim;
prim.type = shape_msgs::msg::SolidPrimitive::BOX;
prim.dimensions = {2.0, 2.0, 2.0};
geometry_msgs::msg::Pose pose;
pose.position.x = -2.0;
pose.position.y = -2.0;
pose.position.z = -2.0;
pose.orientation.w = 1.0;
obj.primitives.push_back(prim);
obj.primitive_poses.push_back(pose);
obj.operation = moveit_msgs::msg::CollisionObject::ADD;
moveit::planning_interface::PlanningSceneInterface ps;
ps.applyCollisionObject(obj);
</code></pre>
<hr />
<p><a href="https://answers.ros.org/question/413363/invisible-collision-ocject/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/133389/jaye/" rel="nofollow noreferrer">Jaye</a> on ROS Answers with karma: 16 on 2023-03-12</p>
<p>Post score: 0</p>
|
Invisible Collision Ocject
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Sounds like a very reasonable potential contribution to change the behavior. However, its hard to then define when "done" is "done" without causing the exact same oscillation issues as you describe for setting very low tolerances. Basically: we would need a proposal for a metric for how to say, after we're within the tolerance, when we're completed to a satisfactory refined level.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/25940/stevemacenski/" rel="nofollow noreferrer">stevemacenski</a> with karma: 8272 on 2023-03-14</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
|
103116
|
2023-03-14T04:24:08.000
|
|ros2|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>When I provide a goal pose to the nav2 system on my robot, it tries it best to get within the goal tolerance of the goal, then stops. I find this behavior to be unintuitive: i should expect that the robot tries its best to get to the actual goal, then accept any result within the tolerance, but instead, it goes to the edge of the tolerance and is happy with that result. This means that if I give an xy tolerance of 1.0, it will always stop 1.0 meters from the goal. But then, if I set the xy goal tolerance too small, it oscillates around the target. Is this the intended behavior? How do I tell the nav2 system to generate a path to EXACTLY the goal, not just to any point within the tolerance? Using the pure pursuit controller if it makes a difference.</p>
<hr />
<p><a href="https://answers.ros.org/question/413400/nav2:-go-exactly-to-this-point,-not-approximately/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/79869/per-edwardsson/" rel="nofollow noreferrer">Per Edwardsson</a> on ROS Answers with karma: 501 on 2023-03-14</p>
<p>Post score: 0</p>
|
nav2: go exactly to this point, not approximately
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>If you only need to specify the order, then launch will already respect the order you specify nodes in. But if you need to have node1 wait for until nodes 2, 3, and 4 are present and running then read on.</p>
<p>I'm not sure exactly what criteria you have for "when a node starts", so I'm just going to use the built-in events. If you require more specific start-up conditions, you may have to write your own event, event handler, and event emitter.</p>
<p>Here's my python launch script to have node1 started only after nodes 2, 3, and 4 have been started. In this example "started" means that launch has processed that action, and the <code>ProcessStarted</code> event has been emitted.</p>
<pre><code>from rclpy.node import Node
from launch import LaunchContext, LaunchDescription, LaunchService
from launch.actions import RegisterEventHandler
from launch.events.process import ProcessStarted
from launch.event_handlers.on_process_start import OnProcessStart
from launch_ros.actions import Node
def generate_launch_description():
node1 = Node(package='demo_nodes_cpp',
executable='talker',
name='node1',
exec_name='node1')
node2 = Node(package='demo_nodes_cpp',
executable='listener',
name='node2',
exec_name='node2')
node3 = Node(package='demo_nodes_cpp',
executable='listener',
name='node3',
exec_name='node3')
node4 = Node(package='demo_nodes_cpp',
executable='listener',
name='node4',
exec_name='node4')
already_started_nodes = set()
def start_next_node(event: ProcessStarted, context: LaunchContext):
print(f'node {event.process_name} started.')
already_started_nodes.update([event.process_name])
if len(already_started_nodes) == 3:
print(f'all required nodes are up, time to start node1')
return node1
return LaunchDescription([
RegisterEventHandler(event_handler=OnProcessStart(target_action=node2,
on_start=start_next_node)),
RegisterEventHandler(event_handler=OnProcessStart(target_action=node3,
on_start=start_next_node)),
RegisterEventHandler(event_handler=OnProcessStart(target_action=node4,
on_start=start_next_node)),
node2,
node3,
node4,
])
if __name__ == '__main__':
ls = LaunchService()
ls.include_launch_description(generate_launch_description())
ls.run()
</code></pre>
<p>The three <code>RegisterEventHandler</code> actions will call <code>start_next_node</code> after the specific node has been started. Once three nodes have already been started, then we'll start node1. We could do something to look at which node actually was started, So if we needed node3 to wait until node2 to start, and node 4 to wait for node3 to start, we could do that kind of logic there.</p>
<p>Example output:</p>
<pre><code>[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [node2-1]: process started with pid [5499]
[INFO] [node3-2]: process started with pid [5500]
[INFO] [node4-3]: process started with pid [5501]
node node2-1 started.
node node3-2 started.
node node4-3 started.
all required nodes are up, time to start node1
[INFO] [node1-4]: process started with pid [5502]
[node1-4] [INFO] [1679095729.989045466] [node1]: Publishing: 'Hello World: 1'
[node4-3] [INFO] [1679095729.990325048] [node4]: I heard: [Hello World: 1]
[node3-2] [INFO] [1679095729.990340845] [node3]: I heard: [Hello World: 1]
[node2-1] [INFO] [1679095729.990431971] [node2]: I heard: [Hello World: 1]
[node1-4] [INFO] [1679095730.988866943] [node1]: Publishing: 'Hello World: 2'
[node3-2] [INFO] [1679095730.989625772] [node3]: I heard: [Hello World: 2]
[node4-3] [INFO] [1679095730.989626316] [node4]: I heard: [Hello World: 2]
[node2-1] [INFO] [1679095730.989626457] [node2]: I heard: [Hello World: 2]
</code></pre>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/30013/chuiv/" rel="nofollow noreferrer">ChuiV</a> with karma: 1046 on 2023-03-17</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/39584/tinyturtle/" rel="nofollow noreferrer">TinyTurtle</a> on 2023-03-20</strong>:<br />
Thanks a lot @ChuiV this is exactly what I was looking for!!!</p>
|
103118
|
2023-03-14T05:01:19.000
|
|ros2|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hi,</p>
<p>I would like know, if there is a way to launch set of ros2 nodes in specific order using launch.py file
Say, I have following ros2 nodes; node_1, node_2, node_3 and node_4.
I would like launch node_1 only after node_2, node_3 and node_4 are launched.</p>
<p>Any example or code snippets are highly appreciated!!</p>
<hr />
<p><a href="https://answers.ros.org/question/413401/ros2-launch-nodes-in-a-specific-order/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/39584/tinyturtle/" rel="nofollow noreferrer">TinyTurtle</a> on ROS Answers with karma: 25 on 2023-03-14</p>
<p>Post score: 0</p>
|
Ros2 launch nodes in a specific order
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>The problem is likely this:</p>
<blockquote>
<pre><code>class BlobDetectNodelet : public nodelet::Nodelet {
</code></pre>
</blockquote>
<pre><code> public:
BlobDetectNodelet(const std::string& cameraName) : nodelet::Nodelet(){}
...
</code></pre>
<p>With a nodelet, the constructor of your class is not allowed to have any arguments.</p>
<p>Think about it: nodelets are loaded as plugins, and the loader / registration code (ie: <code>PLUGINLIB_EXPORT_CLASS(..)</code>) is generic (ie: it must be able to load <em>all</em> subclasses of <code>nodelet::Nodelet</code>, not just yours). How would the generic loader code "know" what arguments to supply for your specific subclass?</p>
<p>The compiler error is pretty clear about it (clear as in: it tells you what the problem it encounters is, not what the root cause is):</p>
<blockquote>
<pre><code>/opt/ros/noetic/include/class_loader/meta_object.hpp:198:12: error: no matching function for call to ‘blob_detect::BlobDetectNodelet::BlobDetectNodelet()’
</code></pre>
</blockquote>
<pre><code> 198 | return new C;
| ^~~~~
</code></pre>
<p>this basically says: "I tried instantiating <code>BlobDetectNodelet</code> using a zero-argument ctor, as I am instructed to do by the code underlying <code>PLUGINLIB_EXPORT_CLASS(..)</code>, but there is no such ctor, so I'm giving up".</p>
<p>The idea for nodelets is to read in their "ROS parameters" (and do everything else needed to initialise the nodelet) when the <code>nodelet::onInit(..)</code> method is called. If you need a "camera name" parameter, <code>onInit(..)</code> would be the place to retrieve it from the parameter server.</p>
<p>I would expect things to work if you remove the <code>const std::string& cameraName</code> argument from the ctor.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> with karma: 86574 on 2023-03-15</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
|
103120
|
2023-03-14T13:46:29.000
|
|ros|c++|rosnode|nodelet|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I am writing a ROS nodelet in which I have a GetInstance() method. I am trying to parse a string argument and it's throwing me the error. Can someone point out how this error can be fixed?? Any help is appreciated.</p>
<p>Following is the build error -</p>
<pre><code>In file included from /opt/ros/noetic/include/class_loader/class_loader_core.hpp:45,
from /opt/ros/noetic/include/class_loader/class_loader.hpp:46,
from /opt/ros/noetic/include/pluginlib/./class_list_macros.hpp:40,
from /opt/ros/noetic/include/pluginlib/class_list_macros.h:35,
from /home/robo/test_ws/src/blob_detect/src/blob_detect/blob_detect_nodelet.cpp:3:
/opt/ros/noetic/include/class_loader/meta_object.hpp: In instantiation of ‘B* class_loader::impl::MetaObject<C, B>::create() const [with C = blob_detect::BlobDetectNodelet; B = nodelet::Nodelet]’:
/opt/ros/noetic/include/class_loader/meta_object.hpp:196:7: required from here
/opt/ros/noetic/include/class_loader/meta_object.hpp:198:12: error: no matching function for call to ‘blob_detect::BlobDetectNodelet::BlobDetectNodelet()’
198 | return new C;
| ^~~~~
In file included from /home/robo/test_ws/src/blob_detect/src/blob_detect/blob_detect_nodelet.cpp:1:
/home/robo/test_ws/src/blob_detect/include/blob_detect/blob_detect_nodelet.h:22:3: note: candidate: ‘blob_detect::BlobDetectNodelet::BlobDetectNodelet(const string&)’
22 | BlobDetectNodelet(const std::string& cameraName) : nodelet::Nodelet() {}
| ^~~~~~~~~~~~~~~~~~~~~~
/home/robo/test_ws/src/blob_detect/include/blob_detect/blob_detect_nodelet.h:22:3: note: candidate expects 1 argument, 0 provided
make[2]: *** [CMakeFiles/blob_detect.dir/build.make:63: CMakeFiles/blob_detect.dir/src/blob_detect/blob_detect_nodelet.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:183: CMakeFiles/blob_detect.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
</code></pre>
<p>My blob_detect_nodelet.h file looks like the following -</p>
<pre><code>#ifndef BLOB_DETECT_NODELET_H
#define BLOB_DETECT_NODELET_H
#include <cv_bridge/cv_bridge.h>
#include <ros/ros.h>
#include <sensor_msgs/Image.h>
#include <sensor_msgs/RegionOfInterest.h>
#include <sensor_msgs/image_encodings.h>
#include <boost/geometry.hpp>
#include <boost/range/irange.hpp>
#include <opencv2/opencv.hpp>
#include "nodelet/nodelet.h"
namespace blob_detect {
class BlobDetectNodelet : public nodelet::Nodelet {
public:
BlobDetectNodelet(const std::string& cameraName) : nodelet::Nodelet(){}
static BlobDetectNodelet& GetInstance(const std::string& cameraName = "");
inline const cv::Mat GetCurrentImage(void) const { return currentImage; }
inline void SetCurrentImage(const cv::Mat& image) { currentImage = image; }
private:
void onInit() override;
void imageCb(const sensor_msgs::Image::ConstPtr& msg);
ros::NodeHandle nh;
ros::NodeHandle private_nh;
ros::Subscriber imageSub;
ros::Publisher roiImagePub;
const std::string cameraName;
cv::Mat currentImage;
</code></pre>
<p>}</p>
<p>And following is my blob_detect_nodelet.cpp file -</p>
<pre><code>#include <blob_detect/blob_detect_nodelet.h>
#include "pluginlib/class_list_macros.h"
namespace blob_detect {
void BlobDetectNodelet::onInit() {
nh = getNodeHandle();
private_nh = getPrivateNodeHandle();
roiImagePub = nh.advertise<sensor_msgs::Image>("/camera_1/output_image", 100);
imageSub = nh.subscribe("/camera_1/image_raw", 10, &BlobDetectNodelet::imageCb, this);
}
BlobDetectNodelet& BlobDetectNodelet::getInstance(const std::string& cameraName) {
static BlobDetectNodelet instance(cameraName);
return instance;
}
void BlobDetectNodelet::imageCb(const sensor_msgs::Image::ConstPtr& image) {
cv_bridge::CvImageConstPtr cv_image = cv_bridge::toCvShare(image, "mono8");
}
} // namespace blob_detect
PLUGINLIB_EXPORT_CLASS(blob_detect::BlobDetectNodelet, nodelet::Nodelet);
</code></pre>
<hr />
<p><a href="https://answers.ros.org/question/413420/nodelet:-can%27t-add-argument-to-constructor/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/27502/robo_ninja/" rel="nofollow noreferrer">robo_ninja</a> on ROS Answers with karma: 55 on 2023-03-14</p>
<p>Post score: 0</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-03-15</strong>:<br />
I'm unsure where the <code>getInstance(..)</code> method in your nodelet comes from. That's not something required by <code>Nodelet</code>'s contract.</p>
<hr />
<p>Edit: I've updated the title of your question, as "getInstance()" is not something that's known in the context of nodelets. What you really try to be doing is adding an argument to your ctor.</p>
|
nodelet: can't add argument to constructor
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>If I'm understanding your question properly, you saying that your vision system isn't properly detecting the person vs the obstacle properly so the goal pose isn't good? If so, that has nothing to do with Nav2, that's on your vision system to send the right goal to the stack. You need to fix the vision system - it seem that Nav2 is fine.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/25940/stevemacenski/" rel="nofollow noreferrer">stevemacenski</a> with karma: 8272 on 2023-03-15</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/111543/mirakim/" rel="nofollow noreferrer">mirakim</a> on 2023-03-16</strong>:<br />
thank you for the answer! Yes you are right. I had no choice but to lower the fps of the vision module, so the path kept changing as the location of the target on the camera frame kept changing. Then, I want to ask one more question, if the path keeps changing as above and if I want to slow down the degree of change, should I change the frequency of the planner, which acts as a global planner?</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/25940/stevemacenski/" rel="nofollow noreferrer">stevemacenski</a> on 2023-03-16</strong>:<br />
Yes, or modify the behavior tree to do event-based replanning instead of regular frequency replanning. There are example BTs of that in the stack already, but may obviously be further customized for your application.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/111543/mirakim/" rel="nofollow noreferrer">mirakim</a> on 2023-03-17</strong>:<br />
Thank you for your comments! I find the behavior tree examples in the navigation2 stack! Hope you have a good day :)</p>
|
103122
|
2023-03-15T20:27:07.000
|
|navigation|ros2|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hello, I am newbie in ROS using quadruped robot.</p>
<p>I use Unitree A1 and ROS2 navigation package for human tracking in isaac sim simulator.</p>
<p>An obstacle is placed between the robot and the person, and the robot uses a vision module to try to detect the person's location and its depth information using RGBD camera.</p>
<p>When there are no obstacles, the A1 uses the vision module to recognize the location and depth of the target and follow it well.</p>
<p>However, when there is an obstacle between A1 and a person, A1 initially recognizes the location and depth of the target using the vision module and tries to follow it well, but when A1 turns, the target pose bounces in a strange direction.</p>
<p>In this case, how can I solve this problem?</p>
<p><a href="https://drive.google.com/file/d/1qbtITkpc03clMA9UUpDoMgobglDByb5v/view?usp=share_link" rel="nofollow noreferrer">A1 navigation fail</a></p>
<p>Above is the link to the captured video, since I couldn't find a way to upload a video directly to a post.</p>
<p>Thank you!</p>
<hr />
<p><a href="https://answers.ros.org/question/413459/target-goal-pose-is-not-stable-when-using-navigation2/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/111543/mirakim/" rel="nofollow noreferrer">mirakim</a> on ROS Answers with karma: 21 on 2023-03-15</p>
<p>Post score: 0</p>
|
target goal pose is not stable when using navigation2
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I find a workaround using <code>asyncio.ensure_future</code> as follows:</p>
<pre><code>class TestNode(Node):
def __init__(self) -> None:
Node.__init__(
self,
"test_node",
)
self.callback_group = ReentrantCallbackGroup()
self._sub = self.create_subscription(
topic="test",
msg_type=Empty,
callback=self.cb_test,
qos_profile=5,
callback_group=self.callback_group,
)
self.client = self.create_client(
ListParameters,
"/test_node/list_parameters",
callback_group=MutuallyExclusiveCallbackGroup(),
)
def cb_test(self, msg: Empty) -> None:
# Schedule the async function and add it to the node's callback group.
asyncio.ensure_future(self.async_cb_test(msg))
async def async_cb_test(self, msg: Empty) -> None:
service_request = ListParameters.Request()
srv_future = self.client.call_async(service_request)
try:
result = await asyncio.wait_for(srv_future, timeout=10.0)
except Exception as e:
self.get_logger().error(f"Service call failed! what(): {str(e)}")
else:
self.get_logger().info(f"Service call success! what(): {str(result)}")
async def spin(executor: SingleThreadedExecutor):
while rclpy.ok():
executor.spin_once()
# Setting the delay to 0 provides an optimized path to allow other tasks to run.
await asyncio.sleep(0)
def main(args=None):
rclpy.init(args=args)
node = TestNode()
executor = SingleThreadedExecutor()
executor.add_node(node)
loop = asyncio.get_event_loop()
loop.run_until_complete(spin(executor))
node.destroy_node()
rclpy.shutdown()
</code></pre>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/64524/charlie92/" rel="nofollow noreferrer">charlie92</a> with karma: 87 on 2023-03-17</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
|
103124
|
2023-03-16T18:08:34.000
|
|ros|python|ros2|callbacks|rclpy|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hi! I am trying to use the asyncio syntax to await for a service to complete inside a callback function of a Node. A dummy node to test this:</p>
<pre><code>#!/usr/bin/env python3
import rclpy
from rclpy.callback_groups import ReentrantCallbackGroup
from rclpy.executors import SingleThreadedExecutor
from rclpy.node import Node
from std_msgs.msg import Empty
from rcl_interfaces.srv import ListParameters
import asyncio
class TestNode(Node):
def __init__(self) -> None:
Node.__init__(
self,
"test_node",
)
self.callback_group = ReentrantCallbackGroup()
self._sub = self.create_subscription(
topic="test",
msg_type=Empty,
callback=self.cb_test,
qos_profile=5,
callback_group=self.callback_group,
)
self.client = self.create_client(
ListParameters,
"/test_node/list_parameters"
)
async def cb_test(self, msg: Empty) -> None:
service_request = ListParameters.Request()
srv_future = self.client.call_async(service_request)
try:
# result = await asyncio.wait_for(srv_future, timeout=10.0)
result = await srv_future
except Exception as e:
self.get_logger().error(f"Service call failed! what(): {str(e)}")
else:
self.get_logger().info(f"Service call success! what(): {str(result)}")
def main(args=None):
rclpy.init(args=args)
node = TestNode()
executor = SingleThreadedExecutor()
rclpy.spin(node, executor)
node.destroy_node()
rclpy.try_shutdown()
if __name__ == "__main__":
main()
</code></pre>
<p>You can test it with</p>
<pre><code>ros2 topic pub -1 /test std_msgs/msg/Empty {}
</code></pre>
<p>That code works just fine. The callback function doesn't block any other callback functions and it returns the result of the service. Now If I want to add a timeout to that future with <code>asyncio.wait_for(future, timeout=10.0)</code> it fails with:</p>
<pre><code>[ERROR][1679007966.209838027][test_node]: Service call failed! what(): no running event loop
</code></pre>
<p>I tried everything, spawning a new event_loop in a separate thread, calling <code>event_loop.run_forever</code> in the main thread, and spawning the <code>rclpy.spin</code> in a thread. Nothing works.</p>
<p>I tried this alternative approach:</p>
<pre><code> # ... another method from the previous code
def run(self):
self.event_loop = asyncio.get_event_loop()
# this task will run forever to process ROS node events
async def rosloop():
while rclpy.ok():
rclpy.spin_once(self, timeout_sec=0)
await asyncio.sleep(0.01)
# perform main event loop processing
try:
asyncio.ensure_future(rosloop())
self.event_loop.run_forever()
except KeyboardInterrupt:
pass
finally:
self.event_loop.close()
self.event_loop = None
def main(args=None):
rclpy.init(args=args)
node = TestNode()
node.run()
rclpy.try_shutdown()
</code></pre>
<p>Now I get the error:</p>
<pre><code>[ERROR][1679008951.750327026][test_node]: Service call failed! what(): await wasn't used with future
</code></pre>
<p>Does anyone know how to handle this? Any asyncio and rclpy expert for advice? I want to stick with a Singlethreaded executor</p>
<p>[UPDATE] PD: If I use the <a href="https://github.com/aio-libs/async-timeout" rel="nofollow noreferrer">async_timeout</a> package and the alternative approach for spinning the node it works, but I still don't want to depend on an external package</p>
<hr />
<p><a href="https://answers.ros.org/question/413482/%5Bros2%5D-asyncio-await-with-timeout-a-service-call-in-a-callback/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/64524/charlie92/" rel="nofollow noreferrer">charlie92</a> on ROS Answers with karma: 87 on 2023-03-16</p>
<p>Post score: 1</p>
|
[ROS2] asyncio await with timeout a service call in a callback
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I got it working and prepared an example on <a href="https://github.com/tuw-robotics/ros2_cyclonedds_wireguard" rel="nofollow noreferrer">github</a></p>
<p>Using Eclipse Cyclone DDS, but one has to set some variables</p>
<pre><code>export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
export CYCLONEDDS_URI=file:///$(pwd)/cyclonedds.xml
</code></pre>
<p>and the cyclonedds.xml looks like:</p>
<pre><code><?xml version="1.0" encoding="UTF-8" ?>
<CycloneDDS xmlns="https://cdds.io/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://cdds.io/config https://raw.githubusercontent.com/eclipse-cyclonedds/cyclonedds/master/etc/cyclonedds.xsd">
<Domain id="any">
<General>
<Interfaces>
<NetworkInterface name="wg0"/>
</Interfaces>
</General>
<Discovery>
<Peers>
<Peer address="192.168.33.80"/>
<Peer address="192.168.33.51"/>
</Peers>
<ParticipantIndex>auto</ParticipantIndex>
</Discovery>
</Domain>
</CycloneDDS>
</code></pre>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/390/markus-bader/" rel="nofollow noreferrer">Markus Bader</a> with karma: 847 on 2023-03-17</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 2</p>
|
103126
|
2023-03-17T10:41:17.000
|
|ros2|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hi</p>
<p>I like to connect ROS2 nodes via a wireguard vpn network. Is this possible?</p>
<hr />
<p><a href="https://answers.ros.org/question/413513/is-it-possible-to-run-ros2-via-wireguard/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/390/markus-bader/" rel="nofollow noreferrer">Markus Bader</a> on ROS Answers with karma: 847 on 2023-03-17</p>
<p>Post score: 1</p>
|
Is it possible to run ROS2 via wireguard
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p><strong>Update #3</strong> in the original post is a bandaid solution for the delays in <code>roscore</code> and <code>roslaunch</code>.</p>
<p><strong>Update #4</strong> highlights the underlying issue with <code>nofile</code> ulimits within a docker container. To override the values docker passes to containers for nofile soft and hard limits perform one of the following:</p>
<p><code>docker run ... --ulimit nofile=1024:524288</code></p>
<p>If you want this for all containers consider adding:</p>
<pre><code>"default-ulimits": {
"nofile": {
"Name": "nofile",
"Hard": 524288,
"Soft": 1024
}
}
</code></pre>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/64471/danambrosio/" rel="nofollow noreferrer">danambrosio</a> with karma: 106 on 2023-03-25</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 2</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/5234/ruffsl/" rel="nofollow noreferrer">ruffsl</a> on 2023-04-07</strong>:<br />
Wow, what a deep rabbit hole! Congrats on finding the root cause. That containerd ticket you linked seem to have impacted a lot of projects, and was an interesting read. Thanks!</p>
<ul>
<li><a href="https://github.com/containerd/containerd/pull/7566" rel="nofollow noreferrer">https://github.com/containerd/containerd/pull/7566</a></li>
</ul>
<p>If I understood correctly, your issue was an unfortunate syzygy of using an older Python2 Popen submodule, with a modern linux kernel, and the latest containerd runtime? Should I expect to see such symptoms with modern or future distros (Ubuntu >= 22.04 LTS) and ROS releases (ROS 2 >= Humble) ?</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/64471/danambrosio/" rel="nofollow noreferrer">danambrosio</a> on 2023-04-10</strong>:<br />
@ruffsl the issue was really that the newer buildroot LTS (2023.02) brought in a docker/containerd change that increased the <em>container</em> <code>nofile</code> soft and hard limits to infinity (over 1 billion). The python2 <code>popen</code> call with <code>close_fd=True</code> seemed to loop through all of these file descriptors causing it to hang as well as a XmlRpc issue that caused large memory allocation in ROS1 post kinetic. I tested this with Humble and buildroot (2023.02) and did not run into any issue. Also seems as if the fix is going into the future releases of docker, containderd and go.</p>
|
103128
|
2023-03-17T21:52:25.000
|
|ros-melodic|ros-lunar|ros-kinetic|docker|roscore|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hello,
I have an odd one here and am trying to figure out a possible root cause!</p>
<p><strong>The Situation</strong></p>
<p>I am running a custom Linux version made using Buildroot, with application ROS code containerized. I have noticed some odd behavior with both <code>roscore</code> and <code>roslaunch</code> delaying between log messages and ultimately taking minutes to execute. This behavior occurs <strong>only</strong> with ROS kinetic, lunar, and melodic versions of <code>roscore</code> and <code>roslaunch</code> on Linux kernel <strong>6.1</strong>. ROS noetic behaves as expected.</p>
<p><em>Note</em>: the same configuration on Linux kernel 5.15 does <strong>not</strong> exhibit this behavior.</p>
<hr />
<p><strong>Test Summary</strong></p>
<p>On Linux kernel 6.1, using the <code>ros:kinetic</code>/<code>ros:lunar</code>/<code>ros:melodic</code> Docker images from Docker Hub.</p>
<p>Run <code>docker run -it --network host --entrypoint bash ros:kinetic</code>, then from within the container run <code>source /opt/ros/${ROS_DISTRO}/setup.bash && roscore -v</code></p>
<p>The terminal displays:</p>
<pre><code>... logging to /root/.ros/log/0dfbd9a8-c533-11ed-998a-78d0042ad370/roslaunch-oc-general-68.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
... loading XML file [/opt/ros/kinetic/etc/ros/roscore.xml]
... executing command param [rosversion roslaunch]
Added parameter [/rosversion]
... executing command param [rosversion -d]
Added parameter [/rosdistro]
Added core node of type [rosout/rosout] in namespace [/]
started roslaunch server http://localhost:40105/
ros_comm version 1.12.17
SUMMARY
========
PARAMETERS
* /rosdistro: kinetic
* /rosversion: 1.12.17
NODES
auto-starting new master
</code></pre>
<p>And it hangs on <code>auto-starting new master</code> for ~100 seconds. The CPU% from <code>htop</code> is 100%.</p>
<p>After the initial ~100 seconds, <code>roscore</code> printed:</p>
<pre><code>process[master]: started with pid [78]
ROS_MASTER_URI=http://localhost:11311/
setting /run_id to 0dfbd9a8-c533-11ed-998a-78d0042ad370
</code></pre>
<p>And hangs for another ~100 seconds on <code>setting /run_id ...</code>. The CPU% from <code>htop</code> is also 100%.</p>
<p>Finally <code>roscore</code> finished with:</p>
<pre><code>process[rosout-1]: started with pid [91]
started core service [/rosout]
</code></pre>
<p>Similar behavior exists when running <code>roslaunch ...</code> with the ~100 second wait occurring on the <code>ROS_MASTER_URI=http://localhost:11311</code> output.</p>
<p><em>ROS Environment Variable</em></p>
<pre><code>ROS_ROOT=/opt/ros/kinetic/share/ros
ROS_PACKAGE_PATH=/opt/ros/kinetic/share
ROS_MASTER_URI=http://localhost:11311
ROS_PYTHON_VERSION=2
ROS_VERSION=1
ROSLISP_PACKAGE_DIRECTORIES=
ROS_DISTRO=kinetic
ROS_ETC_DIR=/opt/ros/kinetic/etc/ros
</code></pre>
<p>Interestingly enough, if I use <code>rosmon</code> to launch I do not see the ~100 second wait. Could this point to a python issue shared by <code>roscore</code> and <code>roslaunch</code> since <code>rosmon</code> is written in C++?</p>
<p>Any advice would be greatly appreciated!</p>
<hr />
<p><strong>Update</strong></p>
<p>Using <code>pdb</code> running <code>roscore</code> in the <code>ros:melodic</code> container, I have narrowed it down to the following call in the <em>roslaunch/nodeprocess.py</em> file:</p>
<p>/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/nodeprocess.py(340)</p>
<p>Which is a call to subprocess.Popen (see <a href="https://github.com/ros/ros_comm/blob/melodic-devel/tools/roslaunch/src/roslaunch/nodeprocess.py#L340" rel="nofollow noreferrer">https://github.com/ros/ros_comm/blob/melodic-devel/tools/roslaunch/src/roslaunch/nodeprocess.py#L340</a>)</p>
<p>Stepping into the subprocess.Popen call it seems to be here:</p>
<pre><code>> /usr/lib/python2.7/subprocess.py(394)__init__()
-> errread, errwrite)
</code></pre>
<p>After executing that subprocess function the output from <code>ps -aux</code> is:</p>
<pre><code>root 160 0.1 0.0 377148 63644 pts/0 Sl+ 01:35 0:00 python -m pdb roscore
root 174 99.2 0.0 377148 54332 ? Rs 01:38 0:53 python -m pdb roscore
</code></pre>
<p>Which eventually turns into:</p>
<pre><code>root 174 96.3 0.0 435416 60136 ? Ssl 01:38 1:40 /usr/bin/python /opt/ros/melodic/bin/rosmaster --core -p 11311 -w 3 __log:=/root/.ros
</code></pre>
<p>Maybe unrelated, I did notice that after the <code>rosmaster</code> subprocess is spawn, it gradually decreases it's CPU% over time.</p>
<hr />
<p><strong>Update #2</strong></p>
<p>I built the <code>melodic</code> <code>ros_base</code> variant from source with Python3 support, and do not see delays in <code>roscore</code> or <code>roslaunch</code>. Just to double-check, I made sure Python3 was being used to run <code>roscore</code></p>
<pre><code>root 199 0.5 0.0 348944 40940 pts/0 Sl+ 21:22 0:00 /usr/bin/python3 /opt/ros/melodic/bin/roscore -v
root 209 0.4 0.0 561516 37780 ? Ssl 21:22 0:00 /usr/bin/python3 /opt/ros/melodic/bin/rosmaster --core -p 11311 -w 3 __log:=...
</code></pre>
<p>Definitely seems like an issue with Python2 and Linux kernel 6.1...bummer.</p>
<hr />
<p><strong>Update #3</strong></p>
<p>After some additional debugging, I determined that the issue occurs <em>only</em> when the <code>close_fds</code> argument of the Python2 <code>subprocess.Popen</code> is set to <code>True</code>.</p>
<pre><code>close_file_descriptor = True
...
self.popen = subprocess.Popen(self.args, cwd=cwd, stdout=logfileout, stderr=logfileerr, env=full_env, close_fds=close_file_descriptor, preexec_fn=preexec_function)
</code></pre>
<p>This issue is not strictly related ROS as I tested using a base <code>ubuntu</code> image with a test Python2 script that called <code>subprocess.Popen</code>.</p>
<p>After digging around the internet, I found that there have been issues with Python2's <code>subprocess</code> module causing deadlocks and race conditions. Google released a package called <code>subprocess32</code> that is a direct replacement for <code>subprocess</code> that addresses the issues as well as backports Python3's implementation of <code>fork</code> and <code>exec</code> using the C module (see <a href="https://stackoverflow.com/a/25213194">https://stackoverflow.com/a/25213194</a>).</p>
<p>So I tested this by replacing the <code>subprocess</code> Python2.7 module with <code>subprocess32</code> in the <code>ros:kinetic-ros-base</code> container:</p>
<pre><code># Install subprocess32, replace subprocess
RUN pip install --no-cache subprocess32
RUN cp /usr/local/lib/python2.7/dist-packages/subprocess32.py /usr/lib/python2.7/subprocess.py
RUN cp /usr/local/lib/python2.7/dist-packages/_posixsubprocess32.so /usr/lib/python2.7/lib-dynload/_posixsubprocess32.so
</code></pre>
<p>and ran it on my original Buildroot configuration with Kernel 6.1 and did not have any issues with the <code>roscore</code> delays.</p>
<p>My best guess at why I saw this issue in my updated Buildroot configuration was due to some race condition or deadlock interaction between Python2.7 <code>subprocess</code> and the updated version of <code>glibc</code>. In the new configuration <code>glibc</code> was at version <code>2.36-81</code> vs <code>2.34-109</code>.</p>
<hr />
<p><strong>Update #4</strong></p>
<p>After doing more investigation and running into OOM issues caused by every ROS nodes consuming ~8GB of memory (similar to issues in <a href="https://answers.ros.org/question/336963/rosout-high-memory-usage/" rel="nofollow noreferrer">https://answers.ros.org/question/336963/rosout-high-memory-usage/</a>), I think I might have found the real culprit to the underlying issue.</p>
<p>It turns out newer versions of <code>docker</code> and <code>containerd</code> set <code>LimitNOFILE=infinity</code> in the corresponding systemd unit: <a href="https://github.com/containerd/containerd/pull/7566" rel="nofollow noreferrer">https://github.com/containerd/containerd/pull/7566</a>.</p>
<p>This then evaluates to a <code>ulimit</code> within the container of:</p>
<pre><code>:~# ulimit -Hn
1073741816
:~# ulimit -Sn
1073741816
</code></pre>
<p>Where the host evaluates to:</p>
<pre><code>:~# ulimit -Hn
524288
:~# ulimit -Sn
1024
</code></pre>
<p>The Python2 <code>submodule.Popen</code> call with <code>close_fd=True</code> most likely iterates through all file descriptors to find the fds owned by the <code>Popen</code> call to close (which would be roughly 1073741816), per <a href="https://github.com/containerd/containerd/pull/7566#issuecomment-1461140261" rel="nofollow noreferrer">https://github.com/containerd/containerd/pull/7566#issuecomment-1461140261</a>.</p>
<blockquote>
<p>This is problematic for some software. A common daemon practice is to close all inherited file descriptors (typically 1024 from the standard soft limit) - which in Docker looks like a stalled / hanging process (but is actually performing over a billion close() syscalls IIRC):</p>
</blockquote>
<p><code>subprocess32</code> probably does a much better job at determining the fd to close and therefore resolves this issue:</p>
<blockquote>
<p>For the closing inherited FDs practice that daemons perform, there are more modern approaches</p>
</blockquote>
<p>"modern approaches" -> <a href="https://stackoverflow.com/questions/899038/getting-the-highest-allocated-file-descriptor/918469#918469">https://stackoverflow.com/questions/899038/getting-the-highest-allocated-file-descriptor/918469#918469</a></p>
<p>The real solution is to limit the soft/hard nofiles that docker/containerd provides to its containers and there has been some significant discussion on this in <a href="https://github.com/containerd/containerd/pull/7566" rel="nofollow noreferrer">https://github.com/containerd/containerd/pull/7566</a>.</p>
<hr />
<p><a href="https://answers.ros.org/question/413528/odd-docker-roscore/roslaunch-delays-with-linux-kernel-6.1/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/64471/danambrosio/" rel="nofollow noreferrer">danambrosio</a> on ROS Answers with karma: 106 on 2023-03-17</p>
<p>Post score: 2</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-03-18</strong>:<br />
If it hangs for multiple minutes, seeing what it's hanging on should not be too difficult with something like <code>ptrace</code>, or perhaps even <code>pdb</code> in case of Python scripts/packages.</p>
<p>That might lead to results faster than speculation. Might be worth a try.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/64471/danambrosio/" rel="nofollow noreferrer">danambrosio</a> on 2023-03-18</strong>:<br />
@gvdhoorn using <code>pdb</code> running <code>roscore</code> in the <code>ros:melodic</code> container, I have narrowed it down to the following call in the <code>roslaunch/nodeprocess.py</code> file:</p>
<p><code>/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/nodeprocess.py(340)</code></p>
<p>Which is a call to <code>subprocess.Popen</code> (see <a href="https://github.com/ros/ros_comm/blob/melodic-devel/tools/roslaunch/src/roslaunch/nodeprocess.py#L340" rel="nofollow noreferrer">here</a>)</p>
<p>Stepping into the <code>subprocess.Popen</code> call it seems to be here:</p>
<pre><code>> /usr/lib/python2.7/subprocess.py(394)__init__()
-> errread, errwrite)
</code></pre>
<p>After executing that subprocess function the output from <code>ps -aux</code> is:</p>
<pre><code>root 160 0.1 0.0 377148 63644 pts/0 Sl+ 01:35 0:00 python -m pdb roscore
root 174 99.2 0.0 377148 54332 ? Rs 01:38 0:53 python -m pdb roscore
</code></pre>
<p>Which eventually turns into:</p>
<pre><code>root 174 96.3 0.0 435416 60136 ? Ssl 01:38 1:40 /usr/bin/python /opt/ros/melodic/bin/rosmaster --core -p 11311 -w 3 __log:=/root/.ros
</code></pre>
<p><strong>Comment by <a href="https://answers.ros.org/users/64471/danambrosio/" rel="nofollow noreferrer">danambrosio</a> on 2023-03-18</strong>:<br />
Maybe unrelated, I did notice that after the <code>rosmaster</code> subprocess is spawn, it gradually decreases it's CPU% over time.</p>
<p>As regular posts don't have max lengths, please also include context around the <code>subprocess.Popen(..)</code> call. Especially the call chain leading <em>to</em> it. <code>roscore</code> starts multiple processes, and it'd be interesting to know which is causing the issue (could be all of them, or a specific one).</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-03-19</strong>:<br />
Please add this to your initial post. Please also update all links to code to permalinks.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-03-19</strong>:<br />
Seeing as there don't appear to be any really interesting changes to the file you mention (<code>git diff melodic-devel...noetic-devel -- tools/roslaunch/src/roslaunch/nodeprocess.py</code>), I'm wondering whether this could be due to some incompatibility between Python <code>2.7</code> and kernel <code>6.1</code>. You mention Noetic works, so that would be Python 3. Melodic is Python 2.</p>
<p>You <em>could</em> consider building a minimal Melodic with Python 3 support and starting <code>roscore</code>. There are a couple of Q&As here on ROS Answers which document how to do that. Seeing as you only need <code>ros_comm</code> that should not be too much work (ie: you won't be building anything which actually needs Python-bindings, which is where it gets more complex).</p>
<p><code>ptrace</code> might show you exactly <em>what</em> is happening at the point of the hang though -- on the OS level, below what <code>pdb</code> can show you. <code>subprocess</code> can hang for various reasons, and with the very recent kernel, it might be something at the OS-level.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-03-19</strong>:<br />
Is it possible that another roscore process is already running on this machine? Only one port 11311 is available per machine.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/64471/danambrosio/" rel="nofollow noreferrer">danambrosio</a> on 2023-03-19</strong>:<br />
@gvdhoorn, updated the original post with the above comments, sorry about that. Feel free to remove the comments.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/64471/danambrosio/" rel="nofollow noreferrer">danambrosio</a> on 2023-03-19</strong>:<br />
@Mike Scheutzow there is only a single <code>roscore</code> being run. If there was multiple I would expect to see:</p>
<pre><code>RLException: roscore cannot run as another roscore/master is already running.
Please kill other roscore/master processes before relaunching.
The ROS_MASTER_URI is http://localhost:11311/
The traceback for the exception was written to the log file
</code></pre>
<p><strong>Comment by <a href="https://answers.ros.org/users/64471/danambrosio/" rel="nofollow noreferrer">danambrosio</a> on 2023-03-19</strong>:<br />
@gvdhoorn, see the update in the original post, seems like this is an issue with Python2 and Linux kernel 6.1. Suggest we close this as path forward would be to migrate to <code>noetic</code>.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-03-20</strong>:<br />
There's another possible cause, and that could be a Python 2 <em>idiom</em> (or <em>pattern</em>) doesn't work with kernel <code>6.1</code> any more. I'd say something like <code>subprocess.Popen(..)</code> would be especially "vulnerable" to that, as it deals with starting, monitoring and stopping processes as well as <code>stdin</code>, <code>stdout</code>, etc.</p>
<blockquote>
<p>Suggest we close this as path forward would be to migrate to <code>noetic</code>.</p>
</blockquote>
<p>This could indeed be an option.</p>
<p>Or use a from-source Melodic-with-Python3. It's not too difficult to build those.</p>
<p>There's probably a way to fix the problem you're seeing though. It would just require more debugging.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/64471/danambrosio/" rel="nofollow noreferrer">danambrosio</a> on 2023-03-20</strong>:<br />
Still digging into this, I have started to convince myself this may not be an issue with Kernel 6.1 but a package or packages that come with the Buildroot LTS that provides 6.1.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/64471/danambrosio/" rel="nofollow noreferrer">danambrosio</a> on 2023-03-25</strong>:<br />
@gvdhoorn let me know if you want to mark this closed or add an answer based on my recent update. Thank you for all your help!</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-03-25</strong>:<br />
I would suggest to post your last edit as the answer, as it seems like it <em>is</em> the answer.</p>
<p>+1 for getting to the bottom of it. I'm sure this will save some users (quite) some time when they try to do something similar.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-03-25</strong>:<br />
@danambrosio That was a difficult one! Well done.</p>
|
Odd Docker roscore/roslaunch delays with Linux kernel 6.1
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I find the answer. As described in the error message, ROS2 does not use rospy and should replace it to rclpy.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/111543/mirakim/" rel="nofollow noreferrer">mirakim</a> with karma: 21 on 2023-03-18</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
|
103130
|
2023-03-18T01:33:40.000
|
|ros|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hello,</p>
<p>I am running docker container with ros2 galactic and ros1 noetic, and whenever I try to run the launch file the error appears saying</p>
<p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/1679121072918762.png" alt="image description" /></p>
<p>The error have not appeared before and I don't know why this error appears suddenly.</p>
<p>I always source the ROS1 noetic then ROS2 galactic while using ros1_bridge to communicate with other container whose version is ROS1 melodic.</p>
<p>Thank you!</p>
<hr />
<p><a href="https://answers.ros.org/question/413530/importerror:-cannot-import-name-%27log%27-from-%27rosgraph_msgs.msg%27/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/111543/mirakim/" rel="nofollow noreferrer">mirakim</a> on ROS Answers with karma: 21 on 2023-03-18</p>
<p>Post score: 0</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/75154/mike-scheutzow/" rel="nofollow noreferrer">Mike Scheutzow</a> on 2023-03-18</strong>:<br />
In the future, please do not use screenshots of text. Instead, copy/paste the text into your description, and format it with the 101010 button. Thank you.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/111543/mirakim/" rel="nofollow noreferrer">mirakim</a> on 2023-03-21</strong>:<br />
@Mike Scheutzow Thank you for let me know! I will keep that in mind!</p>
|
ImportError: cannot import name 'Log' from 'rosgraph_msgs.msg'
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>When the bottom of the point cloud doesn't align with the XY map plane, it means either rtabmap is not using the base frame of your robot, or the Z value of TF between base frame and camera frame is wrong.</p>
<p>Is this used on a robot? Set rtabmap's <code>frame_id</code> to <code>base_footprint</code> or <code>base_link</code> (the base frame of your robot directly on the floor) if it is not already done. If the base frame is already the right one, adjust TF or URDF between the base frame of the robot and the camera base frame.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/20914/matlabbe/" rel="nofollow noreferrer">matlabbe</a> with karma: 6409 on 2023-03-24</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 2</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/142445/markrobotics/" rel="nofollow noreferrer">MarkRobotics</a> on 2023-03-26</strong>:<br />
Hi Thanks for this - I've updated the question with more information re: your comments here. At the moment the camera isn't connected to the robot. Well not in the TF sense. Just realsense and rtabmap running.</p>
<p>I was looking at the camera_*_optical_frame - which might be the cause - though I'm not sure why given I'm using the scripts out of the box without any modification to try and understand where this problem is coming from. I've added a screen shot of this too.</p>
<p>Thanks</p>
<p>Mark</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/20914/matlabbe/" rel="nofollow noreferrer">matlabbe</a> on 2023-03-27</strong>:<br />
In TF tree, the base frame is <code>camera_frame</code>, so it is normal that half of the image is below the XY plane. When you will be on a robot, you may have a frame <code>base_link</code>-><code>camera_frame</code> with z=0.5 meters for example, which will make the bottom of the cloud matching the XY plane if rtabmap is using <code>base_link</code>. You can simulate this with only the camera, by publishing:
<code>rosrun tf static_transform_publisher 0 0 0.5 0 0 0 base_link camera_link 100</code>
then set <code>frame_id</code> of rtabmap to <code>base_link</code> instead of <code>camera_link</code>.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/142445/markrobotics/" rel="nofollow noreferrer">MarkRobotics</a> on 2023-03-27</strong>:<br />
Thanks - That's done the job. Thanks for your help</p>
|
103132
|
2023-03-20T10:06:38.000
|
|ros|slam|navigation|rtabmap|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hi,</p>
<p>I've having problems getting the ground plan on rtabmap to show correctly. The pic below shows the ground plan beneath the grid floor. How can I correct this please. I've tried some static transforms but they haven't worked.</p>
<p><a href="https://www.dropbox.com/s/8rng8qk9c8kemln/Capture.PNG?dl=0" rel="nofollow noreferrer">https://www.dropbox.com/s/8rng8qk9c8kemln/Capture.PNG?dl=0</a></p>
<p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16796816786739229.png" alt="image description" /></p>
<p>Incorrect Camera Optical Frame??</p>
<p><a href="https://www.dropbox.com/s/xgminqnsig67a05/TF%20Camera%20Optical%20Frame.PNG?dl=0" rel="nofollow noreferrer">https://www.dropbox.com/s/xgminqnsig67a05/TF%20Camera%20Optical%20Frame.PNG?dl=0</a></p>
<p>Full TF tree:</p>
<p><a href="https://www.dropbox.com/s/s8en0mc5wvlus1s/TF%20Tree.PNG?dl=0" rel="nofollow noreferrer">https://www.dropbox.com/s/s8en0mc5wvlus1s/TF%20Tree.PNG?dl=0</a></p>
<p>RTABMap Startup Parameters</p>
<pre><code>PARAMETERS
* /rosdistro: noetic
* /rosversion: 1.16.0
* /rtabmap/rgbd_odometry/approx_sync: False
* /rtabmap/rgbd_odometry/approx_sync_max_interval: 0.0
* /rtabmap/rgbd_odometry/config_path:
* /rtabmap/rgbd_odometry/expected_update_rate: 0.0
* /rtabmap/rgbd_odometry/frame_id: camera_link
* /rtabmap/rgbd_odometry/ground_truth_base_frame_id:
* /rtabmap/rgbd_odometry/ground_truth_frame_id:
* /rtabmap/rgbd_odometry/guess_frame_id:
* /rtabmap/rgbd_odometry/guess_min_rotation: 0.0
* /rtabmap/rgbd_odometry/guess_min_translation: 0.0
* /rtabmap/rgbd_odometry/keep_color: False
* /rtabmap/rgbd_odometry/max_update_rate: 0.0
* /rtabmap/rgbd_odometry/odom_frame_id: odom
* /rtabmap/rgbd_odometry/publish_tf: True
* /rtabmap/rgbd_odometry/queue_size: 10
* /rtabmap/rgbd_odometry/subscribe_rgbd: False
* /rtabmap/rgbd_odometry/wait_for_transform_duration: 0.2
* /rtabmap/rgbd_odometry/wait_imu_to_init: False
* /rtabmap/rtabmap/Mem/IncrementalMemory: true
* /rtabmap/rtabmap/Mem/InitWMWithAllNodes: false
* /rtabmap/rtabmap/approx_sync: False
* /rtabmap/rtabmap/config_path:
* /rtabmap/rtabmap/database_path: ~/.ros/rtabmap.db
* /rtabmap/rtabmap/frame_id: camera_link
* /rtabmap/rtabmap/gen_depth: False
* /rtabmap/rtabmap/gen_depth_decimation: 1
* /rtabmap/rtabmap/gen_depth_fill_holes_error: 0.1
* /rtabmap/rtabmap/gen_depth_fill_holes_size: 0
* /rtabmap/rtabmap/gen_depth_fill_iterations: 1
* /rtabmap/rtabmap/gen_scan: False
* /rtabmap/rtabmap/ground_truth_base_frame_id:
* /rtabmap/rtabmap/ground_truth_frame_id:
* /rtabmap/rtabmap/initial_pose:
* /rtabmap/rtabmap/landmark_angular_variance: 9999.0
* /rtabmap/rtabmap/landmark_linear_variance: 0.0001
* /rtabmap/rtabmap/map_frame_id: map
* /rtabmap/rtabmap/odom_frame_id:
* /rtabmap/rtabmap/odom_frame_id_init:
* /rtabmap/rtabmap/odom_sensor_sync: False
* /rtabmap/rtabmap/odom_tf_angular_variance: 0.001
* /rtabmap/rtabmap/odom_tf_linear_variance: 0.001
* /rtabmap/rtabmap/publish_tf: True
* /rtabmap/rtabmap/queue_size: 10
* /rtabmap/rtabmap/scan_cloud_max_points: 0
* /rtabmap/rtabmap/subscribe_depth: True
* /rtabmap/rtabmap/subscribe_odom_info: True
* /rtabmap/rtabmap/subscribe_rgb: True
* /rtabmap/rtabmap/subscribe_rgbd: False
* /rtabmap/rtabmap/subscribe_scan: False
* /rtabmap/rtabmap/subscribe_scan_cloud: False
* /rtabmap/rtabmap/subscribe_scan_descriptor: False
* /rtabmap/rtabmap/subscribe_stereo: False
* /rtabmap/rtabmap/subscribe_user_data: False
* /rtabmap/rtabmap/wait_for_transform_duration: 0.2
</code></pre>
<p>Realsense Startup Parameters</p>
<pre><code>PARAMETERS
* /camera/realsense2_camera/accel_fps: 250
* /camera/realsense2_camera/accel_frame_id: camera_accel_frame
* /camera/realsense2_camera/accel_optical_frame_id: camera_accel_opti...
* /camera/realsense2_camera/align_depth: True
* /camera/realsense2_camera/aligned_depth_to_color_frame_id: camera_aligned_de...
* /camera/realsense2_camera/aligned_depth_to_fisheye1_frame_id: camera_aligned_de...
* /camera/realsense2_camera/aligned_depth_to_fisheye2_frame_id: camera_aligned_de...
* /camera/realsense2_camera/aligned_depth_to_fisheye_frame_id: camera_aligned_de...
* /camera/realsense2_camera/aligned_depth_to_infra1_frame_id: camera_aligned_de...
* /camera/realsense2_camera/aligned_depth_to_infra2_frame_id: camera_aligned_de...
* /camera/realsense2_camera/allow_no_texture_points: False
* /camera/realsense2_camera/base_frame_id: camera_link*
* /camera/realsense2_camera/calib_odom_file:
* /camera/realsense2_camera/clip_distance: -1.0
* /camera/realsense2_camera/color_fps: 15
* /camera/realsense2_camera/color_frame_id: camera_color_frame
* /camera/realsense2_camera/color_height: 480
* /camera/realsense2_camera/color_optical_frame_id: camera_color_opti...
* /camera/realsense2_camera/color_width: 640
* /camera/realsense2_camera/confidence_fps: 30
* /camera/realsense2_camera/confidence_height: 480
* /camera/realsense2_camera/confidence_width: 640
* /camera/realsense2_camera/depth_fps: 15
* /camera/realsense2_camera/depth_frame_id: camera_depth_frame
* /camera/realsense2_camera/depth_height: 480
* /camera/realsense2_camera/depth_optical_frame_id: camera_depth_opti...
* /camera/realsense2_camera/depth_width: 640
* /camera/realsense2_camera/device_type:
* /camera/realsense2_camera/enable_accel: True
* /camera/realsense2_camera/enable_color: True
* /camera/realsense2_camera/enable_confidence: True
* /camera/realsense2_camera/enable_depth: True
* /camera/realsense2_camera/enable_fisheye1: False
* /camera/realsense2_camera/enable_fisheye2: False
* /camera/realsense2_camera/enable_fisheye: True
* /camera/realsense2_camera/enable_gyro: True
* /camera/realsense2_camera/enable_infra1: True
* /camera/realsense2_camera/enable_infra2: True
* /camera/realsense2_camera/enable_infra: False
* /camera/realsense2_camera/enable_pointcloud: False
* /camera/realsense2_camera/enable_pose: False
* /camera/realsense2_camera/enable_sync: True
* /camera/realsense2_camera/filters:
* /camera/realsense2_camera/fisheye1_frame_id: camera_fisheye1_f...
* /camera/realsense2_camera/fisheye1_optical_frame_id: camera_fisheye1_o...
* /camera/realsense2_camera/fisheye2_frame_id: camera_fisheye2_f...
* /camera/realsense2_camera/fisheye2_optical_frame_id: camera_fisheye2_o...
* /camera/realsense2_camera/fisheye_fps: 15
* /camera/realsense2_camera/fisheye_frame_id: camera_fisheye_frame
* /camera/realsense2_camera/fisheye_height: 480
* /camera/realsense2_camera/fisheye_optical_frame_id: camera_fisheye_op...
* /camera/realsense2_camera/fisheye_width: 640
* /camera/realsense2_camera/gyro_fps: 400
* /camera/realsense2_camera/gyro_frame_id: camera_gyro_frame
* /camera/realsense2_camera/gyro_optical_frame_id: camera_gyro_optic...
* /camera/realsense2_camera/imu_optical_frame_id: camera_imu_optica...
* /camera/realsense2_camera/infra1_frame_id: camera_infra1_frame
* /camera/realsense2_camera/infra1_optical_frame_id: camera_infra1_opt...
* /camera/realsense2_camera/infra2_frame_id: camera_infra2_frame
* /camera/realsense2_camera/infra2_optical_frame_id: camera_infra2_opt...
* /camera/realsense2_camera/infra_fps: 15
* /camera/realsense2_camera/infra_height: 480
* /camera/realsense2_camera/infra_rgb: False
* /camera/realsense2_camera/infra_width: 640
* /camera/realsense2_camera/initial_reset: False
* /camera/realsense2_camera/json_file_path:
* /camera/realsense2_camera/linear_accel_cov: 0.01
* /camera/realsense2_camera/odom_frame_id: camera_odom_frame
* /camera/realsense2_camera/ordered_pc: False
* /camera/realsense2_camera/pointcloud_texture_index: 0
* /camera/realsense2_camera/pointcloud_texture_stream: RS2_STREAM_COLOR
* /camera/realsense2_camera/pose_frame_id: camera_pose_frame
* /camera/realsense2_camera/pose_optical_frame_id: camera_pose_optic...
* /camera/realsense2_camera/publish_odom_tf: True
* /camera/realsense2_camera/publish_tf: True
* /camera/realsense2_camera/reconnect_timeout: 6.0
* /camera/realsense2_camera/rosbag_filename:
* /camera/realsense2_camera/serial_no:
* /camera/realsense2_camera/stereo_module/exposure/1: 7500
* /camera/realsense2_camera/stereo_module/exposure/2: 1
* /camera/realsense2_camera/stereo_module/gain/1: 16
* /camera/realsense2_camera/stereo_module/gain/2: 16
* /camera/realsense2_camera/tf_publish_rate: 0.0
* /camera/realsense2_camera/topic_odom_in: camera/odom_in
* /camera/realsense2_camera/unite_imu_method: none
* /camera/realsense2_camera/usb_port_id:
* /camera/realsense2_camera/wait_for_device_timeout: -1.0
* /rosdistro: noetic
* /rosversion: 1.16.0
</code></pre>
<p>Cheers</p>
<p>Mark</p>
<hr />
<p><a href="https://answers.ros.org/question/413587/rtabmap-ground-plain-off/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/142445/markrobotics/" rel="nofollow noreferrer">MarkRobotics</a> on ROS Answers with karma: 3 on 2023-03-20</p>
<p>Post score: 0</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/20914/matlabbe/" rel="nofollow noreferrer">matlabbe</a> on 2023-03-22</strong>:<br />
You may not enough karma to upload an image, can you add a link to image uploaded somewhere else?</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/142445/markrobotics/" rel="nofollow noreferrer">MarkRobotics</a> on 2023-03-24</strong>:<br />
Thanks - I've added a link</p>
|
RTABMap Ground Plain Off
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Not sure why, but rebuilding the micro ros agent from source works. The snap version doesn't work for this application.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/142457/peter-klemperer/" rel="nofollow noreferrer">Peter Klemperer</a> with karma: 16 on 2023-03-24</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
|
103134
|
2023-03-20T13:18:48.000
|
|ros2|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hi! I’m trying to implement micro ROS on the Pololu 3pi+ 2040 mobile robot. The 3pi+ 2040 has a Raspberry Pi 2040 microcontroller.</p>
<p>I'm currently running Humble in a Ubuntu 20.04 with Kernel 5.15.0-67-generic VM guest in UTM on an Intel Mac.</p>
<p>I’ve successfully compiled the Raspberry Pi Pico implementation of micro ROS and read it’s topic according to the instructions here: <a href="https://robofoundry.medium.com/raspberry-pi-pico-ros2-via-micro-ros-actually-working-in-1-hr-9f7a3782d3e3" rel="nofollow noreferrer">https://robofoundry.medium.com/raspberry-pi-pico-ros2-via-micro-ros-actually-working-in-1-hr-9f7a3782d3e3</a></p>
<p>The problem begins when I’ve loaded the Pico uf2 file on the 3pi+ 2040. Reading from the serial port looks similar to the output from the Pico, but the actual agent dies with error code 13 even though I’m running with sudo.</p>
<p><strong>Does anyone know how to debug in this scenario? I am looking for next steps, if possible.</strong></p>
<p>The actual output of mico ROS agent is as follows:
bash ~/start_micro-ros-agent.sh
[1679288574.823863] error | TermiosAgentLinux.cpp | init | open device error | device: /dev/ttyACM0, errno: 13. Please re-run with superuser privileges.
Error while starting serial agent!</p>
<p>Where start_micro-ros-agent.sh contains:more ~/start_micro-ros-agent.sh
sudo micro-ros-agent serial --dev /dev/ttyACM0 --baudrate=115200 -v6</p>
<p>At the very least this error message is spurious because I am running with root privileges.</p>
<hr />
<p><a href="https://answers.ros.org/question/413591/micro_ros_agent-failing-to-connect-to-raspberry-pi-rp2040-with-error:-13/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/142457/peter-klemperer/" rel="nofollow noreferrer">Peter Klemperer</a> on ROS Answers with karma: 16 on 2023-03-20</p>
<p>Post score: 0</p>
|
micro_ros_agent failing to connect to Raspberry Pi RP2040 with error: 13
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>(from comments above)</p>
<p>To use stereo with lidar, you should use <code>subscribe_rgbd=true</code>, otherwise the node won't subscribe to scan. When the node is subscribed to scan, by default it should use the scan for occupancy grid.</p>
<p>Add also <code>approx_sync</code> to <code>true</code>, it is unlikely that all those topics have exactly the same timestamp.</p>
<p>For the <code>Lookup would require extrapolation 0.064568610s into the future</code>, you may use <code>rqt_console</code> to know from which node it is logged.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/20914/matlabbe/" rel="nofollow noreferrer">matlabbe</a> with karma: 6409 on 2023-03-27</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 2</p>
|
103136
|
2023-03-21T12:32:59.000
|
|ros|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hello,</p>
<p>I have a differential-drive robot that is equipped with a Realsense D435 RGBD camera and 2D Lidar scanner. I am using RTAB-Map to perform SLAM and I wanted to know if there is a way to incorporate Lidar readings from the <code>/scan</code> topic into the RTAB-Map SLAM node <code>rtabmap</code>. I have chosen to use the stereo mode of the camera to receive stereo images that will be input to the <code>stereo_odometry</code> and <code>rtabmap</code> nodes. When I run the launch files that I use, the map cloud and odometry work fine along with the <code>/scan</code> topic producing messages. However, when I try to view the produced occupancy grid from the Lidar, I get the follow error message continously:</p>
<p><strong>[ WARN] [1679412963.381777182]: Grid map is empty! (local maps=1)</strong></p>
<p>Through further investigation, I realized that the <code>rtabmap</code> SLAM node is not subscribed to the scan topic even though I set <code>subscribe_scan=true</code>. The launch file that receives stereo images and launches the standard rtabmap launch file <code>rtabmap.launch</code> will be placed below:</p>
<pre><code><launch>
<arg name="rviz" default="true" />
<include file="$(find rtabmap_ros)/launch/rtabmap.launch">
<arg name="rtabmap_args" value="--delete_db_on_start"/>
<arg name="frame_id" value="base_link"/>
<arg name="stereo" value="true"/>
<arg name="subscribe_rgbd" value="false"/>
<arg name="subscribe_scan" value="true"/>
<!-- stereo related topics -->
<arg name="left_image_topic" default="/camera/infra1/image_rect_raw" />
<arg name="right_image_topic" default="/camera/infra2/image_rect_raw" /> <!-- using grayscale image for efficiency -->
<arg name="left_camera_info_topic" default="/camera/infra1/camera_info" />
<arg name="right_camera_info_topic" default="/camera/infra2/camera_info" />
<arg name="rgbd_topic" value="/rgbd_image"/>
<arg name="compressed" value="true"/>
<arg name="rviz" value="<span class="math-container">$(arg rviz)"/>
<arg if="$</span>(arg rviz)" name="rtabmapviz" value="false"/>
</include>
<!--Launch static transform between base_link and camera_link-->
<node name="base_to_camera_static_publisher" pkg="tf2_ros" type="static_transform_publisher" args="0.2531 0 0.0859 0 0 0 base_link camera_link"/></launch>
</code></pre>
<p>Please note that this launch file is being used on a remote computer and the robot is using a separate launch file that initializes the <code>stereo_sync</code> node along with the driver for the 2d Lidar. This launch file will also be displayed below:</p>
<pre><code><launch>
<!-- Launch Stereo Camera Node-->
<include file="$(find realsense2_camera)/launch/rs_camera.launch">
<arg name="enable_infra1" value="true" />
<arg name="enable_infra2" value="true" />
</include>
<!-- Launch LD14 Lidar Sensor Node-->
<include file="$(find ldlidar_sl_ros)/launch/ld14.launch"/>
<!-- Launch RTAB-Map Stereo Sync Nodelet-->
<arg name="rate" default="5"/>
<arg name="approx_sync" default="false" />
<arg name="stereo_sync" default="true"/>
<node pkg="nodelet" type="nodelet" name="nodelet_manager" args="manager"/>
<node if="<span class="math-container">$(arg stereo_sync)" pkg="nodelet" type="nodelet" name="stereo_sync" args="load rtabmap_ros/stereo_sync nodelet_manager" output="screen">
<param name="compressed_rate" type="double" value="$</span>(arg rate)"/>
<param name="approx_sync" type="bool" value="$(arg approx_sync)"/>
<remap from="left/image_rect" to="/camera/infra1/image_rect_raw"/>
<remap from="right/image_rect" to="/camera/infra2/image_rect_raw"/>
<remap from="left/camera_info" to="/camera/infra1/camera_info"/>
<remap from="right/camera_info" to="/camera/infra2/camera_info"/>
<remap from="rgbd_image" to="rgbd_image"/>
</node>
</code></pre>
<p>Both the remote computer and the robot are being ran on the noetic distro of ROS. Any advice on how I could go about fixing this issue or alternative methods that could work would be greatly appreciated.</p>
<hr />
<p><a href="https://answers.ros.org/question/413632/is-it-possible-to-use-2d-lidar-for-occupancy-map-building-while-using-stereo-odometry-in-rtab-map?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/61268/devin1126/" rel="nofollow noreferrer">Devin1126</a> on ROS Answers with karma: 7 on 2023-03-21</p>
<p>Post score: 0</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/20914/matlabbe/" rel="nofollow noreferrer">matlabbe</a> on 2023-03-24</strong>:<br />
To use stereo with lidar, you should use <code>subscribe_rgbd=true</code>, otherwise the node won't subscribe to scan. When the node is subscribed to scan, by default it should use the scan for occupancy grid.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/61268/devin1126/" rel="nofollow noreferrer">Devin1126</a> on 2023-03-25</strong>:<br />
I changed the parameter <code>subscribe_rgbd=true</code>. I can confirm that it now shows that the RTAB-Map SLAM node is now subscribed to scan messages, however after doing that, I receive another error that states the following continuously:</p>
<p>**[ WARN] [1679763995.026228053]: /rtabmap/rtabmap: Did not receive data since 5 seconds! Make sure the input topics are published ("$ rostopic hz my_topic") and the timestamps in their header are set. If topics are coming from different computers, make sure the clocks of the computers are synchronized ("ntpdate"). Parameter "approx_sync" is false, which means that input topics should have all the exact timestamp for the callback to be called.
/rtabmap/rtabmap subscribed to (exact sync):</p>
<p>/rtabmap/odom \</p>
<p>/rgbd_image_relay \</p>
<p>/scan**</p>
<p>I checked if each of these topics above were publishing messages and they all were. Do you have any idea as to why this may be happening?</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/20914/matlabbe/" rel="nofollow noreferrer">matlabbe</a> on 2023-03-25</strong>:<br />
add <code>approx_sync</code> to true, it is unlikely that all those topics have exactly the same timestamp.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/61268/devin1126/" rel="nofollow noreferrer">Devin1126</a> on 2023-03-25</strong>:<br />
Thank you for your help so far. Using <code>approx_sync=true</code> fixed that error and I now see a stereo pointcloud and an occupancy grid being produced by the Lidar in Rviz. There is only one remaining error that persists even though this may be minor. While rtabmap is running, I am continuously receiving some form of a <code>tf</code> error that states the following:</p>
<p><strong>[ WARN] [1679786410.105168036]: Could not get transform from odom to base_link after 0.200000 seconds (for stamp=1679786409.920569)! Error="Lookup would require extrapolation 0.064568610s into the future. Requested time 1679786409.920568705 but the latest data is at time 1679786409.856000185, when looking up transform from frame [base_link] to frame [odom]. canTransform returned after 0.200711 timeout was 0.2.".</strong></p>
<p>If you could provide some type of solution for this as well, I would really appreciate it. Also, please add your previous comment as an answer and I will give credit to it as an official answer.</p>
|
Is it possible to use 2d Lidar for Occupancy Map Building while using Stereo Odometry in RTAB-Map?
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I have finally got my idea done and its working like a charm.</p>
<p>Instead of solving the Homography Matrix by myself I used image_geometry::PinholeCameraModel to project the points from the 3D Space into the 2D image plane....</p>
<p>If someone is interested to know more about it, follow this link:</p>
<p><a href="https://xperroni.me/projecting-points-with-ros-pinhole-camera-model.html" rel="nofollow noreferrer">https://xperroni.me/projecting-points-with-ros-pinhole-camera-model.html</a></p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/142569/whateverkatzenfutter/" rel="nofollow noreferrer">WhateverKatzenfutter</a> with karma: 36 on 2023-03-30</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
|
103138
|
2023-03-22T05:27:21.000
|
|ros2|urdf|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hey Guys,</p>
<p>could someone of you please give me a helping hand and guide me trough my plan of my work with ROS2 and AprilTag for object localization?</p>
<p>At the current state I have a AprilTag on a cube (just for now on one of the faces) and I am already able to run AprilTag detection on ROS2 with the help of this package:</p>
<p><a href="https://github.com/christianrauch/apriltag_ros" rel="nofollow noreferrer">https://github.com/christianrauch/apriltag_ros</a></p>
<p>The AprilTag is already getting properly detected and I can extract all the data like the tf transformations, homography, position of the center and the corners of the AprilTag in the image plane.</p>
<p>I already use the given data and use it in RQT with this package…:</p>
<p><a href="https://github.com/ros-sports/rqt_image_overlay" rel="nofollow noreferrer">https://github.com/ros-sports/rqt_image_overlay</a></p>
<p>…to draw the corners and center points of the detected AprilTag and also its axis, with some other information.</p>
<p>Now to my problem and an possible plan…</p>
<p>I want to also detect the corners of the cube and draw them on the plane of the camera image in RQT, as I have done it with the AprilTag… But because I am a newbie in Computer Vision, I am not really sure, if I going the right way.</p>
<p>For solving my Problem I have created an URDF Model of the cube with the AprilTag on it and it mostly works fine (Still some issues with different orientation of the axis of the camera and the AprilTag Frame) and now I was thinking, if it is possible to calculate any point on the surface of the cube (on which the AprilTag is) via. tf2 and then just use homography to project the point of the 3D space into the 2D plane of the image to draw it with the Image Overlay in RQT?</p>
<p>I hope you guys will be able to understand my problem....I would love to add some picture, so you could understand it better, but sadly I have not enough karma.</p>
<hr />
<p><a href="https://answers.ros.org/question/413646/ros2-and-apriltag-for-object-localization/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/142569/whateverkatzenfutter/" rel="nofollow noreferrer">WhateverKatzenfutter</a> on ROS Answers with karma: 36 on 2023-03-22</p>
<p>Post score: 0</p>
|
ROS2 and AprilTag for object localization
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>In ROS 2 Humble, when you send out a goal with "async_send_goal", assign the returned future goal handle to a variable. When you need to query for the result, you can just call "<a href="https://docs.ros2.org/latest/api/rclcpp_action/classrclcpp__action_1_1Client.html#a0213daa95ba7b1229d1371fad47b23b5" rel="nofollow noreferrer">async_get_result</a>" or "<a href="https://docs.ros2.org/latest/api/rclcpp_action/classrclcpp__action_1_1ClientGoalHandle.html" rel="nofollow noreferrer">async_result</a>" (deprecated). For example:</p>
<pre><code>auto future_goal_handle = client_ptr_->async_send_goal(goal_msg, send_goal_options);
rclcpp::spin_until_future_complete(node, future_goal_handle);
auto result = client_ptr_-> async_get_result(future_goal_handle.get());
if (result.get().code == rclcpp_action::ResultCode::SUCCEEDED)
{
return true;
}
</code></pre>
<p>Note that the "result" you get is a <a href="https://docs.ros2.org/latest/api/rclcpp_action/structrclcpp__action_1_1ClientGoalHandle_1_1WrappedResult.html" rel="nofollow noreferrer">WrappedResult</a>, so if you want the result message, you need to do something like:</p>
<pre><code>result.get().result
</code></pre>
<p>You can also query for goal status through the client goal handle with "<a href="https://docs.ros2.org/latest/api/rclcpp_action/classrclcpp__action_1_1ClientGoalHandle.html#a154456949c16b697741c28705d7fdfeb" rel="nofollow noreferrer">get_status</a>" if you are comparing with <code>action_client->get_state()</code> instead.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/52726/guimingchen/" rel="nofollow noreferrer">GuimingChen</a> with karma: 56 on 2023-03-23</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 2</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/30443/acwok/" rel="nofollow noreferrer">Acwok</a> on 2023-03-23</strong>:<br />
Thank you @GuimingChen!</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/30443/acwok/" rel="nofollow noreferrer">Acwok</a> on 2023-03-23</strong>:<br />
@GuimingChen The execution get stucked at <code>auto result = client_ptr_-> async_get_result(future_goal_handle.get());</code> :(
The action is well executed though</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/52726/guimingchen/" rel="nofollow noreferrer">GuimingChen</a> on 2023-03-23</strong>:<br />
hmm... interesting, I thought this should return immediately since it is a std::shared_future.
Did it give you any error message?
Can you print something in the server side to check <a href="https://docs.ros2.org/latest/api/rclcpp_action/classrclcpp__action_1_1ServerGoalHandleBase.html" rel="nofollow noreferrer">which status</a> the goal is currently in when it got stucked? You can try access the goal status in handle accepted callback.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/30443/acwok/" rel="nofollow noreferrer">Acwok</a> on 2023-03-23</strong>:<br />
No, there is no error, it just block at the async_get_result() call.<br />
On the server side, the _execute() callback is correctly executed, I can see the message "Goal succeeded" in the terminal.</p>
<pre><code>void SpacecraftController::change_si_state_execute(const std::shared_ptr<GoalHandleChangeSIState> goal_handle)
{
RCLCPP_INFO(this->get_logger(), "Executing goal");
const auto goal = goal_handle->get_goal();
auto result = std::make_shared<ChangeSIState::Result>();
if (emitSiCmd(*goal))
{
result->nb_si_handled = goal->si_list.size();
goal_handle->succeed(result);
RCLCPP_INFO(this->get_logger(), "Goal succeeded");
}
}
</code></pre>
<p><strong>Comment by <a href="https://answers.ros.org/users/30443/acwok/" rel="nofollow noreferrer">Acwok</a> on 2023-03-23</strong>:<br />
The goal status in the <code>_accepted()</code> callback is <code>is_active=1</code>, <code>is_executing=1</code> and <code>is_canceling=0</code></p>
<p><strong>Comment by <a href="https://answers.ros.org/users/30443/acwok/" rel="nofollow noreferrer">Acwok</a> on 2023-03-23</strong>:<br />
The goal status at the end of the <code>_execute()</code> callback is <code>is_active=0</code>, <code>is_executing=0</code> and <code>is_cancelling=0</code></p>
<p><strong>Comment by <a href="https://answers.ros.org/users/30443/acwok/" rel="nofollow noreferrer">Acwok</a> on 2023-03-23</strong>:<br />
Actually there is an error if I kill the blocking node with CTRL+C:</p>
<pre><code> [ERROR] [1679587180.654655117] [rclcpp]: caught std::exception exception when uninstalling signal handlers in rclcpp::~SignalHandler: Invalid argument
cannot publish data, at ./src/rmw_publish.cpp:62 during '__function__'
[ERROR] [1679587180.656454559] [sequencer.rclcpp]: Error in destruction of rcl subscription handle: Failed to delete datareader, at ./src/subscription.cpp:52, at ./src/rcl/subscription.c:183
cannot publish data, at ./src/rmw_publish.cpp:62 during '__function__'
Fail in delete datareader, at ./src/rmw_service.cpp:104 during '__function__'
[ros2run]: Segmentation fault
</code></pre>
<p><strong>Comment by <a href="https://answers.ros.org/users/30443/acwok/" rel="nofollow noreferrer">Acwok</a> on 2023-03-23</strong>:<br />
I tried</p>
<pre><code>auto future_goal_handle = action_client->async_send_goal(goal_msg, send_goal_options);
RCLCPP_INFO(node->get_logger(), "Goal handle valid =%d", future_goal_handle.valid());
RCLCPP_INFO(node->get_logger(), "Goal status =%d", future_goal_handle.get().get()->get_status());
</code></pre>
<p><code>future_goal_handle.valid()</code> returns 1<br />
<code>future_goal_handle.get()</code> blocks the execution</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/30443/acwok/" rel="nofollow noreferrer">Acwok</a> on 2023-03-23</strong>:<br />
Maybe it is related with this open issue: <a href="https://github.com/ros2/rclcpp/issues/2130" rel="nofollow noreferrer">https://github.com/ros2/rclcpp/issues/2130</a></p>
<p><strong>Comment by <a href="https://answers.ros.org/users/52726/guimingchen/" rel="nofollow noreferrer">GuimingChen</a> on 2023-03-23</strong>:<br />
Oh, and I just realized that I forgot to add <code>rclcpp::spin_until_future_complete</code> to block the waiting until the future is ready. Based on the documentation, <a href="https://docs.ros2.org/dashing/api/rclcpp_action/classrclcpp__action_1_1Client.html" rel="nofollow noreferrer">This doc</a> page did mention that "A future that completes when the goal has been accepted or rejected." Maybe worth give it a shot to add the following code before calling <code>future_goal_handle.get()</code>:</p>
<pre><code>rclcpp::spin_until_future_complete(node, future_goal_handle);
</code></pre>
<p><strong>Comment by <a href="https://answers.ros.org/users/52726/guimingchen/" rel="nofollow noreferrer">GuimingChen</a> on 2023-03-23</strong>:<br />
you may need <code>node->get_node_base_interface()</code> depending on what exactly the <code>node</code> here mean</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/30443/acwok/" rel="nofollow noreferrer">Acwok</a> on 2023-03-24</strong>:<br />
It is indeed the <code>spin_until_future_complete()</code> that was missing.<br />
Thank you @GuimingChen !</p>
|
103140
|
2023-03-23T05:10:13.000
|
|ros2|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hello,</p>
<p>I'd like to use polling instead of callbacks.<br />
Is it possible to query the result of the action server as it was the case in ROS1 with <code>action_client->get_state()</code> ?<br />
I can't find an equivalent in ROS2 Humble.</p>
<p>Clement</p>
<hr />
<p><a href="https://answers.ros.org/question/413678/is-it-possible-to-query-the-result-of-the-action-server?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/30443/acwok/" rel="nofollow noreferrer">Acwok</a> on ROS Answers with karma: 85 on 2023-03-23</p>
<p>Post score: 0</p>
|
Is it possible to query the result of the action server?
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I think your description of the problems are accurate to what it is you're trying to accomplish. There's more than one potential answer but you're asking the right questions.</p>
<p>Disabling TF publication in SLAM Toolbox or redirecting it to other frames to use for fusion with GPS is certainly possible. You're right to think you shouldn't publish from both R_L and SLAM Toolbox over the same frames or else it will cause erratic behavior. This is totally feasible to fuse the output pose of SLAM Toolbox into a filter with GPS to combine them.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/25940/stevemacenski/" rel="nofollow noreferrer">stevemacenski</a> with karma: 8272 on 2023-03-24</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 4</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/148408/timoth%C3%A9e/" rel="nofollow noreferrer">Timothée</a> on 2023-05-11</strong>:<br />
I have the exact same configuration as Cferreira, and although just disabling the frame publishing in SLAM_toolbox works, would you mind explaining how you would extract the information from SLAM toolbox without it interfering with the ekf instance that publish map->odom ?</p>
|
103142
|
2023-03-24T05:18:29.000
|
|ros|base-odometry|navsat-transform-node|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p><strong>Setup details:</strong> ROS2 foxy on arm architecture CPU with nav2, slam_toolbox and robot_localization installed.
My physical robot has an IMU, odometry, GPS and LIDAR sensors.</p>
<p>I'm currently working on the navigation design of the robot. I would like to fuse all data available from sensors to obtain a pose estimation and use it to navigate with Nav2. The map will be created using slam_toolbox and Nav2 tools, with all the data coming from the LIDAR.</p>
<p>I've been following official tutorials of Nav2 (<a href="https://navigation.ros.org/setup_guides/odom/setup_odom.html" rel="nofollow noreferrer">https://navigation.ros.org/setup_guides/odom/setup_odom.html</a>) and it recommends to use robot_localization package to fuse sensors data. As I have a GPS available, according to the robot_localization wiki (<a href="http://docs.ros.org/en/noetic/api/robot_localization/html/integrating_gps.html" rel="nofollow noreferrer">http://docs.ros.org/en/noetic/api/robot_localization/html/integrating_gps.html</a>), the best option is to run two instances of robot_localization:</p>
<ul>
<li>One for continuous data, that is, IMU and Odometry. It will publish the <code>odom->base_link</code> transform. <em>I guess I could include LIDAR information too, but I'm not sure if it would be useful.</em></li>
<li>Another instance for both continuous and discrete data, that is, IMU, Odometry and GPS. This ekf instance will use the pose data provided by <code>navsat_transform_node</code>, which will receive data from the GPS. It will publish the <code>map->odom</code> transform.</li>
</ul>
<p>However, running slam_toolbox simultaneously with this previous setup will create another node publishing the same transform of <code>map->odom</code> (navsat_transform_node is already publishing it). I guess this will result in an erratic behavior.</p>
<p>What would be the appropriate solution here? Should I configure slam_toolbox to stop publishing the transform? Is there any feasible way to combine functionalities of both nodes? Should I add the pose published by slam_toolbox node into the ekf too?</p>
<p>I'm open to any other suggestions about how to redesign the navigation system.</p>
<hr />
<p><a href="https://answers.ros.org/question/413730/how-to-combine-slam_toolbox-and-robot_localization-using-nav2?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/142806/cferreira/" rel="nofollow noreferrer">Cferreira</a> on ROS Answers with karma: 11 on 2023-03-24</p>
<p>Post score: 1</p>
|
How to combine slam_toolbox and robot_localization using Nav2?
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>In an <code>xml</code> launch file I was able to process my <code>xacro</code> via</p>
<pre><code><node pkg="robot_state_publisher" exec="robot_state_publisher"
<param name='robot_description' type="str" value="<span class="math-container">$(command 'xacro $</span>(find-pkg-share myrobot_description)/urdf/robot.urdf.xacro')"/>
</node>
</code></pre>
<p>Note that I added the following line to the <code>data_files</code> member in <code>setup.py</code></p>
<pre><code>(os.path.join('share', package_name, 'urdf'), glob(os.path.join('urdf', '*[urdf][xacro]*')))
</code></pre>
<p>This was a slightly different approach than stated in the <a href="https://docs.ros.org/en/iron/Tutorials/Intermediate/URDF/Using-URDF-with-Robot-State-Publisher.html#edit-the-setup-py-file" rel="nofollow noreferrer">urdf tutorial</a> and allowed my description files to be copied to the shared directory within a urdf folder.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/39292/chives_onion/" rel="nofollow noreferrer">chives_onion</a> with karma: 180 on 2023-06-13</p>
<p>This answer was <strong>NOT ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
|
103144
|
2023-03-27T17:02:01.000
|
|ros2|roslaunch|yaml|xacro|robot-description|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I'm trying to use YAML launch files for a Gazebo simulation project I'm working on, but it doesn't seem like there's a lot of documentation beyond the basics <a href="https://docs.ros.org/en/rolling/How-To-Guides/Launch-file-different-formats.html" rel="nofollow noreferrer">here</a>.</p>
<p>I need to process a robot description <code>xacro</code> and pass that as a <code>param</code> to <code>robot_state_publisher</code>.</p>
<p>Does the YAML frontend support this?</p>
<p>Does someone know of an example in an existing package?</p>
<p>I should be able to RUN the <code>xacro</code> processing with an <code>executable</code> but it's not clear how I'd store and access the variable. (I could probably put it into an env var and then read the env var, but that seems like a roundabout way to</p>
<p><a href="https://design.ros2.org/articles/roslaunch_xml.html#executable-tag" rel="nofollow noreferrer">https://design.ros2.org/articles/roslaunch_xml.html#executable-tag</a></p>
<p>Here I'm linking to XML docs because there's not much on YAML that I can find, but it seems from other recent investigations like YAML and XML are almost exactly the same.</p>
<hr />
<p><a href="https://answers.ros.org/question/413817/xacro-processing-in-ros-2-yaml-launch-files-(or-xml)?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/37963/danzimmerman/" rel="nofollow noreferrer">danzimmerman</a> on ROS Answers with karma: 337 on 2023-03-27</p>
<p>Post score: 0</p>
|
xacro processing in ROS 2 YAML launch files (or XML)?
|
<p>Thank you for this well-explained example.</p>
<p>I've tried your code though, and it all worked except for the ackermann plugin.</p>
<p>When i compare it with the <a href="https://docs.ros.org/en/ros2_packages/rolling/api/gazebo_plugins/generated/classgazebo__plugins_1_1GazeboRosAckermannDrive.html" rel="nofollow noreferrer">libgazebo_ros_ackermann_drive documentation</a></p>
<p>it seems like your code is missing the</p>
<blockquote>
<p><steering_wheel_joint>steering_joint</steering_wheel_joint></p>
</blockquote>
<p>Do you know which joint in your shared urdf that might be?</p>
<p>Or, if anyone know which joint is the "steering joint" in general that would be great.</p>
<p>Thanks</p>
|
103147
|
2023-03-28T16:12:42.000
|
|ros|ros2|base-odometry|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hi I am following this <a href="https://navigation.ros.org/setup_guides/odom/setup_odom.html" rel="nofollow noreferrer">tutorial</a> to set the odom to my <a href="https://pastebin.com/LW9aCeMc" rel="nofollow noreferrer">truck_robot xacro</a></p>
<p>Unfortunately, I was not able to see the \odom or \demo_odom topic published in my terminal. After issue "ros2 topic list" I just get:</p>
<pre><code>/clock
/demo/imu
/joint_states
/parameter_events
/performance_metrics
/robot_description
/rosout
/tf
/tf_static
</code></pre>
<p>I am unsure if the <strong>libgazebo_ros_ackermann_drive</strong> I used is still unavailable to ROS2 (I think this might not be the issue).</p>
<p>For the simple wheeled robot configured in the tutorial, the <strong>odom</strong> was published (it used the <strong>differential plugin instead</strong>).</p>
<p>Can someone figure out the issue and assist me in getting the odometry topic published?
My xacro is correct and opened on rviz and the gazebo.
My <a href="https://pastebin.com/iTGDf9SA" rel="nofollow noreferrer">launch_file</a></p>
<hr />
<p><a href="https://answers.ros.org/question/413847/nav2-odometry-for-ackermann-plugin/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/37882/vini71/" rel="nofollow noreferrer">Vini71</a> on ROS Answers with karma: 266 on 2023-03-28</p>
<p>Post score: 1</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/25940/stevemacenski/" rel="nofollow noreferrer">stevemacenski</a> on 2023-03-30</strong>:<br />
This doesn't seem directly related to Nav2, but instead your control / simulation plugins. You might want to change the question's name.</p>
|
Nav2 odometry for Ackermann plugin
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Alot is possible if you create your own plugins, but I don't think anything out of the box is going to help you much with that in ROS 1.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/25940/stevemacenski/" rel="nofollow noreferrer">stevemacenski</a> with karma: 8272 on 2023-03-30</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
|
103149
|
2023-03-29T04:46:35.000
|
|ros|navigation|global-planner|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hello,</p>
<p>I have a four-wheeled differential-drive robot. I have been able to build a map via SLAM where I would like to have the robot navigate about. The robot that I am utilizing does not have precise motor control (cannot translate and rotate simultaneously from specific commands reliably at commanded wheel velocities). However, I have observed that the robot is capable of performing separate translational (no rotation) and stationary rotational velocity commands well. I wanted to know if it is possible configure the local planner such that it only outputs either purely translational or rotational velocity commands at each instance. I am aware of the parameter <code>use_grid_path</code> in the <code>global_planner</code> node that configures the global path such that there are no curved regions of the path (so only translation or rotation can occur). However, I wanted to know if there is anything within the local planner or any other parameters that I would have to tune in order for this to work. It would be even more appreciative if one could show me some documentation that provides some form of a similar example to what I am describing. Both my robot and the remote computer that it interfaces with are using ROS noetic on Ubuntu 20.04.</p>
<hr />
<p><a href="https://answers.ros.org/question/413863/are-constant-velocity-commands-produced-by-local-planner-from-move_base-possible?/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/61268/devin1126/" rel="nofollow noreferrer">Devin1126</a> on ROS Answers with karma: 7 on 2023-03-29</p>
<p>Post score: 0</p>
|
Are constant velocity commands produced by local planner from move_base possible?
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>For anyone who is stuck with the same problem as me. The solution is that you have to create ros_control_controller_manager added to ros_control.xml file instead of building in gazebo.launch</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/108380/pra008/" rel="nofollow noreferrer">PRA008</a> with karma: 38 on 2023-04-03</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/160604/quangg.07/" rel="nofollow noreferrer">quangg.07</a> on 2023-07-10</strong>:<br />
Can you specifically show the solution, cause I can't find the ros_control.xml anywhere</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/108380/pra008/" rel="nofollow noreferrer">PRA008</a> on 2023-07-17</strong>:<br />
@quangg.07 Create controller manager in crX_moveit_controllers.yaml (CR_ROS > dobot_gazebo > config) then add new controller name in load controllers of ros_control.xml (CR_ROS > dobot_gazebo > launch)</p>
|
103151
|
2023-03-29T22:55:32.000
|
|ros|microcontroller|moveit|follow-joint-trajectory|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hi, I am using dobot cr5 with <a href="https://github.com/Dobot-Arm/CR_ROS" rel="nofollow noreferrer">this package</a> and want to control in <a href="https://ros-planning.github.io/moveit_tutorials/doc/realtime_servo/realtime_servo_tutorial.html" rel="nofollow noreferrer">realtime arm servoing tutorial</a>, but found the following problem</p>
<pre><code>[ INFO] [1680115539.325299331, 24.522000000]: Added FollowJointTrajectory controller for cr5_robot/joint_controller
[ WARN] [1680115544.378328009, 29.534000000]: Waiting for cr5_robot/joint_group_position_controller/follow_joint_trajectory to come up
[ WARN] [1680115550.434961614, 35.535000000]: Waiting for cr5_robot/joint_group_position_controller/follow_joint_trajectory to come up
[ERROR] [1680115556.490301391, 41.536000000]: Action client not connected: cr5_robot/joint_group_position_controller/follow_joint_trajectory
</code></pre>
<p>The commands I use are as follows</p>
<pre><code>gazebo.launch
moveit_planning_execution.launch sim:=True
moveit_rviz.launch config:=True
</code></pre>
<p>I've solved <a href="https://answers.ros.org/question/387763/waiting-for-dof_fitfollow_joint_trajectory-to-come-up-action-client-not-connected-dof_fitfollow_joint_trajectory/?fbclid=IwAR26zx_gDuPGyk-dib9ncGaetnymZBPt_EPE9OM1Z5-kovsnjf6G_ZF1n8E" rel="nofollow noreferrer">this problem</a> and <a href="https://answers.ros.org/question/296694/follow_joint_trajectory-action-client-not-connected/" rel="nofollow noreferrer">this</a>, which in gazebo.launch I add</p>
<pre><code><rosparam file="$(find dobot_gazebo)/config/cr5_moveit_controllers.yaml" command="load"/>
<node name="joint_controller_spawner" pkg="controller_manager" type="controller_manager" args="spawn cr5_robot/joint_controller" respawn="false" output="screen"/>
<node name="ros_control_controller_manager" pkg="controller_manager" type="controller_manager" respawn="false" output="screen" args="load cr5_robot/joint_group_position_controller" />
</code></pre>
<p>in cr5_moveit_controllers.yaml I have modified controller list as below, I try to add joint_group_position_controller to it. (I've tried building without cr5_robot but it didn't work.)</p>
<pre><code>cr5_robot:
joint_state_controller:
type: joint_state_controller/JointStateController
publish_rate: 50
joint_controller:
type: position_controllers/JointTrajectoryController
joints:
- joint1
- joint2
- joint3
- joint4
- joint5
- joint6
constraints:
goal_time: 0.6
stopped_velocity_tolerance: 0.05
joint1: {trajectory: 0.1, goal: 0.1}
joint2: {trajectory: 0.1, goal: 0.1}
joint3: {trajectory: 0.1, goal: 0.1}
joint4: {trajectory: 0.1, goal: 0.1}
joint5: {trajectory: 0.1, goal: 0.1}
joint6: {trajectory: 0.1, goal: 0.1}
stop_trajectory_duration: 0.5
state_publish_rate: 25
action_monitor_rate: 10
joint_group_position_controller:
type: position_controllers/JointGroupPositionController
joints:
- joint1
- joint2
- joint3
- joint4
- joint5
- joint6
</code></pre>
<p>and in moveit_planning_excution.launch have added</p>
<pre><code><remap if="$(arg sim)" from="/follow_joint_trajectory" to="/cr5_robot/joint_controller/follow_joint_trajectory"/>
</code></pre>
<p>I used to change the remap to cr5_robot/joint_group_position_controller/follow_joint_trajectory didn't work either.
The result of all the fixes is that cr5_robot/joint_controller can be used normally but I still get stuck Waiting for cr5_robot/joint_group_position_controller/follow_joint_trajectory to come up and have rqt_graph as picture.</p>
<p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16801479681598007.png" alt="image description" /></p>
<p>which added ros_control_controller_manager according to the tutorial, it shouldn't be extracted like this.
Anyway, this fix I've done on the Kuka KR16 and it worked but it didn't work this time.</p>
<p>P.S. If I change the type from position_controllers/JointGroupPositionController to position_controllers/JointTrajectoryController, it can be summoned successfully, but it won't be right.</p>
<hr />
<p><a href="https://answers.ros.org/question/413888/waiting-for-joint_group_position_controller/follow_joint_trajectory-to-come-up/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/108380/pra008/" rel="nofollow noreferrer">PRA008</a> on ROS Answers with karma: 38 on 2023-03-29</p>
<p>Post score: 0</p>
|
Waiting for joint_group_position_controller/follow_joint_trajectory to come up
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Accidentally, I used the wrong Version of zlib1.dll. Maybe this was the same issue for you @Proxeus.</p>
<p>Extracting <a href="https://www.zlatkovic.com/pub/libxml/64bit/zlib-1.2.8-win32-x86_64.7z" rel="nofollow noreferrer">zlib-1.2.8-win32-x86_64.7z</a> and adding its location to my PTAH variable fixed it for me.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/148223/soren/" rel="nofollow noreferrer">Soren</a> with karma: 26 on 2023-05-09</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
|
103153
|
2023-03-30T08:28:25.000
|
|ros|ros2|windows10|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I installed ROS 2 humble on Windows and followed all the dependency steps, and tested packages like turtlesim without any problems. However, when I try to use rviz2 by using the command "rviz2" or "ros2 run rviz2 rviz2", it gives me an error message that I need zlib.dll. I downloaded and moved it to the ROS 2 bin folder, but then it prompted me that I also need zlib1.dll. I downloaded it as well and moved it to the same folder, but then it gave me an error message saying that it could not initialize (0xc000007b).</p>
<p>I believe this error occurs due to DLL conflicts, but I am unsure which DLLs are conflicting with rviz2. Has anyone else encountered this error before? And if so, how can it be resolved?</p>
<hr />
<p><a href="https://answers.ros.org/question/413905/rviz2-dll-conflic-with-zlib1.dll-(windows-10)/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/75451/proxeus/" rel="nofollow noreferrer">Proxeus</a> on ROS Answers with karma: 13 on 2023-03-30</p>
<p>Post score: 1</p>
|
rviz2 dll conflic with zlib1.dll (Windows 10)
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Tried it now and yes, it is possible. However, it depends on whether the visualization tool can parse these web URLs or not. I tried it with Rviz and Foxglove and it works.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/28154/adityakamath/" rel="nofollow noreferrer">adityakamath</a> with karma: 30 on 2023-04-02</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 0</p>
|
103155
|
2023-03-31T06:25:24.000
|
|ros|ros2|urdf|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I'm trying to figure out if I can add meshes to a URDF using HTTPS URLs instead of using package:// or file://. I wasn't able to find any references about it online, or even any info stating it's not possible.</p>
<p>Is it possible to add meshes this way? I'm using ROS 2 Humble.</p>
<hr />
<p><a href="https://answers.ros.org/question/413934/adding-meshes-to-urdf-using-https-urls/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/28154/adityakamath/" rel="nofollow noreferrer">adityakamath</a> on ROS Answers with karma: 30 on 2023-03-31</p>
<p>Post score: 1</p>
|
Adding meshes to URDF using HTTPS URLs
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<blockquote>
<p>I think I am just launching the camera (raspicam_node) and suddenly out of nowhere comes a dynamic reconfigure.</p>
</blockquote>
<p>I'm almost certain this is the default behaviour for <code>dynamic_reconfigure</code> servers.</p>
<p>See #q28327 fi (also the answer by @joq ), #q250134 and finally the source of <code>dynamic_configure</code>'s <code>Server::setCallback(..)</code> itself (from <a href="https://github.com/ros/dynamic_reconfigure/blob/2654f228adae0848c6e9b70fcf07f890ca6a2841/include/dynamic_reconfigure/server.h#L85-L91" rel="nofollow noreferrer">here</a>):</p>
<blockquote>
<pre><code>void setCallback(const CallbackType &callback)
</code></pre>
</blockquote>
<pre><code>{
boost::recursive_mutex::scoped_lock lock(mutex_);
callback_ = callback;
callCallback(config_, ~0); // At startup we need to load the configuration with all level bits set. (Everything has changed.)
updateConfigInternal(config_);
}
</code></pre>
<p>Notice how it calls <code>callCallback(..)</code> right after storing the <code>callback</code> is assigned to <code>callback_</code> (ie: the member variable).</p>
<p>This lets the server load the default values for all parameters using the same callback that is used to handle any incoming reconfigure requests from actual clients.</p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> with karma: 86574 on 2023-04-03</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/30692/pitosalas/" rel="nofollow noreferrer">pitosalas</a> on 2023-04-03</strong>:<br />
You're correct. The surprising thing is that this overrides parameters set in the launch file in favor of the default parameters specified in the dynamic configure setup.</p>
<p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-04-03</strong>:<br />
That's discussed in #q250134.</p>
<p>Seems to be a problem in the node, not of <code>dynamic_reconfigure</code> itself.</p>
|
103157
|
2023-04-02T20:52:41.000
|
|ros|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I know that's imposible. Help me spot my mistake. I think I am just launching the camera (raspicam_node) and suddenly out of nowhere comes a dynamic reconfigure. I was playing with that before but now to troubleshoot as far as I can tell, everything is off and all I have is:</p>
<pre><code>/base_link_to_camera
/raspicam_node
/rosout
</code></pre>
<p>And yet, see the call too dynamic reconfigure in this log. I know I am not understanding some detail, but I can't figure out what!.</p>
<p>Thanks,</p>
<p>Pito</p>
<pre><code>PARAMETERS
* /raspicam_node/camera_frame_id: raspicam
* /raspicam_node/camera_id: 0
* /raspicam_node/camera_info_url: package://raspica...
* /raspicam_node/camera_name: camerav2_1280x960
* /raspicam_node/enable_imv: False
* /raspicam_node/enable_raw: False
* /raspicam_node/exposure_mode: antishake
* /raspicam_node/framerate: 10
* /raspicam_node/height: 960
* /raspicam_node/private_topics: True
* /raspicam_node/shutter_speed: 0
* /raspicam_node/vFlip: 0
* /raspicam_node/width: 1280
* /rosdistro: noetic
* /rosversion: 1.15.14
NODES
/
base_link_to_camera (tf/static_transform_publisher)
raspicam_node (raspicam_node/raspicam_node)
auto-starting new master
process[master]: started with pid [2579]
ROS_MASTER_URI=http://100.64.81.29:11311
setting /run_id to 15542e90-d1c1-11ed-a130-518a9bdbf4c9
process[rosout-1]: started with pid [2589]
started core service [/rosout]
process[raspicam_node-2]: started with pid [2596]
process[base_link_to_camera-3]: started with pid [2597]
[ INFO] [1680486285.632388511]: splitter component done
[ INFO] [1680486285.872005087]: camera calibration URL: package://raspicam_node/camera_info/camerav2_1280x960.yaml
[ INFO] [1680486286.080336951]: Camera successfully calibrated from default file
[ INFO] [1680486286.080749447]: using default calibration URL
[ INFO] [1680486286.081100851]: camera calibration URL: file:///home/ubuntu/.ros/camera_info/camerav2_1280x960.yaml
[ INFO] [1680486286.081757617]: Unable to open camera calibration file [/home/ubuntu/.ros/camera_info/camerav2_1280x960.yaml]
[ WARN] [1680486286.082066000]: Camera calibration file /home/ubuntu/.ros/camera_info/camerav2_1280x960.yaml not found.
[ INFO] [1680486286.082351102]: No device specifc calibration found
[ INFO] [1680486286.222915249]: Reconfigure Request: contrast 0, sharpness 0, brightness 50, saturation 0, ISO 400, exposureCompensation 0, videoStabilisation 0, vFlip 1, hFlip 0, zoom 1.00, exposure_mode antishake, awb_mode auto, shutter_speed 0
[ INFO] [1680486286.290719372]: Starting video capture (1280, 960, 80, 10)
[ INFO] [1680486286.292337641]: Video capture started!!
</code></pre>
<hr />
<p><a href="https://answers.ros.org/question/413992/dynamic-recongure-callback-seems-to-happen-spontaneously/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/30692/pitosalas/" rel="nofollow noreferrer">pitosalas</a> on ROS Answers with karma: 628 on 2023-04-02</p>
<p>Post score: 0</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/5184/gvdhoorn/" rel="nofollow noreferrer">gvdhoorn</a> on 2023-04-03</strong>:<br />
PS: for future questions: please always either link to the wiki page for the package you are using, or a source repository.</p>
<p>There are multiple <code>raspicam_node</code> packages with the exact same name, but in completely disconnected repositories. Without more information from you to uniquely identify <em>which</em> one you are using, it's impossible to be certain.</p>
|
Dynamic Recongure callback seems to happen spontaneously
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>I have found a solution and posted it on projects GitHub.
Link to post: <a href="https://github.com/Dobot-Arm/CR_ROS/issues/13#issuecomment-1620089835" rel="nofollow noreferrer">https://github.com/Dobot-Arm/CR_ROS/issues/13#issuecomment-1620089835</a></p>
<hr />
<p>Originally posted by <a href="https://answers.ros.org/users/157405/theabraham/" rel="nofollow noreferrer">TheAbraham</a> with karma: 26 on 2023-07-04</p>
<p>This answer was <strong>ACCEPTED</strong> on the original site</p>
<p>Post score: 1</p>
<hr />
<h3>Original comments</h3>
<p><strong>Comment by <a href="https://answers.ros.org/users/108380/pra008/" rel="nofollow noreferrer">PRA008</a> on 2023-07-05</strong>:<br />
Thank for your answer! This is a problem that I've given up and left for a very long time. Now you saved me, thank you very much.</p>
|
103159
|
2023-04-03T07:19:15.000
|
|microcontroller|gazebo|rviz|moveit|
|
<p><img src="https://i.stack.imgur.com/yuGTR.png" alt="Rosanswers logo" /></p>
<p>Hi, I'm having trouble controlling a real robot with <a href="https://github.com/Dobot-Arm/CR_ROS" rel="nofollow noreferrer">this package</a>.</p>
<p>The robot can connect and move normally, but the problem is that the robot's start state does not change according to the current state.</p>
<p>Of course I didn't forget to check and change the start state to current already.</p>
<p><img src="https://ftp.osuosl.org/pub/ros/download.ros.org/downloads/se_migration/ros/16805238681490033.jpg" alt="image description" /></p>
<p>From the picture, when I press plan, the real current status disappears immediately and will start showing movement to the position from the start state (Home pose) instead.</p>
<p>As a result, every time the real robot moves (execute), the state on rviz is incorrect. When changing the trajectory, the real robot will go back to the Home pose first then change to the new position.</p>
<p>This is a problem that I can't switch to other control with. I can't use JointPositionController instead of JointTrajectoryController , because it (joint state) still understands that I am still in Home position.</p>
<p>I want to know what could be the cause. How should I check and where to fix it?</p>
<p>Please help me.</p>
<p>P.S. Thank you all.</p>
<hr />
<p><a href="https://answers.ros.org/question/414002/start-state-does-not-change-according-to-current-state/" rel="nofollow noreferrer">Originally posted</a> by <a href="https://answers.ros.org/users/108380/pra008/" rel="nofollow noreferrer">PRA008</a> on ROS Answers with karma: 38 on 2023-04-03</p>
<p>Post score: 0</p>
|
Start state does not change according to current state
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.