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

cwillia109's profile - activity

2022-05-17 02:54:53 -0500 received badge  Notable Question (source)
2021-12-14 02:10:34 -0500 received badge  Famous Question (source)
2021-07-16 11:16:34 -0500 commented question "timeout expired" error on tb3 bringup

A solution would still be nice. This is holding up my work.

2021-07-10 11:42:39 -0500 received badge  Famous Question (source)
2021-06-29 18:43:42 -0500 received badge  Popular Question (source)
2021-06-28 20:37:26 -0500 asked a question How does ROS optimize topic routes in multi-machine setups?

How does ROS optimize topic routes in multi-machine setups? Let's say I have 3 ROS1 nodes all publishing and subscribing

2021-06-28 20:30:07 -0500 commented answer catkin_make unable to find actionlib in its original install location

I'm not the only one using the machine, so something along those lines might have happened thank you. Accepted as an ans

2021-06-28 20:29:48 -0500 marked best answer catkin_make unable to find actionlib in its original install location

It seems as though it is looking for actionlib in one of our catkin workspaces. It was installed to /opt/ros/kinetic/share/actionlib. Is there a way to correct how catkin finds it? Is there another issue causing this?

CMake Error at /home/user/catkin_ws/devel/share/actionlib/cmake/actionlibConfig.cmake:113 (message):
  Project 'actionlib' specifies
  '/home/user/catkin_ws/src/actionlib/actionlib/include' as an include dir,
  which is not found.  It does neither exist as an absolute directory nor in
  '/home/user/catkin_ws/src/actionlib/actionlib//home/user/catkin_ws/src/actionlib/actionlib/include'.
  Check the issue tracker 'https://github.com/ros/actionlib/issues' and
  consider creating a ticket if the problem has not been reported yet.
Call Stack (most recent call first):
  /opt/ros/kinetic/share/tf2_ros/cmake/tf2_rosConfig.cmake:197 (find_package)
  /opt/ros/kinetic/share/tf/cmake/tfConfig.cmake:197 (find_package)
  /opt/ros/kinetic/share/amcl/cmake/amclConfig.cmake:197 (find_package)
  /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:76 (find_package)
  basic_swarm/CMakeLists.txt:10 (find_package)

Edit: There are two workspaces. I'm working in workspace 2, I removed catkin_ws and now ws 2 makes fine. My new question is why did this happen to begin with?

2021-06-28 20:28:59 -0500 received badge  Notable Question (source)
2021-06-28 20:28:59 -0500 received badge  Popular Question (source)
2021-06-20 16:29:51 -0500 edited question catkin_make unable to find actionlib in its original install location

catkin_make unable to find actionlib in its original install location It seems as though it is looking for actionlib in

2021-06-20 16:05:55 -0500 asked a question catkin_make unable to find actionlib in its original install location

catkin_make unable to find actionlib in its original install location It seems as though it is looking for actionlib in

2021-05-07 07:46:58 -0500 received badge  Famous Question (source)
2021-04-23 16:45:48 -0500 commented question How can I suppress sigint-timeout and sigterm-timout options from roslaunch ?

I have this exact same issue. Have you found a solution yet?

2021-03-12 11:21:07 -0500 received badge  Famous Question (source)
2021-03-01 19:58:37 -0500 received badge  Famous Question (source)
2021-02-08 17:25:58 -0500 received badge  Notable Question (source)
2020-12-02 06:03:29 -0500 received badge  Notable Question (source)
2020-11-12 08:15:49 -0500 received badge  Nice Answer (source)
2020-10-22 12:54:49 -0500 commented answer How does one assign values to messages with arrays in C++

This worked like a charm. Thank you!

2020-10-22 12:54:32 -0500 marked best answer How does one assign values to messages with arrays in C++

This is probably more C++ focused, but here is my issue:

int8_t vi[height * width];
// vi has had work done on it between here
nav_msgs::OccupancyGrid debMap;
debMap.data = vi; // error here

The resulting error is:

no operator "=" matches these operands -- operand types are: std::vector<int8_t, std::allocator<int8_t>> = int8_t [height * width]

Now in python something like this would be an issue. In the past I have been using memcpy to get around this, but I am less certain that that is the approach to take for this.

How can I add array data to a message with an array.

2020-10-20 14:43:24 -0500 received badge  Notable Question (source)
2020-10-20 00:21:47 -0500 received badge  Popular Question (source)
2020-10-19 18:56:43 -0500 asked a question How does one assign values to messages with arrays in C++

How does one assign values to messages with arrays in C++ This is probably more C++ focused, but here is my issue: int8

2020-10-17 17:38:35 -0500 marked best answer Custom Message with uint8[] Reads as string dtype

I'm trying to pass a custom message through a service . I have a C++ node using this service just fine, however in Python I can't seem to pull information from the custom message. When I try to take the passed array, it reads it as a 'str' type. Is there anything I am doing wrong here?

Edit: in Visual Studio Code, when I create a variable field = DensityField() and type "field.data", hovering over "data" reveals that it thinks its a string. Is it possible to force catkin_make to regenerate the messages? I have no idea why it thinks its a string.

GetDensity.srv:

---
DensityField densityfield

DensityField.msg:

uint8 width
uint8 height
uint8[] data

Service Client:

def get_density():
    """
    :rtype: list[int]
    """
    rospy.wait_for_service("static_density")
    try:
        get_density = rospy.ServiceProxy("static_density", GetDensity)
        resp = get_density()
        return resp.densityfield
    except rospy.ServiceException as e:
        rospy.logerr("static_density server is not responding: %s" % (e))

...
    density = get_density()
    occupancy_grid = get_map()
    print(type(density)) # Prints <class 'voronoi_msgs.msg._DensityField.DensityField'>
    print(type(occupancy_grid)) # Prints <class 'nav_msgs.msg._OccupancyGrid.OccupancyGrid'>
    print(density.data[0] + density.data[1])
    np_density = np.array(density.data)

    np_density_filtered = np.multiply(np_density, np_og)
     # Gives error TypeError: ufunc 'multiply' did not contain a loop with signature matching types dtype('S62500') dtype('S62500') dtype('S62500')

The server:

data = []
width = 0
height = 0


def handle_density_request(msg):
    global data, width, height
    response = DensityField()
    response.data = data
    response.height = height
    response.width = width
    print(type(data)) # Prints <type 'list'>
    print(type(data[0])) # Prints <type 'int'>
    return GetDensityResponse(
        densityfield=response
    )


def main():
    global data, width, height
    rospy.init_node("density_server")
    rospy.Service("static_density", GetDensity, handle_density_request)
    rospack = rospkg.RosPack()
    path = rospack.get_path('voronoi_node_generator') + \
        '/data/' + rospy.get_param("~data_name")
    img = cv2.imread(path, 0)
    print(img)
    img = np.flip(img, 0)
    height, width = img.shape
    img = img.flatten()
    data = img.tolist()
    rospy.loginfo("Data length: %d | Width: %d | Height: %d" %
                  (len(data), width, height))
    rospy.loginfo("Data type: %s" % img.dtype)
    rospy.spin()
2020-10-17 17:38:31 -0500 commented answer Custom Message with uint8[] Reads as string dtype

I guess that's on me for assuming it works similar to C++. I see that numpy is needed in this situation.

2020-10-17 17:38:31 -0500 received badge  Commentator
2020-10-17 17:30:36 -0500 received badge  Notable Question (source)
2020-10-14 02:44:53 -0500 received badge  Popular Question (source)
2020-10-13 19:57:57 -0500 edited question Custom Message with uint8[] Reads as string dtype

Custom Message with uint8[] Reads as string dtype I'm trying to pass a custom message through a service . I have a C++ n

2020-10-13 19:55:46 -0500 edited question Custom Message with uint8[] Reads as string dtype

Custom Message with uint8[] Reads as S62500 dtype I'm trying to pass a custom message through a service . I have a C++ n

2020-10-13 16:28:36 -0500 edited question Custom Message with uint8[] Reads as string dtype

Custom Message with uint8[] Reads as S62500 dtype I'm trying to pass a custom message through a service . I have a C++ n

2020-10-13 16:23:47 -0500 asked a question Custom Message with uint8[] Reads as string dtype

Custom Message with uint8[] Reads as S62500 dtype I'm trying to pass a custom message through a service . I have a C++ n

2020-09-19 18:48:47 -0500 received badge  Popular Question (source)
2020-09-19 18:16:14 -0500 marked best answer Physical Multirobot AMCL Not Able To Transform To /map

I'm trying to get multiple physical Turtlebot3's functioning with AMCL with namespaces. My setup works perfectly fine with the Gazebo simulations, but moving it to the real thing causes issues.

After running AMCL I get the error:

No laser scan received (and thus no pose updates have been published) for 1600396510.205957 seconds.  Verify that data is being published on the /tb3_0/scan topic.

I have looked at the solution found here: https://answers.ros.org/question/3259... But I couldn't seem to see what I am doing wrong.

There was also another source that I found here: https://github.com/wachlinn/mrc_hw8/b...

but this seemed to have the same setup that I had.

My steps are as follows:

  1. On the Turtlebot launch ROS_NAMESPACE=tb3_0 roslaunch turtlebot3_bringup turtlebot3_robot.launch multi_robot_name:="tb3_0"
  2. On the Linux workstation (and all following steps) launch ROS_NAMESPACE=tb3_0 roslaunch turtlebot3_bringup turtlebot3_remote.launch multi_robot_name:=tb3_0
  3. roslaunch voronoi_node_generator map_provider.launch (see launch files below)
  4. roslaunch basic_swarm swarm_amcl.launch multi_robot_name:=tb3_0

Here are the two launch files from steps 3

<launch>
  <arg name="map_name"  default="dining"/>
  <node pkg="map_server" name="map_server" type="map_server" args="$(find voronoi_node_generator)/maps/$(arg map_name).yaml"/>
</launch>

and 4: <launch>

  <!-- Arguments -->
  <arg name="scan_topic"        default="scan"/>
  <arg name="initial_pose_x"    default="0.0"/>
  <arg name="initial_pose_y"    default="0.0"/>
  <arg name="initial_pose_a"    default="0.0"/>
  <arg name="multi_robot_name"  doc="User assigned robot namespace."/>
  <arg name="global_frame_id"   default="map"/>
  <arg name="init_with_global"  default="false"/>

  <!-- AMCL -->
  <group ns="$(arg multi_robot_name)">
    <node pkg="amcl" type="amcl" name="amcl">

      <param name="min_particles"             value="500"/>
      <param name="max_particles"             value="3000"/>
      <param name="kld_err"                   value="0.02"/>
      <param name="update_min_d"              value="0.20"/>
      <param name="update_min_a"              value="0.20"/>
      <param name="resample_interval"         value="1"/>
      <param name="transform_tolerance"       value="0.5"/>
      <param name="recovery_alpha_slow"       value="0.00"/>
      <param name="recovery_alpha_fast"       value="0.00"/>
      <param name="initial_pose_x"            value="$(arg initial_pose_x)"/>
      <param name="initial_pose_y"            value="$(arg initial_pose_y)"/>
      <param name="initial_pose_a"            value="$(arg initial_pose_a)"/>
      <param name="gui_publish_rate"          value="50.0"/>

      <remap from="scan"                      to="$(arg scan_topic)"/>
      <param name="laser_max_range"           value="3.5"/>
      <param name="laser_max_beams"           value="180"/>
      <param name="laser_z_hit"               value="0.5"/>
      <param name="laser_z_short"             value="0.05"/>
      <param name="laser_z_max"               value="0.05"/>
      <param name="laser_z_rand"              value="0.5"/>
      <param name="laser_sigma_hit"           value="0.2"/>
      <param name="laser_lambda_short"        value="0.1"/>
      <param name="laser_likelihood_max_dist" value="2.0"/>
      <param name="laser_model_type"          value="likelihood_field"/>

      <param name="odom_model_type"           value="diff"/>
      <param name="odom_alpha1"               value="0.1"/>
      <param name="odom_alpha2"               value="0.1"/>
      <param name="odom_alpha3"               value="0.1"/>
      <param name="odom_alpha4"               value="0.1"/>
      <param name="tf_prefix"                 value="$(arg multi_robot_name)"/>
      <param name="odom_frame_id"             value="$(arg multi_robot_name)/odom"/>
      <param name="base_frame_id"             value="$(arg multi_robot_name)/base_footprint"/>
      <param name="global_frame_id"           value="$(arg global_frame_id)"/>
      <remap from="initialpose"               to ...
(more)
2020-09-19 18:16:00 -0500 answered a question Physical Multirobot AMCL Not Able To Transform To /map

Thanks to @JackB I was able to find the issue. Everything is set up correctly in the launch files. The only issues was w

2020-09-19 18:16:00 -0500 received badge  Rapid Responder (source)
2020-09-18 18:11:13 -0500 commented question Physical Multirobot AMCL Not Able To Transform To /map

@JackB From my understanding, it is. base_scan is the name, but judging by the tf_tree, it still has the tb3_0 tf prefix

2020-09-17 23:28:38 -0500 commented question Physical Multirobot AMCL Not Able To Transform To /map

@JackB Thanks for the response! Indeed. I get some laser readings, and the frame_id field from the message is "base_scan

2020-09-17 23:21:09 -0500 commented question Physical Multirobot AMCL Not Able To Transform To /map

@JackB Indeed. I get some laser readings, and the frame_id field from the message is "base_scan"

2020-09-17 23:20:40 -0500 commented question Physical Multirobot AMCL Not Able To Transform To /map

@JackB Indeed. I get some laser readings, and the frame_id is "base_scan"

2020-09-17 21:48:32 -0500 asked a question Physical Multirobot AMCL Not Able To Transform To /map

Physical Multirobot AMCL Not Able To Transform To /map I'm trying to get multiple physical Turtlebot3's functioning with

2020-08-30 19:12:53 -0500 received badge  Notable Question (source)