点击(此处)折叠或打开
-
catkin_make 编译指定的包.
-
$ catkin_make -DCATKIN_WHITELIST_PACKAGES="package1;package2"
-
- 恢复编译所有的包
- $ catkin_make -DCATKIN_WHITELIST_PACKAGES=""
点击(此处)折叠或打开
-
rostopic list #列出话题
- rostopic echo 话题 #接收话题
编译时出现 .msg: Invalid declaration: 类型 变量. 切记 <类型 变量>之间的分割为空格 不能是tab.
Built-in types:
Primitive Type |
Serialization |
C++ |
Python2 |
Python3 |
bool (1) |
unsigned 8-bit int |
uint8_t (2) |
bool |
|
int8 |
signed 8-bit int |
int8_t |
int |
|
uint8 |
unsigned 8-bit int |
uint8_t |
int (3) |
|
int16 |
signed 16-bit int |
int16_t |
int |
|
uint16 |
unsigned 16-bit int |
uint16_t |
int |
|
int32 |
signed 32-bit int |
int32_t |
int |
|
uint32 |
unsigned 32-bit int |
uint32_t |
int |
|
int64 |
signed 64-bit int |
int64_t |
long |
int |
uint64 |
unsigned 64-bit int |
uint64_t |
long |
int |
float32 |
32-bit IEEE float |
float |
float |
|
float64 |
64-bit IEEE float |
double |
float |
|
string |
ascii string (4) |
std::string |
str |
bytes |
time |
secs/nsecs unsigned 32-bit ints |
|
|
|
duration |
secs/nsecs signed 32-bit ints |
|
|
查看两个frame的坐标系转化关系
rosrun tf tf_echo base_link map
rosrun tf tf_monitor base_link map
命令行发布一个topic
rostopic pub /crash_jump_cmd std_msgs/Empty
ROS_INFO等没有输出的情况:
点击(此处)折叠或打开
-
制作文件 custom_rosconsole.conf
-
-
# Set the default ros output to warning and higher
-
log4j.logger.ros=WARN
-
# Override my package to output everything (Change the level to fit your needs)
-
log4j.logger.ros.你的包名=DEBUG
-
-
1. 在bash环境下
-
export ROSCONSOLE_CONFIG_FILE=<config_file_path>/custom_rosconsole.conf
-
-
2. 或者在 launch 文件中.
-
<launch>
-
<env name="ROSCONSOLE_CONFIG_FILE"
-
value="$(find mypackage)/custom_rosconsole.conf"/>
-
<node pkg="mypackage" type="mynode" name="mynode" output="screen"/>
-
</launch>
-
-
还有一种是在代码中设置.
-
#include <ros/console.h>
-
if (ros::console::set_logger_level(ROSCONSOLE_DEFAULT_NAME, ros::console::levels::Debug)) { // Change the level to fit your needs
-
ros::console::notifyLoggerLevelsChanged();
- }