Giter Site home page Giter Site logo

ros_tutorials's People

Contributors

adamheins avatar bulwahn avatar dirk-thomas avatar flynneva avatar fujitatomoya avatar iandanforth avatar jarvisschultz avatar javajeremy avatar jihoonl avatar lucasw avatar mirzashah avatar muratsevim avatar nuclearsandwich avatar seanyen avatar sloretz avatar tfoote avatar tiryoh avatar wjwwood avatar wkentaro avatar wmmc88 avatar zhoulaifu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ros_tutorials's Issues

Adding holonomic motion disable (differential drive motion only) option to turtlesim

I created the issue #93 and the related PR because I believe it will be useful in introducing beginners that it is possible to work with holonomic motion.
However, it seems that if this option is always enabled, it may sometimes disturb the learning process for beginning students.
This is not what I want to do.

I just find out that the turtle is holonomic now. Because I am teaching ROS these years so want to share some thoughts here though this issue is closed.

Introducing the holonomic movement into Turtlesim is great, it does not change the learning experience. And I also want this feature to test some easy multi-robot formation or cooperation stuff. However, it brings in some confusion during learning TF using turtle_tf. My students now solve the problem mainly based on the global info, the relation between two turtles can be ignored and you can command the follower based on v.x and v.y with a zero-valued a.z. A differential model may indicate that the follower must perceive the target turtle.

Moreover, the kinematic model of the turtle is no longer the same as a Turtlebot.

It won't be a problem during our class. I don't know how this will affect the self-learner. I think your intuition is considerable @dirk-thomas . I prefer a default differential turtle and can be switched to omni-directional.

best regards,

Originally posted by @tianb03 in #93 (comment)

I think It would be nice to have an option to disable holonomic motion as @jacobperron mentions, so I'm going to submit a pull request for the option to disable it.
How do you think the options should be able to be specified, @tianb03, @jacobperron?
(If I should ask someone else, please let me know.)
I believe that rosparam is easier to specifying both from the command line and the roslaunch like the teleop_twist_keyboard.

e.g.)

rosrun turtlesim turtlesim_node _holonomic:=false
<arg name="holonomic" default="false" />
<node pkg="turtlesim" name="sim" type="turtlesim_node">
  <param name="holonomic" value="$(arg false)" />
</node>

Angle wrapping in draw_square.cpp

Now that this commit has been merged, the turtlesim is guaranteed for its pose to always be in [-pi, pi). However, when checking if the turtle has reached its goal, a simple fabs is used. This results in the turtle never being able to complete its square as reported in this answers.ros.org question.

A very easy fix was to include angles as a dependency and then use angles::shortest_angular_distance. If we are okay with modifying dependencies for this package, then I'd happily open a PR from my fork. We could, of course, also write a similar function inline if we didn't want to modify dependencies.

Trailing newline missing from show srv output

Running

  ros2 interface show turtlesim/srv/Spawn.srv

returns:

float32 x
float32 y
float32 theta
string name # Optional.  A unique name will be created and returned if this is empty
---
string namemarya@marya-ThinkPad-T480:~$

There is no trailing newline after the output.

turtlesim: Support commanding the turtles with holonomic motion

I made a change to turtlesim and support commanding the turtles with holonomic motion, like an omni-directional robot.

https://github.com/Tiryoh/omni_turtlesim_ros2

Image from Gyazo

At first I was going to release it as a separate package, but I was advised to integrate it into this package (ros/rosdistro#25854).

Is it possible to integrate this feature into turtlesim? I'd like to open the PR to the following branches if this feature would be welcome.

  • melodic-devel
  • noetic-devel
  • dashing-devel
  • eloquent-devel
  • foxy-devel

Why "subs_.push_back" in listener_with_userdata.cpp

  1. What is the meaing for push_back() here and why we use vector to manage the construction of the three different chatterCallback?
  2. Why can not use the bellowing codes
void init()
  {
    node_handle_.subscribe<std_msgs::String>("chatter", 1000, boost::bind(&Listener::chatterCallback, this, _1, "User 1"));
    node_handle_.subscribe<std_msgs::String>("chatter", 1000, boost::bind(&Listener::chatterCallback, this, _1, "User 2"));
    node_handle_.subscribe<std_msgs::String>("chatter", 1000, boost::bind(&Listener::chatterCallback, this, _1, "User 3"));
  }

to initialse the different callback function?

[Rolling] Cannot use turtle_teleop_key arrow keys

$ apt show ros-rolling-turtlesim
Package: ros-rolling-turtlesim
Version: 1.3.1-3focal.20210413.161614
Priority: optional
Section: misc
Maintainer: Mabel Zhang <[email protected]>
Installed-Size: 3457 kB
Depends: libc6 (>= 2.14), libgcc-s1 (>= 3.0), libpython3.8 (>= 3.8.2), libqt5core5a (>= 5.12.2), libqt5gui5 (>= 5.2.0) | libqt5gui5-gles (>= 5.2.0), libqt5widgets5 (>= 5.0.2), libstdc++6 (>= 9), ros-rolling-fastcdr, libqt5gui5, ros-rolling-ament-index-cpp, ros-rolling-geometry-msgs, ros-rolling-rclcpp, ros-rolling-rclcpp-action, ros-rolling-rosidl-default-runtime, ros-rolling-std-msgs, ros-rolling-std-srvs, ros-rolling-ros-workspace
Homepage: http://www.ros.org/wiki/turtlesim
Download-Size: 409 kB
APT-Manual-Installed: yes
APT-Sources: http://packages.ros.org/ros2/ubuntu focal/main amd64 Packages
Description: turtlesim is a tool made for teaching ROS and ROS packages.

Steps to reproduce

In one terminal, launch turtlesim

$ ros2 run turtlesim turtlesim_node
QStandardPaths: XDG_RUNTIME_DIR points to non-existing path '/run/user/1000', please create it with 0700 permissions.

(process:1637229): Gtk-WARNING **: 16:08:22.656: Locale not supported by C library.
	Using the fallback 'C' locale.
QStandardPaths: XDG_RUNTIME_DIR points to non-existing path '/run/user/1000', please create it with 0700 permissions.
Qt: Session management error: None of the authentication protocols specified are supported
[INFO] [1618441702.681063611] [turtlesim]: Starting turtlesim with node name /turtlesim
[INFO] [1618441702.682450503] [turtlesim]: Spawning turtle [turtle1] at x=[5.544445], y=[5.544445], theta=[0.000000]
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast

In another terminal, launch turtle_teleop_key

$ ros2 run turtlesim turtle_teleop_key
Reading from keyboard
---------------------------
Use arrow keys to move the turtle.
Use G|B|V|C|D|E|R|T keys to rotate to absolute orientations. 'F' to cancel a rotation.
'Q' to quit.

Use the arrow keys. The turtle does not move.

turtlesim without graphical frontend

I have not found it, but I would like to ask if it would be possible to execute turtlesim_node without graphical frontend.

It sounds strange and let me explain a bit more. I'm giving a ROS course and I would like to review the exercises of my students in a CI script, and AFAIK I cannot execute (or have sense) turtlesim_node without graphical (or can I?). So, just to test if a service or topic is created in a turtlesim client I need to execute it. If I could run turtlesim_node in some text mode, or just some kind of blind mode, I could then run some test to check it.

Is it possible?

Wiki docs for turtlesim are out of date.

The ROS node docs (and possibly others) on the main page of the wiki don't reflect the update from velocity to geometry_msgs/Twist in Hydro.

This probably needs to be updated in the doxygen files in the source.

catkin_make error

I cloned this repository to a local directory "try_ros/src", and then catkin_make produced an error below. Not sure how to work around it. Any idea?

-- ~~  traversing 4 packages in topological order:
...
CMake Error at /opt/ros/melodic/share/catkin/cmake/catkin_workspace.cmake:95 (message):
  This workspace contains non-catkin packages in it, and catkin cannot build
  a non-homogeneous workspace without isolation.  Try the
  'catkin_make_isolated' command instead.
Call Stack (most recent call first):
  CMakeLists.txt:67 (catkin_workspace)
...

turtlesim does not install .svg images

Turtlesim uses both .png and .svg images for turtles (currently the only .svg image is "hydro.svg"), but the cmake file only installs the .png images. The result of this is that occasionally a spawned turtle will not appear on screen.

In turtlesim/CMakeLists.txt, the lines

install(DIRECTORY images
  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
  FILES_MATCHING PATTERN "*.png")

should be changed to

install(DIRECTORY images
  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
  FILES_MATCHING PATTERN "*.png" PATTERN "*.svg")

The simulated turtle moves to a wrong direction with very large linear velocity

The simulated turtle moves in a wrong direction if the linear velocity is very large. This issue can be reproduced with the following steps.

  1. Launch in a terminal the ROS master node with roscore.
  2. Launch in another terminal turtlesim_node with "rosrun turtlesim turtlesim_node`.
  3. Publish a message from the command line in a third terminal in the /turtle1/cmd_vel topic: rostopic pub /turtle1/cmd_vel geometry_msgs/Twist '[10000000000000000,0,0]' '[0,0,0]'.

It can be seen that the published message is a velocity of type geometry_msgs/Twist. This velocity comes with a large linear speed in the x-axis, and 0 in the y-axis and z-axis. Thus, the simulated turtle is expected to move horizontally. In the current implementation, however, the turtle moves to the bottom-right direction (see screenshot below). Also, If we change the "10000000000000000" part in step 3 to a smaller number, say, "100000000", then the simulated turtle will move horizontally as expected.

The issue, in my humble opinion, is due to floating-point inaccuracy. I can provide a pull request if needed.

wrongangle

Typo in error message

I don't have permission to fix this myself, but there's a typo in turtlesim/src/turtle_frame.cpp line 119

"A turtled named [%s] already exists"

Needs to be turtle. This is an error message that will be seen by people going through the turtlesim tutorial, so it needs to be fixed.

Missing rolling-devel branch

There's a tutorial in Rolling that expects the rolling-devel branch to exist here, but there's none. We could drop that reference, but should there be a rolling-devel branch? I see no master nor ros2 branch either. It appears we've been creating distro specific branches as we go here (e.g. see #100).

[ROS 2] Add actions to turtlesim

Turtlesim doesn't have any actions, but I think it's important for the sake of the tutorials that it include at least one simple action. Actions are one of the core concepts that need to be introduced, and it would damage the tutorial set if we had to switch to another example just for the sake of explaining actions.

One simple action with some kind of feedback that users can see is all that's needed.

Segmentation fault in ros::NodeHandle::destruct()

I am trying to spawn pr2(xacro) in empty world gazebo along with its controllers using pr2_controller_manager. But whenever I try to roslaunch it's launch file I get the following segmentation fault:-

Thread 28 "gzserver" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fff63ffd700 (LWP 13263)] 0x00007fffc96ac0ed in ros::NodeHandle::destruct() () from /opt/ros/kinetic/lib/libroscpp.so

And its backtrace is :-

`#0 0x00007fffc96ac0ed in ros::NodeHandle::destruct() () from /opt/ros/kinetic/lib/libroscpp.so

#1 0x00007fffc96ac269 in ros::NodeHandle::~NodeHandle() () from /opt/ros/kinetic/lib/libroscpp.so

#2 0x00007fff105a54b4 in pr2_controller_manager::ControllerManager::~ControllerManager() ()
from /home/deadmanlogan/i_am_from_source/catkin_ws/devel_isolated/pr2_controller_manager/lib/libpr2_controller_manager.so

#3 0x00007fff105a5ed9 in pr2_controller_manager::ControllerManager::~ControllerManager() ()
from /home/deadmanlogan/i_am_from_source/catkin_ws/devel_isolated/pr2_controller_manager/lib/libpr2_controller_manager.so

#4 0x00007fff184b480a in gazebo::GazeboRosControllerManager::~GazeboRosControllerManager() ()
from /home/deadmanlogan/i_am_from_source/catkin_ws/devel_isolated/pr2_gazebo_plugins/lib/libgazebo_ros_controller_manager.so

#5 0x00007fff184b4996 in gazebo::GazeboRosControllerManager::~GazeboRosControllerManager() ()
from /home/deadmanlogan/i_am_from_source/catkin_ws/devel_isolated/pr2_gazebo_plugins/lib/libgazebo_ros_controller_manager.so

#6 0x00007ffff5ba80c9 in boost::checked_deletegazebo::ModelPlugin (x=0x7fff0d795b90) at /usr/include/boost/core/checked_delete.hpp:34

#7 0x00007ffff5baadd6 in boost::detail::sp_counted_impl_pgazebo::ModelPlugin::dispose (this=0x7fff0d7955c0)
at /usr/include/boost/smart_ptr/detail/sp_counted_impl.hpp:78

#8 0x00007ffff59b4efe in boost::detail::sp_counted_base::release (this=0x7fff0d7955c0)
at /usr/include/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp:146

#9 0x00007ffff59b4f91 in boost::detail::shared_count::~shared_count (this=0x7fff63ffb3d8, __in_chrg=)
at /usr/include/boost/smart_ptr/detail/shared_count.hpp:443

#10 0x00007ffff5b9f086 in boost::shared_ptrgazebo::ModelPlugin::~shared_ptr (this=0x7fff63ffb3d0, __in_chrg=)
at /usr/include/boost/smart_ptr/shared_ptr.hpp:323

#11 0x00007ffff5b9a392 in gazebo::physics::Model::LoadPlugin (this=0x7fff3c24bf20, _sdf=std::shared_ptr (count 3, weak 5) 0x7fff368df950)
at /home/deadmanlogan/i_am_from_source/Gazebo-7/gazebo/physics/Model.cc:1002

#12 0x00007ffff5b999e2 in gazebo::physics::Model::LoadPlugins (this=0x7fff3c24bf20)
at /home/deadmanlogan/i_am_from_source/Gazebo-7/gazebo/physics/Model.cc:915

#13 0x00007ffff5c08bd9 in gazebo::physics::World::ProcessFactoryMsgs (this=0x11fbe70)
at /home/deadmanlogan/i_am_from_source/Gazebo-7/gazebo/physics/World.cc:1958

#14 0x00007ffff5c0b9de in gazebo::physics::World::ProcessMessages (this=0x11fbe70)
at /home/deadmanlogan/i_am_from_source/Gazebo-7/gazebo/physics/World.cc:2282

#15 0x00007ffff5c0069f in gazebo::physics::World::Step (this=0x11fbe70) at /home/deadmanlogan/i_am_from_source/Gazebo-7/gazebo/physics/World.cc:688

#16 0x00007ffff5bff06c in gazebo::physics::World::RunLoop (this=0x11fbe70) at /home/deadmanlogan/i_am_from_source/Gazebo-7/gazebo/physics/World.cc:481

#17 0x00007ffff5c2e413 in boost::_mfi::mf0<void, gazebo::physics::World>::operator() (this=0x12bff98, p=0x11fbe70)
at /usr/include/boost/bind/mem_fn_template.hpp:49

#18 0x00007ffff5c2d4be in boost::_bi::list1<boost::_bi::valuegazebo::physics::World* >::operator()<boost::_mfi::mf0<void, gazebo::physics::World>, boost::_bi::list0> (this=0x12bffa8, f=..., a=...) at /usr/include/boost/bind/bind.hpp:253

#19 0x00007ffff5c2b74a in boost::_bi::bind_t<void, boost::_mfi::mf0<void, gazebo::physics::World>, boost::_bi::list1<boost::_bi::valuegazebo::physics::World* > >::operator() (this=0x12bff98) at /usr/include/boost/bind/bind.hpp:893

#20 0x00007ffff5c3070a in boost::detail::thread_data<boost::_bi::bind_t<void, boost::_mfi::mf0<void, gazebo::physics::World>, boost::_bi::list1<boost::_bi::valuegazebo::physics::World* > > >::run (this=0x12bfde0) at /usr/include/boost/thread/detail/thread.hpp:116

#21 0x00007ffff35c65d5 in ?? () from /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.58.0

#22 0x00007ffff79086ba in start_thread (arg=0x7fff63ffd700) at pthread_create.c:333

#23 0x00007ffff64c741d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109`

Kindly advice what could be the reason.

Python nodes ending in .py

Currently, the catkin python install how to explicitly states:

To keep the user API clean, executable script names generally do not include a .py suffix.

However, the tutorials create nodes ending in .py. Now, the question is: which one applies?
If they indeed should not end in .py (which I personally would support because as the author of the catkin howto wrote, that's an implementation detail and not really relevant to the user), it would make sense if the Wiki Tutorials would either not create nodes ending in .py because most people will follow the tutorials when they create their own nodes or at least have a section about how normally you would strip the extension.

Edit: I just noticed that the catkin howto also proposes putting nodes in a nodes subfolder and other python scripts in a scripts subfolder which is also not consistent with the tutorials.

Incorrect shebang for Python script with Noetic

With Noetic, ROS has switched to Python 3 but the scripts in the tutorials still refer to pythonin their shebang:

#!/usr/bin/env python

but python doesn't exist on Ubuntu 20.04 so the script will just fail to run with:

/usr/bin/env: ‘python’: No such file or directory

Starting from Noetic the proper shebang is:

#!/usr/bin/env python3

This should be fixed in this repo and in the wiki

Data races in turtlesim

I am testing the turtlesim package with ThreadSanitizer, aka TSan, a GCC/Clang feature for detecting data races. Below is one (among many) data race detected by TSan. The location of the error is shown (using -g option).

To reproduce the issue, compile the package with "-fsanitize=thread -g", launch turtlesim_node, and then you will see the data race warning.

WARNING: ThreadSanitizer: data race (pid=20894)
  Write of size 8 at 0x7d1800017fa0 by main thread:
    #0 free <null> (libtsan.so.0+0x000000025819)
    #1 <null> <null> (libglib-2.0.so.0+0x000000047289)
    #2 main /home/zhfu/catkin_ws/src/turtlesim_official/src/turtlesim.cpp:60 (turtlesim_official_turtlesim_node+0x00000041d178)

  Previous write of size 8 at 0x7d1800017fa0 by thread T5:
    #0 calloc <null> (libtsan.so.0+0x00000002565d)
    #1 g_malloc0 <null> (libglib-2.0.so.0+0x00000004f810)

  Thread T5 'pool' (tid=20908, running) created by main thread at:
    #0 pthread_create <null> (libtsan.so.0+0x000000027577)
    #1 <null> <null> (libglib-2.0.so.0+0x00000008e8ff)
    #2 main /home/zhfu/catkin_ws/src/turtlesim_official/src/turtlesim.cpp:59 (turtlesim_official_turtlesim_node+0x00000041d173)

SUMMARY: ThreadSanitizer: data race ??:0 __interceptor_free

a independent package.xml and CMakeList.xml for a single package ?

About Python ros package:

i am not puzzled about the coding context , but the package building config has always troubling me all the time .

for example :

  • 1, what i need to do if i need to use cv2 and cv2_bridge wihin my project
  • 2, i need to subscribe image raw message from a camera's topic , what headers should be added into cmakelist and package?

recently , i meet a problem ,with building ready OK, but run python ros node reporting errors as below:

import: not authorized `os' @ error/constitute.c/WriteImage/1028.
import: not authorized `rospy' @ error/constitute.c/WriteImage/1028.
import: not authorized `np' @ error/constitute.c/WriteImage/1028.
import: not authorized `tf' @ error/constitute.c/WriteImage/1028.
from: can't read /var/mail/geometry_msgs.msg
from: can't read /var/mail/pose_estimation.srv
from: can't read /var/mail/sensor_msgs.msg
from: can't read /var/mail/cv_bridge
import: not authorized `cv2' @ error/constitute.c/WriteImage/1028.
import: not authorized `requests' @ error/constitute.c/WriteImage/1028.
/root/catkin_ws/src/pose_estimation/src/pose_estimation_server.py: 行 36:
/root/catkin_ws/src/pose_estimation/src/pose_estimation_server.py: 行 36: `bridge = CvBridge()'

i can not get help by reading the demo example CMakeLists ,
So, could you plz make the examples package building configs independent .

rosrun turtlesim turtlesim_node segmentation fault

I am new to ROS. I am working through the beginner's tutorials. Version: ROS Indigo, OS Kubuntu 14.04. I was trying rosrun turtlesim turtlesim_node and the result was: Segmentation fault ( core dumped). What can I do? Thanks in advance.

Command vel genrated using teleop_twist_keyboard stops turtle but not robot

Hello,

I have one issue in ROS
Using teleop_twist_keyboard we are generating cmd_vel messages(geometry_msgs/Twist) and this message are send to turtlesim_node where the turtle moves successfully.But if I suddenly stops sending command then the turtle stops moving .

Now similarly If I use teleop_twist_keyboard for my robot , I am sending cmd_vel to my robot then it moves successfully But If I suddenly stops sending command still the robots receive message and it is moving .
Please can anyone suggest what is difference and issue in this.

bad node names in rospy tutorials launch

rospy_tutorials/003_listener_with_user_data$ roslaunch listener_with_user_data.launch

WARNING: WARN: illegal <node> name 'talker-1'.
http://ros.org/wiki/Names
This will likely cause problems with other ROS tools.
Node xml is <node args="chatter:=chatter1" name="talker-1" pkg="rospy_tutorials" type="talker"/>
WARNING: WARN: illegal <node> name 'talker-2'.
http://ros.org/wiki/Names
This will likely cause problems with other ROS tools.
Node xml is <node args="chatter:=chatter2" name="talker-2" pkg="rospy_tutorials" type="talker"/>
WARNING: WARN: illegal <node> name 'talker-3'.
http://ros.org/wiki/Names
This will likely cause problems with other ROS tools.
Node xml is <node args="chatter:=chatter3" name="talker-3" pkg="rospy_tutorials" type="talker"/>

[Enhancement] - Add a "Range color sensor"

Hi,

I was thinking about adding a sensor to get the color ahead of the turtle as a "range sensor" but, instead of getting the distance, once the turtlesim is just a 2D simulator, get the color in a defined distance. The image below shows the idea of the behavior.

color_sensor

In the image is possible to see the turtle facing different color and publishing the RGB values at the topic turtle1/range_color_sensor that is also, showed in the image.

The idea of this new feature is making possible implement some behaviors like "obstacle detecting" and, once the turtle is basically a differential robot, it'll be possible to use the turtlesim as a platform to demonstrate different concepts and aspects of the mobile robots.

Do you think that is an interesting feature? If so I'll proceed with the first version to the PR.

does node mimic really publish the topic /output subscribe the topic /input?

In the document here,node mimic's Subscribed Topic is /input,Published topic is /output ,
but when i read the source code of mimic ,i found that node mimic subscribes the topic input/pose, Publishes the topic output/cmd_vel. where:

  ros::NodeHandle input_nh("input");
  ros::NodeHandle output_nh("output");
  twist_pub_ = output_nh.advertise<geometry_msgs::Twist>("cmd_vel", 1);
  pose_sub_ = input_nh.subscribe<turtlesim::Pose>("pose", 1, &Mimic::poseCallback, this);

it could be confusing ,because if i remap the topic in the launch file i will Write:

    <remap from="input" to="turtlesim1/turtle1/pose"/>
    <remap from="output" to="turtlesim2/turtle1/cmd_vel"/>

but in the end,mimic code subscribes the topic turtlesim1/turtle1/pose/pose,Publishes the topic turtlesim2/turtle1/cmd_vel/cmd_vel
obviously ,it doesn't work
i found one tutorial here ,the corresponding part of launch file is:

    <remap from="input" to="turtlesim1/turtle1"/>
    <remap from="output" to="turtlesim2/turtle1"/>

of course it works,but it seems to be contradict to the document in the beginning of this issue ,where:
Subscribed Topic is /input(message type is turtlesim/Pose),Published topic is /output(message type is geometry_msgs/Twist) .because turtlesim2/turtle1 and turtlesim1/turtle1 is node here.
do i misunderstand something ?thanks a lot!

Release of version 0.4.0 is missing some commits from groovy-devel

Probably due to some branch confusion, some commits from 0.3.13 were dropped in version 0.4.0. I believe that the commits

66bd5c8
1e559b3
d75909c
a7de3a7

from Dirk Thomas should be rebased to hydro-devel and a new version with these commits should be released.

Especially, commit "check for CATKIN_ENABLE_TESTING" is important for the OpenEmbedded integration with meta-ros (github.vom/bmwcarit/meta-ros).

keyboard cannot work when running "rosrun turtlesim turtle_teleop_key"

My enviroment is
NAME="Ubuntu"
VERSION="16.04.2 LTS (Xenial Xerus)"

kernel is 4.4.0-75-generic
running step is:

  1. roscore
  2. rosrun rosrun turtlesim turtlesim_node
  3. rosrun turtlesim turtle_teleop_key
    The result is : keyboard cannot work to drive turtlebot move in simulator
    the root cause is
    88 if(read(kfd, &c, 1) < 0)
    89 {
    91 perror("read():");
    92 exit(-1);
    93 }
    line 88: read function is being hung there, cannot running down to publish turtle1/cmd_vel topic.

I suggest you to change the node names.

$ rosrun turtlesim turtlesim_node
$ rosrun turtlesim turtle_teleop_key

$ rosnode list
/rosout
/teleop_turtle
/turtlesim

We usually use the commands above. I think that a beginner confuse the node names, because executable node name and real name are different. The turtlesim package is one of the tutorials for beginner. So, I suggest you to change the node names. How about that?

  1. turtlesim_node VS turtlesim
  2. turtle_teleop_key VS teleop_turtle

ros_tutorials/turtlesim/tutorials/teleop_turtle_key.cpp
......
ros::init(argc, argv, "teleop_turtle");
.....

turtlesim_node bug on slow computers

The turtlesim_node simulator updates the position of the turtle at a frequency of 62.5 hz (once every 16 ms).
I'm running it through docker on a macbook air 2015, which is so crappy the simulator falls behind, causing bugs.
For example, hitting the teleop once (forward arrow), causes a velocity of 2 unit/s to be sent to the simulator, and according to the semantics of the simulator (http://wiki.ros.org/turtlesim#line-324), this command is executed for 1 second (if no other command is sent during this time).
This means the turtle should end up 2units further after 1s. My turtle only moves by 0.8 units (varries, sometimes less sometimes a bit more, but never more than 1 unit).

[ros2 turtlesim] normalizeAngle takes double-sized data as float

Hi.
In turtle.cpp for ros2 turtlesim, normalizeAngle takes a float as an argument.
However, the data passed into the function is of size double when the function is called, and gets truncated to become nan.

...
ang_vel_ = vel->angular.z; // type of geometry_msgs::msg::Twist.angular.z is float64 (double)
...
orient_ = orient_ + ang_vel_ * dt; // orient_ is of type qreal, which is double
orient_ = normalizeAngle(orient_); // double-sized data gets truncated to nan

When a control program publishes to /cmd_vel a Twist message in which angular.z is set to a double-sized value, normalizeAngle ends up returning nan. As a result, orient_ becomes nan, and accordingly, theta, x, y of the turtle's Pose becomes nan in the subsequent lines. This effectively removes the turtle from the frame. The "clamping" logic fails to put the turtle back in the frame, as it compares nan with integers.

e.g., Published message:

geometry_msgs.msg.Twist(
    linear=geometry_msgs.msg.Vector3(x=0.0, y=0.0, z=0.0),
    angular=geometry_msgs.msg.Vector3(x=0.0, y=0.0, z=-4.0e+214)
)

Result:
1
2

Tested and confirmed on the foxy-devel branch, but this problem affects all ros2 branches.

[ros2 turtlesim] incorrect /spawn srv autocompletion

Typing following command and trying autocompletion (tab) produces following output:

ros2 service call /spawn turtlesim/srv/Spawn 
-r
--rate
x:\ 0.0\^Jy:\ 0.0\^Jtheta:\ 0.0\^Jname:\ \'\'\

However, adding an x after above statement, produces different output:

ros2 service call /spawn turtlesim/srv/Spawn x
ros2 service call /spawn turtlesim/srv/Spawn x:\ 0.0\
y:\ 0.0\
theta:\ 0.0\
name:\ \'\'\ 

Executing any of them produces errors:

yaml.scanner.ScannerError: mapping values are not allowed here
  in "<unicode string>", line 1, column 8:
    x: 0.0y: 0.0theta: 0.0name: '' 
           ^

The expected and working example should look like the one below.

ros2 service call /spawn turtlesim/srv/Spawn "{x: 0.0, y: 0.0, theta: 0.0, name: ''}"

Turtlesim /spawn service uses different coordinate system

The numbers used when spawning a turtle via the /spawn service are sent directly to the turtlesim::Turtle constructor in Qt coordinates. All other numbers used in the various topics and services are in a different coordinate system; e.g., /turtleX/pose topics and /turtleX/teleport_absolute services. What this means is that teleporting a turtle to a given (x,y) and spawning a turtle at the same (x,y) will result in turtles at two different locations.

See this answers.ros.org question.

[ROS 2] Invalid context error when stopping turtle_teleop_key

Sometimes during the shutdown of turtle_teleop_key (i.e. Ctrl-C), we see the following error:

[ERROR] [1590100346.240527469] [rclcpp]: failed to create wait set: the given context is not valid, either rcl_init() was not called or rcl_shutdown() was called., at /tmp/binarydeb/ros-foxy-rcl-1.0.0/src/rcl/wait.c:128
terminate called after throwing an instance of 'std::runtime_error'
  what():  Failed to create wait set in Executor constructor

Looks like an issue with the signal handling logic.

I've seen the same behavior with Fast-RTPS and CycloneDDS.

[ROS2 galactic windows] cannot start turtlesim - no Qt platform plugin could be initialized

ive followed the ros2 galactic installation instructions (installed Qt 6.2.0 instead of 5.15.0) and set the proper env vars as stated in the instructions for windows.

I've confirmed that the qwindows.dll exists in the path below when I copy & paste it into a finder window....just it seems I am missing something else.

Any advice would be extremely helpful!

 ros2 run turtlesim turtlesim_node
qt.qpa.plugin: Could not find the Qt platform plugin "windows" in "C:\Qt\6.2.0\msvc2019_64\plugins\platforms"
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

001_talker_listener/listener ends up error: "/usr/bin/env: ‘python’: No such file or directory"

I'm not (yet) super familliar with py2/3 conversion. That said I ran into this error when trying to run 001 tutorial on ROS Noetic.

# rosrun rospy_tutorials   001_talker_listener/listener
/usr/bin/env: ‘python’: No such file or directory

root@8cc76e28b8ea:/cws# env|grep -i py
ROS_PYTHON_VERSION=3
ROS_PACKAGE_PATH=/cws/src/ros_tutorials/ros_tutorials:/cws/src/ros_tutorials/roscpp_tutorials:/cws/src/ros_tutorials/rospy_tutorials:/cws/src/ros_tutorials/turtlesim:/opt/ros/noetic/share
PYTHONPATH=/cws/devel/lib/python3/dist-packages:/opt/ros/noetic/lib/python3/dist-packages

root@8cc76e28b8ea:/cws# python
bash: python: command not found
root@8cc76e28b8ea:/cws# python3
Python 3.8.5 (default, Jul 28 2020, 12:59:40) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 

FYI I've uploaded the Docker image where this repo is built in. You can do the same as above with:

$ docker images | grep tutorial
ee8d70335b66
$ docker run -it d130s/ros:noetic-ros-base_tutorial bash -c "source /cws/devel/setup.bash; echo $ROS_PYTHON_VERSION && rosrun rospy_tutorials   001_talker_listener/listener"
Code status
$ docker run -it d130s/ros:noetic-ros-base_tutorial bash -c "cd /cws/src/ros_tutorials && git branch -vv && git log -1"
* noetic-devel 74cc182 [origin/noetic-devel] added pointcoud2 example (#111)
commit 74cc182dce2bb7d221052d1d45fe4ad0e7705843 (HEAD -> noetic-devel, origin/noetic-devel, origin/HEAD)
Author: Evan Flynn <[email protected]>
Date:   Wed Feb 17 08:45:49 2021 -0800

    added pointcoud2 example (#111)

[ROS2-foxy] Cannot start turtlesim simulation and teleop nodes in one launch file

Hello! I am interested in porting Introduction to tf2 tutorial to ROS2, which is based on the turtlesim package. To do so, I wanted to port old turtlesim_tf2 package, but during the process I got stuck with one issue.

For some reason, I cannot start both turtlesim turtlesim_node and turtle_teleop_key nodes in one launch file. I tried using both .launch.py and .xml formats, but both had the same behavior. I launch the script and the window with turtle appears, but the turtle_teleop_key starts only after I interrupt the launch process with keyboard.

from launch import LaunchDescription
from launch_ros.actions import Node

def generate_launch_description():
    ld = LaunchDescription()
    sim_node = Node(
        package="turtlesim",
        executable="turtlesim_node",
        name="sim",
    )
    teleop_node = Node(
        package="turtlesim",
        executable="turtle_teleop_key",
        name="teleop",
        output="screen",
    )
    ld.add_action(sim_node)
    ld.add_action(teleop_node)
    return ld

and

<launch>
  <node pkg="turtlesim" exec="turtlesim_node" name="sim" output="screen"/>
  <node pkg="turtlesim" exec="turtle_teleop_key" name="teleop" output="screen"/>
</launch>

ROS 2 port ros_tutorials, roscpp_tutorials, and rospy_tutorials?

The packages ros_tutorials, roscpp_tutorials, and rospy_tutorials all have COLCON_IGNORE files in the ROS 2 branches. These have not been ported to ROS 2.

This is a ticket to decide if they should be ported, and if so how to go about it. The client library names are different in ROS 2 rclpy and rclcpp instead of rospy and roscpp, so at the very least they should be changed. It's possible that these already overlap with the ros2/examples repo.

[ros2 turtlesim] turtle.cpp needs to validate float32/float64 input variables

There are many places in the code that assume control inputs (i.e., x, y, and theta) are valid floating point numbers. As a result, when one of nan, -nan, inf or -inf is given, the turtle's position becomes infeasible (e.g., x being nan), sometimes even become rendering it uncontrollable.

  • Case 1: teleport_absolute service
    • In Turtle::update(), the requested x is directly used to set position (pos_.setX(req.pos.x());).
    • When nan or -nan is provided, turtle's x position becomes nan.
    • Requests with theta set to nan or inf make x, y, and theta of the turtle's pose nan, removing the turtle from the frame.
  • Case 2: teleport_relative service
    • Similarly, if linear and/or angular of teleport_relative request is set to nan or inf, turtle's position becomes infeasible.
  • Case 3: rotate_absolute action
    • Sending goal with theta set to nan or inf can have the turtle rotate indefinitely, as remaining becomes either nan or -nan.
    • This forces ang_vel_ to become 1.0 after executing the following statement: ang_vel_ = remaining < 0.0 ? -1.0 : 1.0;, as nan < 0.0 always evaluates to False.
  • Case 4: cmd_vel topic
    • linear.x, linear.y, and angular.z are not sanitized before being used. Similar to the previous cases, x, y and/or theta of turtle's pose are easily set to nan.

I suggest adding checks before using these variables, e.g., std::isnan and std::isinf, to prevent unexpected input values from polluting the turtle's state.

TurtleSim

I cannot get turtlesim to work for the life of me. I have tried all the ros answers discussion but nothing works and it just messes with my system files. When I try to run the command: rosrun turtlesim turtlesim_node I get the error:
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.

Aborted (core dumped)

Please help!

background colour parameters get set to default always

This line causes the parameters to get set the the default #defined values regardless if the values are set in the parameter server already or not. this makes it so that it is impossible to actually set the node to launch with a different background colour through a launch file. It should probably do something like

if(!nh_.hasParam("background_r")) {
  nh_.setParam("background_r",  DEFAULT_BG_R);
}

Also, the background colour parameters are relative to the node's public namespace, rather than its private one, so the typical syntax of using <param> tags within <node> tags would not work. These parameters should be in the private ns as the wikipage suggests.

If i get time tomorrow, i'll create a pr to possibly address this

Error in teleop_turtle_key.cpp "E0349 no operator "=" matches these operands"

Was having failures with colcon build --merge-install for the tutorial workspace build. After finding the source of the first error that shows up under inspection, the error appears in the file of the title, on line 318. I pulled this from the repo, is there any fix to this? This error is causing the colcon build to fail.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.