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

jsanch2s's profile - activity

2016-12-19 08:42:17 -0500 commented question When using rostopic list only two topics are shown

It seems like you are only running roscore and no other nodes...

2016-12-19 07:37:59 -0500 commented question How to use python_orocos_kdl

Have you checked out this site?

2016-12-08 17:01:47 -0500 answered a question Joystick operation for a gazebo ros youbot

As this tutorial shows, you need to subscribe to your topic /joy and then assign the data from the joystick (with a proper normalization/scaling) to a Twist message which you then can publish to your /cmd_vel topic in order to move your youBot.

The tutorial shows an example of the callback, i.e. where you listen to the joystick data and then assign it to the Twist message:

void TeleopTurtle::joyCallback(const sensor_msgs::Joy::ConstPtr& joy)
{
  geometry_msgs::Twist twist;
  twist.angular.z = a_scale_*joy->axes[angular_];
  twist.linear.x = l_scale_*joy->axes[linear_];
  vel_pub_.publish(twist);
}
2016-12-07 15:52:35 -0500 commented question Joystick operation for a gazebo ros youbot

Have you checked out this tutorial?

2016-12-06 20:43:54 -0500 received badge  Nice Answer (source)
2016-12-05 16:08:24 -0500 answered a question tf2_ros buffer transform PointStamped?

Note: This is not really an answer but it was too long for a comment, sorry.

As I understand it, Buffer inherits from BufferInterface, where it uses TransformRegistration (also defined in the same file) to check if a type is supported, in this case PointStamped. Specifically, it uses the method get to check if that type is supported. Since the output you posted is an empty dictionary, I'm assuming there are no supported types.

They also define an add method that requires the type and a callback (no idea where to get this callback, though).

Perhaps the authors of this package can provide an insight?

2016-12-05 15:45:14 -0500 commented question tf2_ros buffer transform PointStamped?

Could you post the output of tf_buffer.registration.print_me()?

2016-12-04 11:14:58 -0500 received badge  Civic Duty (source)
2016-12-04 08:25:11 -0500 received badge  Critic (source)
2016-12-03 15:57:10 -0500 answered a question ROS-i ABB Unable to access some members of industrial_msgs/CmdJointTrajectory

points in srv.request.trajectory.points is an array as you correctly note in your question. Thus, you should access its elements in order to access their members (e.g. positions, velocities and accelerations). Instead of

srv.request.trajectory.points.positions

try

srv.request.trajectory.points[i].positions

where i is the joint you want to specify.

You might also benefit from this answer.

2016-12-02 16:31:20 -0500 commented question bash: /usr/share/drcsim/setup.sh: No such file or directory

Most likely your .bashrc file contains a line with that path. Be sure is not required before deleting it.

2016-12-02 16:28:21 -0500 commented question The specified base path "/home/abhinav/catkin_ws" contains a CMakeLists.txt but "catkin_make" must be invoked in the root of workspace

See the comment for this answer.

2016-12-02 16:28:21 -0500 received badge  Commentator
2016-12-01 09:37:59 -0500 commented question Problem linking ros in ros::init

I tried your code exactly and wasn't able to reproduce the error. Have you tried removing the build and devel directories and then do catkin_make again?

2016-11-30 04:54:50 -0500 commented question How can I translation motion while applying torque?

What message type are your topics? I.e. what is the output of rostopic info /force and rostopic info /set_link_state?

2016-11-28 16:22:59 -0500 answered a question What should be the messageType for a custom message?

The message type is the name of the package plus the name of the file. For example if your package name is my_pkg_msgs and the file where you defined the message is MyMsg.msg, then the message type is my_pkg_msgs.MyMsg.

You might want to check this tutorial (point 3.).

Hope this helps.

2016-11-23 10:03:54 -0500 commented answer include srv files in python catkin project

Try replacing get with service.srv.get.

2016-11-23 09:16:17 -0500 commented answer include srv files in python catkin project

@215 The code I provided was meant to be a minimal working example. For a tutorial on how to use a server you could check this site. Also is more convenient to define your services in a separate package.

2016-11-23 09:08:59 -0500 commented answer include srv files in python catkin project

@215 The services are defined in the srv folder, and are being used in the service_node; x is defined as a set service and y as a get service.

2016-11-23 08:58:00 -0500 commented answer include srv files in python catkin project

@215 Thanks for pointing that out. I've updated my answer.

2016-11-23 07:47:48 -0500 received badge  Editor (source)
2016-11-23 07:47:17 -0500 answered a question include srv files in python catkin project

As the error says, you are trying to do a relative import (i.e. using ..). Instead, since you are already setting service as a package in your setup.py file you can used that package name directly by changing:

from ..srv import * in service_def.py to from service.service_def import *.

Here's an MWE for the:

Structure:

service/
├── CMakeLists.txt
├── package.xml
├── src
│   └── service_node
└── srv
    ├── get.srv
    ├── __init__.py
    └── set.srv

CMakeLists.txt

cmake_minimum_required(VERSION 2.8.3)
project(service)

find_package(catkin REQUIRED
   rospy
   std_msgs
   message_generation
)

add_service_files(
  FILES
   get.srv
   set.srv
)

generate_messages(
  DEPENDENCIES
  std_msgs
)

catkin_package(
)

package.xml

<?xml version="1.0"?>
<package>
  <name>service</name>
  <version>0.0.0</version>
  <description>The service package</description>

  <maintainer email="jsanch@todo.todo">jsanch</maintainer>

  <license>TODO</license>
  <buildtool_depend>catkin</buildtool_depend>

  <build_depend>rospy</build_depend>
  <build_depend>message_generation</build_depend>

  <run_depend>rospy</run_depend>
  <run_depend>message_runtime</run_depend>
</package>

service_node

#!/usr/bin/env python
#-*- encoding: utf-8 -*-

import rospy
import service.srv


def main():
    print("Creating set")
    x = service.srv.set
    print("Creating get")
    y = service.srv.get

if __name__ == '__main__':
    rospy.init_node('service_node', anonymous=True)
    main()
2016-11-21 08:48:49 -0500 received badge  Necromancer (source)
2016-11-21 08:48:49 -0500 received badge  Teacher (source)
2016-11-21 08:10:05 -0500 commented question Communication between nodes (rospy)

Maybe this answer helps you.

2016-11-21 07:55:56 -0500 answered a question Controlling youbot's arm. brics_actuator/JointPositions

msg.positions is a list of brics_actuator.msg.JointValue messages. Thus, you should fill your message accordingly:

from brics_actuator.msg import JointValue

msg.positions = [brics_actuator.msg.JointValue()]
msg.positions[0].joint_uri = "arm_joint_1"
msg.positions[0].unit = "rad"
msg.positions[0].value = 2
2016-08-17 11:10:19 -0500 received badge  Famous Question (source)
2016-04-26 04:30:48 -0500 received badge  Notable Question (source)
2016-03-12 04:46:20 -0500 received badge  Popular Question (source)
2016-03-03 06:52:46 -0500 received badge  Enthusiast
2016-02-20 08:21:23 -0500 commented answer How to fix a corrupted (boilerplate) toplevel.cmake file?

I had to do the re-install of catkin (i.e. sudo apt-get install --reinstall ros-indigo-catkin), since the toplevel.cmake file in the /opt directory was indeed the wrong one.

2016-02-20 05:18:37 -0500 marked best answer How to fix a corrupted (boilerplate) toplevel.cmake file?

I accidentally replaced my CMakeLists.txt file in my catkin_ws/src directory and then ran catkin_make. This replaced the toplevel.cmake located in this directory /opt/ros/indigo/share/catkin/cmake. Resulting in the following error:


CMake Error: File /home/user/projects/catkin_ws/src/package.xml does not exist.
CMake Error at /opt/ros/indigo/share/catkin/cmake/stamp.cmake:10 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  /opt/ros/indigo/share/catkin/cmake/catkin_package_xml.cmake:61 (stamp)  
  /opt/ros/indigo/share/catkin/cmake/catkin_package_xml.cmake:39 (_catkin_package_xml)  
  /opt/ros/indigo/share/catkin/cmake/catkin_package.cmake:95 (catkin_package_xml)  
  CMakeLists.txt:37 (catkin_package)


CMake Error at /opt/ros/indigo/share/catkin/cmake/catkin_package.cmake:112 (message):
  catkin_package() 'catkin' must be listed as a buildtool dependency in the
  package.xml
Call Stack (most recent call first):  
  /opt/ros/indigo/share/catkin/cmake/catkin_package.cmake:98 (_catkin_package)
  CMakeLists.txt:37 (catkin_package)

This is the same question asked here, however I'm not able to follow the answer given. I tried of replacing the toplevel.cmake located in the directory the /opt/ros/indigo/share/catkin/cmake, however I couldn't find the original one (or how to generate it again).

To be more specific, I would like to know what the best way to proceed is (should I reinstall ROS or is there a better solution?).