ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

thepirate16's profile - activity

2023-03-03 02:18:54 -0500 received badge  Famous Question (source)
2022-12-12 05:09:49 -0500 received badge  Nice Question (source)
2020-04-26 05:53:06 -0500 received badge  Famous Question (source)
2020-01-21 22:51:31 -0500 marked best answer rosserial connection not working with custom messages! [SOLVED]

Hi community!

I've got a problem, as the title suggests, with my custom messages used in arduino.

I publish here the arduino code and explain later:

#include <pkg1/Num.h>
#include <ros.h>
#include <std_msgs/String.h>


ros::NodeHandle  nh;

pkg1::Num type_Num;
std_msgs::String str_msg;

ros::Publisher chatter("chatter", &str_msg);
ros::Publisher PUB2("newmessage", &type_Num);

char hello[20]= "hello world";
int counter=0;

void setup()
{
  nh.initNode();
  nh.advertise(chatter);
}

void loop()
{
  type_Num.first_name = "danielooow";
  type_Num.last_name = "gonsaleeesss";
  type_Num.score = counter;
  PUB2.publish( &type_Num );
  str_msg.data = hello;
  chatter.publish( &str_msg );
  nh.spinOnce();
  counter++;
  delay(100);
}

As you see, the code is only an expansion of the HelloWorld example of ros_lib.

It compiles perfectly.

Once uploaded to my Arduino UNO, I call the rosserial connection:

~/catkin_ws$ rosrun rosserial_python serial_node.py _port:=/dev/ttyACM0

And i get this error:

    [INFO] [WallTime: 1458399926.066204] ROS Serial Python Node
    [INFO] [WallTime: 1458399926.072844] Connecting to /dev/ttyACM0 at 57600 baud
    [ERROR] [WallTime: 1458399943.176784] Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino

The thing is, when I upload the HelloWorld example, the connection works!! and the chatter topic is properly registered in the ROS master, but when I use the new code, it doesn't .

I just don't know what's going on here.

Thoughts:

  • I thought it could be a delay problem but removing the delay in the code hasn't made anything.
  • I also thought that maybe in the creation of the custom message there's a problem (something related with the CMakeLists.txt or the pakage.xml) but the message can be used in a normal non-arduino code, registering successfully in the ROS master and all that stuff, so that makes me doubt about it.
  • It's maybe that i have to use a second Node Handle??

For possible answers regarding using #define USE_USBCON -> i've already tried that and then the compiler says something about it requires the iostream library --> i just don't think that is the way to go for solving this (maybe i'm wrong i don't know..).

Thanks to everyone in advance. I would appreciate a detailed answer.


SOLVED!!! LOOK AT THE ANSWERS!


2020-01-21 22:51:31 -0500 received badge  Self-Learner (source)
2020-01-21 22:51:31 -0500 received badge  Teacher (source)
2019-12-12 06:24:37 -0500 received badge  Notable Question (source)
2019-10-28 20:11:52 -0500 received badge  Famous Question (source)
2019-07-23 05:51:21 -0500 received badge  Notable Question (source)
2019-07-23 05:51:21 -0500 received badge  Popular Question (source)
2018-11-16 03:49:09 -0500 marked best answer How to add message field in a rosbag

I got a rosbag with a number of topics being played. I am interested in adding a Header (more specifically, a frame_id) to the message received so some 3d points in it are automatically displayed in RViz in the correct frame defined.

Is this possible? I know you can iterate a rosbag with the type of loop:

for topic, msg, t in inbag.read_messages():

        if topic == "/desired_topic":

            outbag.write(topic,msg.h,t)

        if topic not in ["/desired_topic"]:
            outbag.write(topic,msg,t)

    outbag.close()

But I don't know how to add a field to the incoming message and save it in a new bag.

2018-11-16 03:49:07 -0500 received badge  Popular Question (source)
2018-11-15 10:05:59 -0500 edited question How to add message field in a rosbag

How to add message field in a rosbag I got a rosbag with a number of topics being played. I am interested in adding a He

2018-11-15 10:04:19 -0500 edited question How to add message field in a rosbag

How to add message field in a rosbag I got a rosbag with a number of topics being played. I am interested in adding a He

2018-11-15 10:03:59 -0500 asked a question How to add message field in a rosbag

How to add message field in a rosbag I got a rosbag with a number of topics being played. I am interested in adding a He

2018-09-10 01:10:11 -0500 received badge  Famous Question (source)
2018-07-24 12:24:32 -0500 received badge  Famous Question (source)
2018-05-27 10:20:11 -0500 received badge  Notable Question (source)
2018-05-25 02:34:20 -0500 received badge  Popular Question (source)
2018-05-24 16:57:57 -0500 marked best answer Unknown noise in uwsim 3D range mapping

I am working with UWSim, and I have modelled a rotating multibeam on the AUV (like a lidar on a car) that maps the 3D surroundings of the robot, creating a "range map".

I am facing a type of noise in my range values that I cannot determine (see photo). A part from the seafloor (shown above because I got a mess in the TF tree most probably and I haven't managed to put it below the AUV tf), one can see how sparse voxels are mapped as well.

image description

They appear behind the AUV (where there is nothing), and mapped at many different ranges.

Is the sonar assigning a wrong range to the tail of the AUV because of it being too close maybe?

2018-05-24 16:57:36 -0500 answered a question Unknown noise in uwsim 3D range mapping

I found the problem. The noise comes from false measurements of the sonar. The tail of the AUV might be too close to the

2018-04-02 06:10:48 -0500 commented question Vehicle not moving, but robot_localization shows motion

Have you checked that you are properly subscribed to the odometry topic in your visualizer? Also check that the origin f

2018-04-02 01:58:19 -0500 received badge  Notable Question (source)
2018-04-01 13:09:54 -0500 marked best answer Not able to visualize Octomap in RViz

I am publishing an octomap from a .bt file with octomap_server such that:

$ rosrun octomap_server octomap_server_node btFile.bt

But when I try to visualize the octomap in RViz, I am only getting this ¿occupancy base? (see image).

image description

As you see, it is clear that the transform from /map to blocks is not published. Does this need to be there to be able to visualize it? Also, it is saying that the frame blocks does not exist.

In OCTOVIS, I do not have this problem and the whole octomap is loaded successfully (see image below).

image description

How can I solve this?

2018-04-01 13:09:36 -0500 answered a question Not able to visualize Octomap in RViz

I solved it. Surprisingly, when I added the OccupancyMap by doing Add->By topic, it worked and the octomap appeared

2018-03-30 08:49:10 -0500 received badge  Popular Question (source)
2018-03-30 05:10:05 -0500 edited question Not able to visualize Octomap in RViz

Not able to visualize Octomap in RViz I am publishing an octomap from a .bt file with octomap_server such that: $ ro

2018-03-30 05:08:49 -0500 edited question Not able to visualize Octomap in RViz

Not able to visualize Octomap in RViz I am publishing an octomap from a .bt file with octomap_server such that: $ ro

2018-03-30 05:06:07 -0500 asked a question Not able to visualize Octomap in RViz

Not able to visualize Octomap in RViz I am publishing an octomap from a .bt file with octomap_server such that: $ ro

2018-03-22 03:38:40 -0500 marked best answer Is the .bt Octomap preserving the coordinates of the ROS environment it has been built from?

I think the title is self-explicative. I constructed an Octomap out of a robot moving in a simulated environment. In that environment, the coordinate (x1, y1, z1) with respect to the world frame was occupied by an obstacle. If I check the node (x1, y1, z1) of the created Octomap, will it be occupied, and if so, by the same obstacle? Or will the Octomap have assigned new coordinates based on the .bt file created?

Also, will it happen the same when the octomap is not in a .bt file and it is being updated continuously?

Thank you. This was also posted on Octomap's GitHub, so I will copy the answer given in one site to the other.

2018-03-22 03:38:22 -0500 answered a question Is the .bt Octomap preserving the coordinates of the ROS environment it has been built from?

As answered in Octomap's GitHub by @AHornung: https://github.com/OctoMap/octomap/issues/204 "The .bt format does not co

2018-03-19 09:19:48 -0500 asked a question Is the .bt Octomap preserving the coordinates of the ROS environment it has been built from?

Is the .bt Octomap preserving the coordinates of the ROS environment it has been built from? I think the title is self-e

2018-02-27 01:17:41 -0500 received badge  Famous Question (source)
2018-02-26 03:45:24 -0500 marked best answer Do I really need to $ source ~/catkin_ws/devel/setup.bash ?

Novice question:

I've created a custom message, package, etc as the official tutorial does. But when i do:

$ rosrun pkg_test1 pkg_test1_node

it gives me: [rospack] Error: package 'pkg_test1' not found

Indeed, if i do: $ source ~/catkin_ws/devel/setup.bash the problem is fixed. But do i really need to do that every time i want to use my custom programs? Is there any simple way to mantain them in the ROS path (i think that is what i am doing when i call these commands).

Thanks in advance.

2018-02-22 09:30:00 -0500 edited question Unknown noise in uwsim 3D range mapping

Problem making a joint rotate with attached multibeam to do 3D mapping I am working with UWSim, and I have modelled a ro

2018-02-22 09:25:18 -0500 asked a question Unknown noise in uwsim 3D range mapping

Problem making a joint rotate with attached multibeam to do 3D mapping I am working with UWSim, and I have modelled a ro

2018-02-16 04:20:50 -0500 edited answer Rosserial mbed comunication does not work

rosserial_python was a bit unstable when I used it to connect an Arduino to ROS. Could you try using rosserial_server in

2018-02-16 04:19:22 -0500 answered a question Rosserial mbed comunication does not work

rosserial_python was a bit unstable when I used it to connect an Arduino to ROS. Could you try using rosserial_server in

2018-02-14 13:50:41 -0500 marked best answer RViz doesn't load .dae mesh. Cannot locate it.

I am trying to load an underwater robot mesh in RViz. Because I could not do this with a .osg file, I converted it to .dae with Blender. Even though I have done that, RViz is still not able to load it (it doesn't even locate it although, of course, the file is there).

The file is called newestexport.dae.

The error is the following:

[ERROR] [1518623879.761036843]: Could not load resource [robot/nessie/newestexport.dae]: Unable to open file "robot/nessie/newestexport.dae". [ERROR] [1518623879.761668482]: Could not load model 'robot/nessie/newestexport.dae' for link 'nessie_base_link': OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource robot/nessie/newestexport.dae in resource group Autodetect or any other group. in ResourceGroupManager::openResource at /build/ogre-1.9-mqY1wq/ogre-1.9-1.9.0+dfsg1/OgreMain/src/OgreResourceGroupManager.cpp (line 756)

Also, Meshlab and Blender are able to open the mesh without any problem.

The name of the file is correct. So that is discarded.

Any thoughts?

EDIT: I show the .URDF file that calls the mesh:

    <?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="nessie" >

  <xacro:property name="pi" value="3.141592654" />

<link name="base_link">
      <origin rpy="3.141592654 0 3.141592654" xyz="0 0 0"/>
 </link>

<joint name="base_link_to_nessie_base_link" type="fixed">
    <parent link="base_link"/>
    <child link="nessie_base_link"/>
</joint>

  <link name="nessie_base_link">
    <inertial>
      <mass value="95" />
      <inertia ixx="100"  ixy="0"  ixz="0" iyy="100" iyz="0" izz="100" />
    </inertial>
    <visual>
      <origin rpy="-${pi/2} 0 ${pi}" xyz="-0.2 0 0.75"/>
      <geometry>
        <mesh filename="robot/nessie/newestexport.dae"/>
      </geometry>
    </visual>
  </link>


</robot>

Thank you.

UPDATE: If you change the path "robot/nessie/newestexport.dae" for ithe absolute path "/home/daniel/.uwsim/data/robot/nessie/newestexport.dae" it doesn't work, the error still appears. Nor if you put it in the /home/daniel folder.